/*--------------------------------------------------------------------------
  Project:  Manual 2D Library - m2d
  File:     manualButton.h

  Copyright (C)2007-2009 Nintendo  All Rights Reserved.

  These coded instructions, statements, and computer programs contain
  proprietary information of Nintendo of America Inc. and/or Nintendo
  Company Ltd., and are protected by Federal copyright law. They may
  not be disclosed to third parties or copied or duplicated in any form,
  in whole or in part, without the prior written consent of Nintendo.

  $Revision: 1758 $
 *-------------------------------------------------------------------------*/

#ifndef NTMV_M2D_MANUALBUTTON_H_
#define NTMV_M2D_MANUALBUTTON_H_

#if _MSC_VER > 1000 || defined(__CWCC__)
#pragma once
#endif

#include <ntmv/m2d/objButton.h>
#include <ntmv/m2d/objManager.h>

namespace ntmv
{
namespace m2d
{

/*
    Manual button class
*/
class ManualButton : public ObjButton
{
    typedef ObjButton   Base;

public:
                        ManualButton();

    void                Init(
                            Point                   position,
                            Size                    size,
                            ObjManager::CellHandle  buttonCell,
                            ObjManager::CellHandle  allowButtonCell,
                            ObjManager::CellHandle  textRectCell);

    virtual void        Draw(
                            const ObjG2dInfo&   info,
                            Point               parentPos);

    bool                IsAllow() const         { return mbAllow; }

    void                SetAllow(bool bAllow);

    bool                IsChecked() const       { return mbChecked; }

    void                SetChecked(bool value)  { mbChecked = value; }

    void                CheckHit(Point point);

private:
    ObjManager::CellHandle
                        mButtonCell;
    ObjManager::CellHandle
                        mAllowButtonCell;
    ObjManager::CellHandle
                        mTextRectCell;

    bool                mbAllow;
    bool                mbChecked;              // TRUE when this is checked
};

}   // namespace m2d
}   // namespace ntmv

/* NTMV_M2D_MANUALBUTTON_H_ */
#endif
