55
66TOSHI_NAMESPACE_BEGIN
77
8+ class TGUIScreen ;
9+
10+ #define STATE_ENABLED 0x01
11+ #define STATE_FOCUSED 0x02
12+ #define STATE_VISIBLE 0x04
13+ #define STATE_ROLLOVER 0x08
14+ #define STATE_SELECTED 0x10
15+ #define STATE_ONSCREEN (STATE_ENABLED | STATE_VISIBLE)
16+
817class TGUIINTERFACE_EXPORTS TGUIWidget : public TGUIDeserialisable
918 , public TNodeList<TGUIWidget>::TNode
1019{
1120 DECLARE_DYNAMIC (TGUIWidget)
1221
13- enum State
14- {
15- STATE_ENABLED = BITFIELD (0 ),
16- STATE_FOCUSED = BITFIELD (1 ),
17- STATE_VISIBLE = BITFIELD (2 ),
18- STATE_ROLLOVER = BITFIELD (3 ),
19- STATE_SELECTED = BITFIELD (4 ),
20- };
21-
2222public:
23+
24+ TGUIWidget ();
25+
26+ // $TGUIInterface: FUNCTION 1001dd80
27+ void SetSize (TINT a_iWidth, TINT a_iHeight)
28+ {
29+ if (!m_iSizeModeHoriz && !m_iSizeModeVert) {
30+ return ;
31+ }
32+ if (m_iWidth != a_iWidth || m_iHeight != a_iHeight) {
33+ m_bIsEnabled = TFALSE;
34+ }
35+ m_iWidth = a_iWidth;
36+ m_iHeight = a_iHeight;
37+ }
38+ void InvalidateComponentCache (TBOOL a_bRecursive);
39+ void SetState (TUINT a_iState, TUINT a_iState2);
40+ // $TGUIInterface: FUNCTION 1001e630
41+ TBOOL CanFocus ()
42+ {
43+ for (TGUIWidget *widget = this ; widget; widget = widget->m_pParentWidget ) {
44+ if (!widget->IsState (STATE_ENABLED) || !widget->IsState (STATE_VISIBLE)) {
45+ return TFALSE;
46+ }
47+ }
48+ return TTRUE;
49+ }
50+ TGUIScreen *GetScreen ();
2351 // $TGUIInterface: FUNCTION 100076c0
2452 TINT GetWidth () const
2553 {
@@ -30,10 +58,26 @@ class TGUIINTERFACE_EXPORTS TGUIWidget : public TGUIDeserialisable
3058 {
3159 return m_iHeight;
3260 }
61+ // $TGUIInterface: FUNCTION 10007550
62+ TBOOL IsState (TUINT a_iStateMask, TUINT a_iExpectedState) const
63+ {
64+ return (m_iState & a_iStateMask) == a_iExpectedState;
65+ }
66+ // $TGUIInterface: FUNCTION 10007570
67+ TBOOL IsState (TUINT a_iStateMask) const
68+ {
69+ return (m_iState & a_iStateMask) != 0 ;
70+ }
71+
3372
3473private:
35- TSHORT m_iWidth; // 0x70
36- TSHORT m_iHeight; // 0x72
74+ TGUIWidget *m_pParentWidget; // 0x44
75+ TSHORT m_iWidth; // 0x70
76+ TSHORT m_iHeight; // 0x72
77+ TINT m_iSizeModeHoriz; // 0x74
78+ TINT m_iSizeModeVert; // 0x78
79+ TBOOL m_bIsEnabled; // 0x84
80+ TUINT m_iState; // 0x88
3781};
3882
3983TOSHI_NAMESPACE_END
0 commit comments