1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     SmButton.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: $
16  *---------------------------------------------------------------------------*/
17 #ifndef SM_BUTTON_H_
18 #define SM_BUTTON_H_
19 
20 #include "../include/SmPrimitive.h"
21 #include "../include/SmMessage.h"
22 #include "../include/SmRectCollision.h"
23 
24 //------------------------------------------------------------------------------
25 // �{�^���N���X
26 class SmButton : public SmMessage
27 {
28 public:
29     // �R���X�g���N�^
30     SmButton( uint x, uint y, uint w, uint h );
31 
32     // �f�X�g���N�^
33     ~SmButton();
34 
35     // ���b�Z�[�W��M
36     virtual bool ReceveMessage( SmMessageType type, void* object, uint targetId );
37 
38     // �`��
39     virtual void Render();
40 
41     // �{�^����Ԃ�ݒ肷��
42     void SetSwitch( bool bswitch );
43 
44     // �{�^����Ԃ��X���b�v����
45     void SwapSwitch();
46 
47     // �X�C�b�`�I���I�t��Ԃ��擾����
IsSwitch()48     bool IsSwitch()
49     {
50         return m_IsSwitch;
51     }
52 
53     // �{�^���J���[��ݒ肷��
54     void SetColor( nw::ut::Color8 onColor, nw::ut::Color8 offColor );
55 
56 private:
57     Sm2DPrimPC*         m_Button;
58     Sm2DPrimPC*         m_PushButton;
59 
60     u16                 m_LastX;
61     u16                 m_LastY;
62 
63     SmRectCollision     m_Collision;
64 
65     bool                m_IsPressed;
66     bool                m_IsGrab;
67     bool                m_IsSwitch;
68 
69     nw::ut::Color8      m_OnColor;
70     nw::ut::Color8      m_OffColor;
71 };
72 
73 
74 
75 
76 #endif  // SM_BUTTON_H_
77