1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     SmLytBUtton.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 1 $
14  *---------------------------------------------------------------------------*/
15 #ifndef SM_LYT_BUTTON_H_
16 #define SM_LYT_BUTTON_H_
17 
18 //#include <nw/demo.h>
19 
20 #include "../include/SmLayout.h"
21 #include "../include/SmMessage.h"
22 #include "../include/SmRectCollision.h"
23 
24 //------------------------------------------------------------------------------
25 // �{�^���N���X
26 class SmLytButton : public SmMessage
27 {
28 public:
29     // �R���X�g���N�^
30     SmLytButton( SmLayout* smLayout, const wchar_t* string, const char* bounding );
31 
32     // �f�X�g���N�^
33     ~SmLytButton();
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     /*
54         �z�u�@�\
55     */
56     // �ʒu
57     void SetPosition( f32 x, f32 y );
58 
59     // �\��/��\���؂�ւ�
SetVisible(bool visible)60     virtual void SetVisible( bool visible )
61     {
62         // ���C�A�E�g�̕\��/��\����؂�ւ�
63         m_Layout->SetVisible( visible );
64     }
65 
66 
67 private:
68     SmLayout*           m_Layout;
69 
70     u16                 m_LastX;
71     u16                 m_LastY;
72 
73     SmRectCollision     m_Collision;
74 
75     wchar_t*            m_String;
76 
77     bool                m_IsPressed;
78     bool                m_IsGrab;
79     bool                m_IsSwitch;
80 };
81 
82 
83 
84 
85 #endif  // SM_LYT_BUTTON_H_
86