OROCHI
 
Loading...
Searching...
No Matches
GxGuiFormTreeBase.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if GX_DEVELOP
13
14GX_CORE_NAMESPACE_BEGIN()
15
16class GxGuiFormTreeBodyBase;
17class GxGuiSplitter;
18//===========================================================================
20//===========================================================================
21class GxGuiFormTreeBase : public GxGuiForm
22{
23 //-----------------------------------------------------------
25 //-----------------------------------------------------------
27public:
28 GX_RTTI_ABSTRACT_CLASS(GxGuiFormTreeBase, GxGuiForm)
29 // 基底継承クラス用禁止宣言
30 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiFormTreeBase)
31
32
33 //-----------------------------------------------------------
35 //-----------------------------------------------------------
37public:
39 GxGuiFormTreeBase( void );
41 GxGuiFormTreeBase( GxToolBase* pTool );
42
44 b32 initialize( void ) override;
45
47 //-----------------------------------------------------------
49 //-----------------------------------------------------------
51protected:
53 void update( void ) override;
54
56 virtual GxGuiFormTreeBodyBase* createTreeBody(void) = 0;
57
59 //-----------------------------------------------------------
61 //-----------------------------------------------------------
63public:
65 constexpr u32 getItemCount( void ) const { return _itemCount; }
67 constexpr void setItemCount( u32 count ) { _itemCount = count; }
69 constexpr void addItemCount( void ) { _itemCount++; }
71 constexpr s32 getScrollOffsetY( void ) const { return _scrollOffsetY; }
73 constexpr void setScrollOffsetY( s32 offset ) { _scrollOffsetY = offset; }
75 GX_FORCE_INLINE b32 isDrawAttributeFilter( GxUnitBase::ATTRIBUTE attribute ) const { return _drawAttributeFilter & attribute ? true : false; }
77 GX_FORCE_INLINE void setDrawAttributeFilter( GxUnitBase::ATTRIBUTE attribute, b32 enable ) { enable ? _drawAttributeFilter |= attribute : _drawAttributeFilter &= ~attribute; }
79 GX_FORCE_INLINE b32 isEnablePopupMenu( void ) const { return _enablePopupMenu; }
81 GX_FORCE_INLINE void setEnablePopupMenu( b32 enable ) { _enablePopupMenu = enable; }
83 constexpr GxGuiSplitter* getSplitter( void ) const { return _pSplitter; }
85 constexpr GX_CSTR getSearchString( void ) const { return _searchString.getString(); }
87 GX_FORCE_INLINE void setSearchString( const GxString& searchString ) { _searchString = searchString; }
88
90 //-----------------------------------------------------------
92 //-----------------------------------------------------------
94protected:
95 GxToolBase* _pParentTool;
96
97 GxGuiSplitter* _pSplitter;
98 GxGuiFormTreeBodyBase* _pFormBody;
99 GxGuiForm* _pFormBar;
100
101 GxString _searchString;
102
103 u32 _itemCount;
104 s32 _scrollOffsetY;
105
106 u32 _drawAttributeFilter;
107
108 b32 _enablePopupMenu;
109
111};
112
113//===========================================================================
115//===========================================================================
116class GxGuiFormTreeBodyBase : public GxGuiForm
117{
118 //-----------------------------------------------------------
120 //-----------------------------------------------------------
122public:
123 GX_RTTI_CLASS(GxGuiFormTreeBodyBase, GxGuiForm)
124 // 基底継承クラス用禁止宣言
125 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiFormTreeBodyBase)
126
127protected:
129 static constexpr u32 REGION_HEIGHT = 16;
131 static constexpr s32 MARGIN_1 = 1;
133 static constexpr s32 MARGIN_2 = 2;
135 static constexpr s32 ICON_SIZE = 14;
136
138 //-----------------------------------------------------------
140 //-----------------------------------------------------------
142public:
144 GxGuiFormTreeBodyBase( void );
145
147 //-----------------------------------------------------------
149 //-----------------------------------------------------------
151public:
153 constexpr void setParentTool(GxToolBase* pTool ) { _pParentTool = pTool; }
155 constexpr void setParentForm( GxGuiFormTreeBase* pForm ) { _pParentForm = pForm; }
156
158 //-----------------------------------------------------------
160 //-----------------------------------------------------------
162protected:
163 GxToolBase* _pParentTool;
164 GxGuiFormTreeBase* _pParentForm;
165
166 GxArrayClassBase _drawNodeArray;
167 GxArrayClassBase _clickNodeArray;
168 GxArrayClassBase _searchOnClickNodeArray;
169 GxArrayClassBase _searchOffClickNodeArray;
170
171 s32 _drawMin;
172 s32 _drawMax;
173
175};
176
177//===========================================================================
179//===========================================================================
180class GxGuiFormTreeBar : public GxGuiForm
181{
182 //-----------------------------------------------------------
184 //-----------------------------------------------------------
186public:
187 GX_RTTI_CLASS(GxGuiFormTreeBar, GxGuiForm)
188 // 基底継承クラス用禁止宣言
189 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiFormTreeBar)
190
191
192 //-----------------------------------------------------------
194 //-----------------------------------------------------------
196public:
198 GxGuiFormTreeBar( void );
200 GxGuiFormTreeBar( GxGuiFormTreeBase* pForm );
201
203 //-----------------------------------------------------------
205 //-----------------------------------------------------------
207protected:
209 void update( void ) override;
210
212 void onMouseWheel( const GxPoint2& position, s32 rotate ) override;
213
215 //-----------------------------------------------------------
217 //-----------------------------------------------------------
219private:
220 GxGuiFormTreeBase* _pParentForm;
221
222 s32 _oldScrollOffsetY;
223
225};
226
227GX_CORE_NAMESPACE_END()
228
229#endif // GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
配列クラス
Definition GxArrayClassBase.h:18
ATTRIBUTE
属性
Definition GxUnitBase.h:71
座標
Definition GxStruct.h:867
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173