OROCHI
 
Loading...
Searching...
No Matches
GxGuiFormUnitTree.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 GxGuiFormUnitTreeBody;
17
18//===========================================================================
20//===========================================================================
21class GxGuiFormUnitTree : public GxGuiFormTreeBase
22{
23 //-----------------------------------------------------------
25 //-----------------------------------------------------------
27public:
28 GX_RTTI_CLASS(GxGuiFormUnitTree, GxGuiFormTreeBase)
29 // 基底継承クラス用禁止宣言
30 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiFormUnitTree)
31
32
33 //-----------------------------------------------------------
35 //-----------------------------------------------------------
37public:
39 GxGuiFormUnitTree( void );
41 GxGuiFormUnitTree( GxToolBase* pTool );
42
44 //-----------------------------------------------------------
46 //-----------------------------------------------------------
48protected:
50 GxGuiFormTreeBodyBase* createTreeBody( void ) override;
51
53 //-----------------------------------------------------------
55 //-----------------------------------------------------------
57public:
59 constexpr GxGuiFormUnitTreeBody* getGuiBody( void ) const { return _pGuiBody; }
60
62 //-------------------------------------------------------------
64 //-------------------------------------------------------------
66protected:
67 GxGuiFormUnitTreeBody* _pGuiBody;
68
70};
71
72//===========================================================================
74//===========================================================================
75class GxGuiFormUnitTreeBody : public GxGuiFormTreeBodyBase
76{
77 //-----------------------------------------------------------
79 //-----------------------------------------------------------
81public:
82 GX_RTTI_CLASS(GxGuiFormUnitTreeBody, GxGuiFormTreeBodyBase)
83 // 基底継承クラス用禁止宣言
84 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiFormUnitTreeBody)
85
86private:
88 static constexpr u32 INITIAL_ALLOCATE_DRAW_NODE_COUNT = GxMath::VALUE_2K;
89
91 //-----------------------------------------------------------
93 //-----------------------------------------------------------
95public:
97 GxGuiFormUnitTreeBody( void );
98
100 b32 initialize( void ) override;
101
103 //-----------------------------------------------------------
105 //-----------------------------------------------------------
107public:
109 void onDragMouseUp( u32 button ) override;
110
112 void addOpenNode( GxUnitBase* pUnit );
113
114protected:
116 void update( void ) override;
117
119 void onDraw( void ) override;
121 void postDraw( void ) override;
122
124 void onDoubleClick( const GxPoint2& position, u32 button ) override;
126 void onKeyDown( GxKeyboard::KEY key ) override;
127
129 void onDropFile(GX_CSTR pFilePath) override;
130
132 void onMouseMove( const GxPoint2& position ) override;
134 void onMouseDown( const GxPoint2& position, u32 button ) override;
136 void onMouseUp( const GxPoint2& position, u32 button ) override;
138 void onMouseLeave( void ) override;
140 void onMouseWheel( const GxPoint2& position, s32 rotate ) override;
141
142private:
144 void setControlIconRect( s32 clickIndex, GxRect* pRect );
146 void setMarkIconRect( GxUnitBase* pUnit, s32 clickIndex, GxRect* pRect );
147
149 void createPopupMenu( const GxPoint2& position, const GxPropertyTable& table );
151 void createPopupMenuPropertyTable( GxPropertyTable& table, GxUnitBase* pUnit = nullptr );
152
154 void eventCreateUnit( void* pRtti );
156 void eventKillUnit( void );
158 void eventCutUnit( void );
160 void eventCopyUnit( void );
162 void eventPasteUnit( void );
164 void eventPasteUnitInner( GxUnitBase* pUnit );
165
167 void createUnitInstance(void);
169 void removeUnitInstance(void);
170
171#if defined( _WINDOWS )
173 void eventRenameUnit( void );
175 static LRESULT CALLBACK callbackDialog(HWND handleDialog, UINT message, WPARAM wParam, LPARAM lParam);
176#endif // _WINDOWS
177
179 void eventOnUpdateUnit(void);
181 void eventOffUpdateUnit(void);
183 void eventOnRenderUnit(void);
185 void eventOffRenderUnit(void);
186
188 GxUnitBase* createUnit( const GxRtti& rtti );
190 void killUnit( GxUnitBase* pUnit );
191
193 void addSelectNode( GxUnitBase* pUnit, b32 isExistsCheck = true );
195 void removeSelectNode( GxUnitBase* pUnit, b32 isExistsCheck = true );
197 void eraseAllSelectNode( void );
199 void updateSelectNodeArray( GxUnitBase* pUnit );
200
202 void addClickNode( GxUnitBase* pUnit, b32 isExistsCheck = true );
204 void removeClickNode( GxUnitBase* pUnit, b32 isExistsCheck = true );
206 void updateClickNodeArray( GxUnitBase* pUnit );
207
209 void addSearchOnClickNode( GxUnitBase* pUnit );
211 void removeAllSearchClickNode( void );
213 b32 isOpenChildren( GxUnitBase* pUnit ) const;
214
216 void createToolUnitProperty(b32 isForce);
217
219 static b32 findSearchString( GxUnitBase* pUnit, GX_CSTR searchString );
221 static b32 findSearchStringChildren( GxUnitBase* pUnit, GX_CSTR searchString );
223 static b32 findSearchStringChildrenInner( GxUnitBase* pUnit, GX_CSTR searchString );
224
226 void drawTree( GxUnitBase* pUnit, const u32 depth, GxRect& rect );
228 void drawNode( GxUnitBase* pUnit, const u32 depth, const GxRect& rect );
229
231 //-----------------------------------------------------------
233 //-----------------------------------------------------------
235public:
237 GX_FORCE_INLINE void setCreateUnitCallback(GxCallback::GxHandlerBase handle) { _handleCreateUnit = handle; }
239 GX_FORCE_INLINE void setKillUnitCallback(GxCallback::GxHandlerBase handle) { _handleKillUnit = handle; }
241 constexpr void setRootUnitArray(GxArrayClassBase* pArray) { _pRootUnitArray = pArray; }
242
244 //-----------------------------------------------------------
246 //-----------------------------------------------------------
248private:
249 GxArrayClassBase* _pRootUnitArray;
250
251 s32 _lastClickNodeIndex;
252 s32 _insertNodeIndex;
253
254 b32 _isRunningDragNode;
255 b32 _isAbleToDragNode;
256 b32 _isForceSetRootParent;
257 b32 _isCreatingToolUnitProperty;
258
259 GxCallback::GxHandlerBase _handleCreateUnit;
260 GxCallback::GxHandlerBase _handleKillUnit;
261
262 GxToolUnitProperty* _pToolUnitProperty;
263
265};
266
267GX_CORE_NAMESPACE_END()
268
269#endif // GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
配列クラス
Definition GxArrayClassBase.h:18
ハンドラ基本クラス
Definition GxCallback.h:27
static constexpr u32 VALUE_2K
2K
Definition GxMath.h:130
プロパティテーブルクラス
Definition GxProperty.h:1641
実行時型情報クラス
Definition GxRtti.h:154
ユニット基礎クラス
Definition GxUnitBase.h:45
座標
Definition GxStruct.h:867
矩形
Definition GxStruct.h:951
32bitブーリアン
Definition GxDefine.h:173