15GX_CORE_NAMESPACE_BEGIN()
29class GxGuiWindow :
public GxGuiBase
42 enum class FAIRING_MODE
50 enum class DOCKING_MODE
63 enum class CONTROL_MODE
88 static constexpr u32 CAPTION_SIZE_Y = 16;
90 static constexpr u32 WINDOW_FRAME = 4;
92 static constexpr u32 CAPTION_MARGIN_TOP = 0;
94 static constexpr u32 CAPTION_MARGIN_SIDE = 4;
96 static constexpr u32 CAPTION_MARGIN_BOTTOM = 2;
98 static constexpr u32 BUTTON_SIZE = CAPTION_SIZE_Y - CAPTION_MARGIN_TOP - CAPTION_MARGIN_BOTTOM;
100 static constexpr u32 BUTTON_MARGIN_SIDE = 2;
143 GxGuiWindow(
b32 useCloseWindowButton,
b32 useMinWindowButton,
b32 useMaxWindowButton,
b32 useCaption =
true,
b32 isOutsideWindow =
false);
148 void resetWindow(
void);
158 b32 initialize(
void )
override;
161 void update(
void )
override;
164 void cleanup(
void )
override;
167 void closeChild(
void )
override;
170 void onNoClientDraw(
void )
override;
174 void setRegion(
const GxRect& rect,
b32 force =
false )
override;
178 void preDraw(
void )
override;
180 void postDraw(
void )
override;
184 void screenRender(
void )
override;
187 void setCaptionName( GX_CSTR pName );
190 GX_FORCE_INLINE
void setCaptionName(
const GxString& name ){ setCaptionName( name.
getString() ); }
194 GX_FORCE_INLINE
const GxString& getCaptionName(
void )
const {
return _captionName; }
200 void clearMenuBar(
void);
206 void clearViewBar(
void);
209 void setPopupMenu(GxGuiMenu* pGuiMenu);
212 void setPopupHover(
const GxPoint2& position, GX_CSTR message,
const GxGuiBase* pOwner,
b32 useAdjust =
true);
215 void closeHover(
void);
218 void setFairingMode( FAIRING_MODE mode );
221 void maximize(
void );
224 void minimize(
void );
227 void normalize(
void );
230 GX_FORCE_INLINE
virtual GxSize getDefaultWindowSize(
void)
const {
return GxSize(400, 300); }
233 GxSize getClampedRegionSize(
const GxSize& requestSize )
const override;
236 void onSize(
const GxSize& size)
override;
239 GX_FORCE_INLINE
virtual void closeAll(
void) { eventClose(); }
241 void eventClose(
void);
244 GxRect calculateClientRect(
const GxRect& clientRect )
const override;
247 void setPositionInScreen(
const GxSize& screenSize);
250 void controlWindowOnMouseDown(
const GxPoint2& position, u32 button);
253 GxRect calcFairingRect(FAIRING_MODE mode)
const;
256 HIT getMouseHitTest(
const GxPoint2& point);
259 void updateCaption(
void);
263 static LRESULT CALLBACK wndProc(HWND windowHandle, UINT uMessage, WPARAM wParam, LPARAM lParam);
268 virtual void controlWindow(
void);
277 GxGuiGraphics::MOUSE_CURSOR getMouseCursor(
void)
override;
280 GX_FORCE_INLINE
void onMouseDown(
const GxPoint2& , u32 )
override {};
283 void onNoClientMouseDown(
const GxPoint2& position, u32 button)
override;
286 void onMouseUp(
const GxPoint2& position, u32 button)
override;
289 void onNoClientDoubleClick(
const GxPoint2& position, u32 button)
override;
292 void onActive(
b32 active)
override;
295 void onMouseLeave(
void)
override;
298 static GxRect calcDockingRect(
const GxRect& windowRect, DOCKING_MODE mode);
301 GX_FORCE_INLINE
virtual DOCKING_MODE getDockingModeFromGuide(
void)
const {
return DOCKING_MODE::OFF; }
305 void createOutsideWindow(
void);
307 void releaseOutsideWindow(
void);
318 constexpr void setIconHandle(
GX_HANDLE handle ){ _iconHandle = handle; }
322 GX_FORCE_INLINE
b32 isSendClientRectToChildGuiFormRegion(
void )
const {
return _isSendClientRectToChildGuiFormRegion; }
326 GX_FORCE_INLINE
void setSendClientRectToChildGuiFormRegion(
b32 isSendClientRectToChildGuiFormRegion ){ _isSendClientRectToChildGuiFormRegion = isSendClientRectToChildGuiFormRegion; }
329 GX_FORCE_INLINE
b32 isFairingMode(FAIRING_MODE mode)
const {
return _fairingMode == mode; }
332 GX_FORCE_INLINE
virtual b32 isNormalWindow(
void )
const {
return isFairingMode(FAIRING_MODE::NORMAL); }
335 GX_FORCE_INLINE
const GxRect& getNormalRect(
void )
const {
return _normalRect; }
338 GX_FORCE_INLINE
void setNormalRect(
const GxRect& normalRect ) { _normalRect = normalRect; }
341 GX_FORCE_INLINE
b32 isMovable(
void)
const {
return _isMovable; }
343 GX_FORCE_INLINE
void setMovable(
b32 enable) { _isMovable = enable; }
345 GX_FORCE_INLINE
b32 isClosable(
void)
const {
return _isClosable; }
347 GX_FORCE_INLINE
void setClosable(
b32 enable) { _isClosable = enable; }
349 void setVisible(
b32 enable);
352 b32 isDocking(
void)
const;
354 b32 isDockingEnable(
void)
const;
358 constexpr HWND getWindowHandle(
void)
const {
return _hwnd; }
360 GX_FORCE_INLINE
b32 isActiveWindow(
void)
const {
return GetActiveWindow() == _hwnd; }
362 b32 isOnMouseWindowHandle(HWND hwnd)
const;
365 GX_FORCE_INLINE
GxRenderTexture* getRenderTexture(
void)
const {
return _pRenderTexture; }
372 GX_FORCE_INLINE
b32 isControlMode(CONTROL_MODE mode)
const {
return _controlMode == mode; }
376 GX_FORCE_INLINE
b32 isOutsideWindow(
void)
const {
return _isOutsideWindow; }
379 constexpr GxGuiButton* getCloseButton(void) const { return _pCloseButton; }
381 GX_FORCE_INLINE
b32 isEnableClose(
void)
const {
return _useCloseWindowButton; }
383 GX_FORCE_INLINE
b32 isEnableMin(
void)
const {
return _useMinWindowButton; }
385 GX_FORCE_INLINE
b32 isEnableMax(
void)
const {
return _useMaxWindowButton; }
388 constexpr u32 getCaptionSizeY(
void)
const {
return _useCaption ? CAPTION_SIZE_Y : 0; }
390 GX_FORCE_INLINE u32 getWindowFrameSize(
void)
const {
return isDocking() ? 0 : WINDOW_FRAME; }
398 GxGuiButton* _pMinButton;
399 GxGuiButton* _pMaxButton;
400 GxGuiButton* _pCloseButton;
401 GxMenuBar* _pBar[
static_cast<int>(BAR_TYPE::MAX)];
403 b32 _isSendClientRectToChildGuiFormRegion;
407 b32 _useCloseWindowButton;
408 b32 _useMinWindowButton;
409 b32 _useMaxWindowButton;
412 FAIRING_MODE _fairingMode;
419 CONTROL_MODE _controlMode;
429 b32 _isOutsideWindow;
431 b32 _resetWindowFlag;
434 IDXGISwapChain* _pDXGISwapChain;
437 IDXGISwapChain3* _pDXGISwapChain;
458 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
463 static const s32 MENU_MARGIN_SIZE_LEFT;
465 static const s32 MENU_MARGIN_SIZE_RIGHT;
467 static const s32 MENU_MARGIN_SIZE_TOP;
469 static const s32 MENU_MARGIN_SIZE_BOTTOM;
471 static const s32 MENU_MARGIN_SIZE_WIDTH;
473 static const s32 MENU_MARGIN_SIZE_HEIGHT;
485 GxMenuBar(GxGuiWindow* pOwner);
500 GxSize getUseSize(
void );
503 constexpr u32 getItemNum(
void )
const {
return _itemNum; }
506 const GxItem* getItem( u32 index )
const;
509 virtual void updateItemTable(
const GxRect& menuRect );
517 void onMouseMove(
const GxPoint2& posotion, u32 button);
520 void onMouseDown(
const GxPoint2& position, u32 button);
529 b32 isOpen(
void )
const;
531 void openSubMenu( s32 index );
533 void closeSubMenu(
void );
536 s32 getItemIndex(
const GxPoint2& position);
544 GxGuiWindow* _pOwner;
551 GxGuiMenu* _pGuiMenu;
559struct GxGuiWindow::GxMenuBar::GxItem :
public GxStructBase
566 GX_RTTI_STRUCT(GxItem)
569 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
586class GxGuiWindow::GxViewBar :
public GxGuiWindow::GxMenuBar
593 GX_RTTI_CLASS(GxGuiWindow::GxViewBar, GxGuiWindow::GxMenuBar)
597 GX_OPERATOR_NEW_DELETE(GxAllocatorList::ALLOCATOR_TYPE::DEVELOP)
600 static const s32 VIEW_ICON_WIDTH;
602 static const s32 VIEW_ICON_HEIGHT;
613 GxViewBar(GxGuiWindow* pOwner);
615 void cleanup(
void )
override;
628 GX_FORCE_INLINE
void setIconTexture(
GxResTexture* pResIconTexture,
const GxVector2& iconTextureSize,
const GxVector2& iconTextureStartUV ){
GX_SET_CLASS_BASE_REFERENCE( _pResIconTexture , pResIconTexture ); _iconTextureSize = iconTextureSize; _iconTextureStartUV = iconTextureStartUV; }
630 constexpr GxResTexture* getIconTexture(
void )
const {
return _pResIconTexture; }
632 GX_FORCE_INLINE
GxVector2 getIconTextureSize(
void )
const {
return _iconTextureSize; }
634 GX_FORCE_INLINE
GxVector2 getIconTextureStartUV(
void )
const {
return _iconTextureStartUV; }
649GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_SET_CLASS_BASE_REFERENCE(__DST__, __SRC__)
オブジェクト設定(参照カウンタを使用する場合)
Definition GxBase.h:318
u32 GX_HANDLE
ハンドル
Definition GxDefine.h:214
参照オブジェクト基底クラス
Definition GxBase.h:122
virtual void cleanup(void)
delete直前に呼び出される関数
Definition GxBase.cpp:248
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
constexpr u32 getWriteBuffer(void) const
書き込むバッファIndexの取得
Definition GxRenderDevice.h:1032
描画関連のイベントを通知します
Definition GxRenderNotifier.h:22
virtual GX_FORCE_INLINE b32 onResetDevice(void)
デバイスのリセット後に通知
Definition GxRenderNotifier.h:54
テクスチャクラス
Definition GxRenderTexture.h:19
テクスチャリソース
Definition GxResTexture.h:23
座標
Definition GxStruct.h:867
矩形
Definition GxStruct.h:951
サイズ
Definition GxStruct.h:730
文字列型クラス
Definition GxString.h:18
GX_FORCE_INLINE GX_STR getString(void)
文字列取得
Definition GxString.h:165
2次元ベクトル
Definition GxVector.h:34
32bitブーリアン
Definition GxDefine.h:173