OROCHI
 
Loading...
Searching...
No Matches
GxGuiSplitterCross.h
Go to the documentation of this file.
1//===========================================================================
11//===========================================================================
12#pragma once
13
14#if GX_DEVELOP
15
16GX_CORE_NAMESPACE_BEGIN()
17
18//===========================================================================
20//===========================================================================
21class GxGuiSplitterCross : public GxGuiBase
22{
23 //-----------------------------------------------------------
25 //-----------------------------------------------------------
27public:
28 GX_RTTI_CLASS(GxGuiSplitterCross, GxGuiBase)
29 // GxClassBaseReference継承クラス用禁止宣言
30 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiSplitterCross)
31
32private:
33 struct GxBar;
34 class GxGuiList;
35
37 //-----------------------------------------------------------
39 //-----------------------------------------------------------
41public:
43 GxGuiSplitterCross(void);
44
46 //-----------------------------------------------------------
48 //-----------------------------------------------------------
50public:
52 b32 initialize( void ) override;
53
55 void cleanup( void ) override;
56
58 void update( void ) override;
59
61 void screenRender( void ) override;
62
64 void onDraw( void ) override;
65
66public:
68 GxSize getUseRegionSize(void) const override;
69
70protected:
72 GxGuiGraphics::MOUSE_CURSOR getMouseCursor(void) override;
73
75 void onRemoveGui(GxGuiBase* pGui) override;
76
78 void onMouseDown(const GxPoint2& position, u32 button) override;
79
81 void onSize(const GxSize& size) override;
82
84 GxGuiBase* getGui(const GxPoint2& position, const GxRect& parentClipRect) override;
85
87 //-----------------------------------------------------------
89 //-----------------------------------------------------------
91public:
94 constexpr u32 getColumnCount( void ) const { return _columnCount; }
95
98 constexpr u32 getRowCount( void ) const { return _rowCount; }
99
101 void setColumnRow( s32 column, s32 row );
102
104 void insertColumn( u32 column, u32 num );
105
107 void insertRow( u32 row, u32 num );
108
110 void deleteColumn( u32 column, u32 num );
111
113 void deleteRow( u32 row, u32 num );
114
116 void setGui( GxGuiBase* pGui, u32 column, u32 row );
117
119 GxGuiBase* getGuiColumnRow( u32 column, u32 row );
120
122 const GxGuiBase* getGuiColumnRow( u32 column, u32 row ) const;
123
125 void setColumnWidth( s32 width );
126
128 void setColumnWidth( s32 width, u32 index );
129
131 u32 getColumnWidth( u32 index ) const;
132
134 void setRowHeight( s32 height );
135
137 void setRowHeight( s32 height, u32 index );
138
140 u32 getRowWidth( u32 index ) const;
141
143 u32 getRowHeight( u32 index ) const;
144
146 void setUseControlColumnBar( b32 use, u32 index );
147
149 void setUseControlColumnBar( b32 use );
150
152 void setUseControlRowBar( b32 use, u32 index );
153
155 void setUseControlRowBar( b32 use );
156
158 void setColumnBarWidth( s32 width );
159
161 void setRowBarWidth( s32 width );
162
164 void setColumnBarWidth( s32 viewWidth, s32 controlWidth );
165
167 void setRowBarWidth( s32 viewWidth, s32 controlWidth );
168
170 void setColumnBarWidth( s32 viewWidth, s32 controlWidth, u32 index );
171
173 void setRowBarWidth( s32 viewWidth, s32 controlWidth, u32 index );
174
176 u32 getColumnBarWidth( u32 index ) const;
177
179 u32 getRowBarWidth( u32 index ) const;
180
182 u32 getColumnBarControlWidth( u32 index ) const;
183
185 u32 getRowBarControlWidth( u32 index ) const;
186
188 void updateLayout( void );
189
191 void updateLayoutGui( u32 row, u32 column );
192
194 GX_FORCE_INLINE void setIsGetSizeFromParent( b32 isGetSizeFromParent ){ _isGetSizeFromParent = isGetSizeFromParent; }
195
197 constexpr s32 getControlColumnBarIndex( void ) const { return _controlColumnBarIndex; }
198
200 constexpr s32 getControlRowBarIndex( void ){ return _controlRowBarIndex; }
201
203 GxGuiBase* getSelectedGui( void ) const;
204
206 GxPoint2 getSelectedGuiColumnRow( void ) const;
207
209 GxPoint2 getColumnRowFromScreenPos( const GxPoint2& screenPosition );
210
212 GxRect getClientRowRect( u32 row ) const;
213
215 GxRect getClientColumnRect( u32 row ) const;
216
218 GxRect getClientColumnRowRect( u32 column, u32 row ) const;
219
220private:
222 void testHitControlBar(const GxPoint2& position, s32& controlRowBarIndex, s32& controlColumnBarIndex, GxPoint2& offset);
223
225 void controlBarMouseMove(const GxPoint2& position);
226
228 GxRect getColumnBarRect(s32 index) const;
229
231 GxRect getRowBarRect(s32 index) const;
232
234 void getColumnBarMinMax(u32 columnIndex, GxRect& minRect, GxRect& maxRect) const;
235
237 void getRowBarMinMax(u32 rowIndex, GxRect& minRect, GxRect& maxRect) const;
238
240 //-----------------------------------------------------------
242 //-----------------------------------------------------------
244private:
245 s32 _controlColumnBarIndex;
246 s32 _controlRowBarIndex;
247
248 GxPoint2 _offset;
249
250 GxBar* _pColumnBarTable;
251 GxBar* _pRowBarTable;
252
253 b32 _isGetSizeFromParent;
254
255protected:
256 u32 _columnCount;
257 u32 _rowCount;
258
259 GxGuiList* _pGuiList;
260
262};
263
264//===========================================================================
266//===========================================================================
267class GxGuiSplitterCross::GxGuiList : public GxClassBase
268{
269 //-----------------------------------------------------------
271 //-----------------------------------------------------------
273public:
274 GX_RTTI_CLASS(GxGuiList, GxClassBase)
275 // GxClassBaseReference継承クラス用禁止宣言
276 GX_PROHIBIT_CLASS_BASE(GxGuiList)
277
278 // new, delete定義
279 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
280
281
282 //-----------------------------------------------------------
284 //-----------------------------------------------------------
286public:
288 GxGuiList(void) : _ppGuiBase(nullptr), _column(0), _row(0){}
290 ~GxGuiList(void) override;
291
293 //-----------------------------------------------------------
295 //-----------------------------------------------------------
297public:
299 void create( u32 column, u32 row );
300
302 //-----------------------------------------------------------
304 //-----------------------------------------------------------
306public:
308 void setGuiColumnRow( GxGuiBase* pGui, u32 column, u32 row );
309
311 GxGuiBase* getGuiColumnRow( u32 column, u32 row );
312
314 //-----------------------------------------------------------
316 //-----------------------------------------------------------
318private:
319 GxGuiBase** _ppGuiBase;
320
321 u32 _column;
322 u32 _row;
323
325};
326
327//===========================================================================
329//===========================================================================
330struct GxGuiSplitterCross::GxBar : public GxStructBase
331{
332 //-----------------------------------------------------------
334 //-----------------------------------------------------------
336public:
337 GX_RTTI_STRUCT(GxBar)
338
339 // new, delete定義
340 // 開発用アロケータを使う
341 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
342
343
344 enum class OFFSET_BASIS
345 {
346 LEFT,
347 RIGHT,
348
349 TOP = LEFT,
350 BOTTOM = RIGHT
351 };
352
354 static constexpr u32 SPLIT_VIEW_WIDTH_DEFAULT = 4;
356 static constexpr u32 SPLIT_CONTROL_WIDTH_DEFAULT = 4;
357
359 //-----------------------------------------------------------
361 //-----------------------------------------------------------
363public:
365 GxBar(void) : _useControl(true), _offset(0), _barViewWidth(SPLIT_VIEW_WIDTH_DEFAULT), _barControlWidth(SPLIT_CONTROL_WIDTH_DEFAULT){}
366
368 //-----------------------------------------------------------
370 //-----------------------------------------------------------
372public:
373 b32 _useControl;
374 u32 _offset;
375 u32 _barViewWidth;
376 u32 _barControlWidth;
377
379};
380
381GX_CORE_NAMESPACE_END()
382
383#endif // GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
オブジェクト基底クラス
Definition GxBase.h:88
座標
Definition GxStruct.h:867
矩形
Definition GxStruct.h:951
サイズ
Definition GxStruct.h:730
Definition GxBase.h:24
32bitブーリアン
Definition GxDefine.h:173