15GX_CORE_NAMESPACE_BEGIN()
20class GxGuiButton : public GxGuiBase
27 GX_RTTI_CLASS(GxGuiButton, GxGuiBase)
47 b32 initialize(
void )
override;
56 void update(
void )
override;
59 void executeClickEvent(
void );
62 void executeOnEvent(
void );
65 void executeOffEvent(
void );
68 void onMouseDown(
const GxPoint2& position, u32 button)
override;
71 void onMouseUp(
const GxPoint2& position, u32 button)
override;
74 void onDraw(
void)
override;
77 GxSize getUseRegionSize(
void)
const override;
81 void onMouseHover(
const GxPoint2& position)
override;
90 void setClickEvent(
const GxProperty& clickEvent );
97 GX_FORCE_INLINE
void setLabel(
const GxString& label ){ _label = label; _labelSize = GxGuiGraphics::calculateStringSize( _label.getString() ); }
101 constexpr GX_CSTR getLabel(
void )
const {
return _label.getString(); }
105 GX_FORCE_INLINE
void setIconHandle(
GX_HANDLE iconHandle ){ setIconHandle( iconHandle, iconHandle ); setDrawFrame(
true); }
110 GX_FORCE_INLINE
void setIconHandle(
GX_HANDLE onIconHandle,
GX_HANDLE offIconHandle ){ _onIconHandle = onIconHandle; _offIconHandle = offIconHandle; setDrawFrame(
false); }
114 void setOn(
b32 on );
118 GX_FORCE_INLINE
b32 isOn(
void )
const {
return _on; }
122 GX_FORCE_INLINE
void setCanControl(
b32 can ){ _canControl = can; }
125 void setColor(
const GxColor& colorOn,
const GxColor& colorOff,
b32 useOnOffColor =
true );
128 GX_FORCE_INLINE
void setColor(
const GxColor& color,
b32 useOnOffColor =
true ){ setColor( color,color,useOnOffColor ); }
131 GX_FORCE_INLINE
const GxColor& getOnColor(
void )
const {
return _onColor; }
134 GX_FORCE_INLINE
const GxColor& getOffColor(
void )
const {
return _offColor; }
141 GX_FORCE_INLINE
void setDrawFrame(
b32 draw ){ _isDrawFrame = draw; }
144 GX_FORCE_INLINE
void setHoverMessage( GX_CSTR message ){ GX_ASSERT( message,
"pMessage is nullptr"); _hoverMessage = message; }
181GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
u32 GX_HANDLE
ハンドル
Definition GxDefine.h:214
プロパティクラス
Definition GxProperty.h:48
static const GxColor BLACK
黒
Definition GxColor.h:29
static GX_FORCE_INLINE GxColor getLerp(const GxColor color0, const GxColor color1, f32 t)
補間値を取得(互換用)
Definition GxColor.inl:468
座標
Definition GxStruct.h:867
サイズ
Definition GxStruct.h:730
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173