18 #include "GUITexture.h" 22 #define SPIN_CONTROL_TYPE_INT 1 23 #define SPIN_CONTROL_TYPE_FLOAT 2 24 #define SPIN_CONTROL_TYPE_TEXT 3 25 #define SPIN_CONTROL_TYPE_PAGE 4 34 CGUISpinControl(
int parentID,
int controlID,
float posX,
float posY,
float width,
float height,
const CTextureInfo& textureUp,
const CTextureInfo& textureDown,
const CTextureInfo& textureUpFocus,
const CTextureInfo& textureDownFocus,
const CTextureInfo& textureUpDisabled,
const CTextureInfo& textureDownDisabled,
const CLabelInfo& labelInfo,
int iType);
38 void Process(
unsigned int currentTime, CDirtyRegionList &dirtyregions)
override;
39 void Render()
override;
40 bool OnAction(
const CAction &action)
override;
41 void OnLeft()
override;
42 void OnRight()
override;
46 void AllocResources()
override;
47 void FreeResources(
bool immediately =
false)
override;
48 void DynamicResourceAlloc(
bool bOnOff)
override;
49 void SetInvalid()
override;
50 void SetPosition(
float posX,
float posY)
override;
51 float GetWidth()
const override;
52 void SetRange(
int iStart,
int iEnd);
53 void SetFloatRange(
float fStart,
float fEnd);
54 void SetValue(
int iValue);
55 void SetValueFromLabel(
const std::string &label);
56 void SetFloatValue(
float fValue);
57 void SetStringValue(
const std::string& strValue);
59 float GetFloatValue()
const;
60 std::string GetStringValue()
const;
61 void AddLabel(
const std::string& strLabel,
int iValue);
62 void AddLabel(
const std::string& strLabel,
const std::string& strValue);
63 const std::string GetLabel()
const;
64 void SetReverse(
bool bOnOff);
65 int GetMaximum()
const;
66 int GetMinimum()
const;
67 void SetSpinAlign(uint32_t align,
float offsetX)
69 m_label.GetLabelInfo().align = align;
70 m_label.GetLabelInfo().offsetX = offsetX;
72 void SetType(
int iType) { m_iType = iType; }
73 float GetSpinWidth()
const {
return m_imgspinUp->GetWidth(); }
74 float GetSpinHeight()
const {
return m_imgspinUp->GetHeight(); }
75 void SetFloatInterval(
float fInterval);
76 void SetShowRange(
bool bOnoff) ;
77 void SetShowOnePage(
bool showOnePage) { m_showOnePage = showOnePage; }
79 std::string GetDescription()
const override;
80 bool IsFocusedOnUp()
const;
82 bool IsVisible()
const override;
95 virtual void RenderText(
float posX,
float posY,
float width,
float height);
99 bool CanMoveDown(
bool bTestReverse =
true);
100 bool CanMoveUp(
bool bTestReverse =
true);
101 void MoveUp(
bool bTestReverse =
true);
102 void MoveDown(
bool bTestReverse =
true);
103 void ChangePage(
int amount);
114 std::vector<std::string> m_vecLabels;
115 std::vector<int> m_vecValues;
116 std::vector<std::string> m_vecStrValues;
117 std::unique_ptr<CGUITexture> m_imgspinUp;
118 std::unique_ptr<CGUITexture> m_imgspinDown;
119 std::unique_ptr<CGUITexture> m_imgspinUpFocus;
120 std::unique_ptr<CGUITexture> m_imgspinDownFocus;
121 std::unique_ptr<CGUITexture> m_imgspinUpDisabled;
122 std::unique_ptr<CGUITexture> m_imgspinDownDisabled;
Class for rendering text labels. Handles alignment and rendering of text within a control...
Definition: GUILabel.h:69
Definition: GUIListItem.h:30
Definition: GUISpinControl.h:31
Base class for controls.
Definition: GUIControl.h:75
EVENT_RESULT
Results of OnMouseEvent() Any value not equal to EVENT_RESULT_UNHANDLED indicates that the event was ...
Definition: GUIControl.h:60
virtual void RenderText(float posX, float posY, float width, float height)
Render the spinner text.
Definition: GUISpinControl.cpp:552
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
Definition: GUITexture.h:51
bool HitTest(const CPoint &point) const override
Used to test whether the point is inside a control.
Definition: GUISpinControl.cpp:987
Definition: GUIMessage.h:365
Definition: GUILabel.h:22
COLOR
allowed color categories for labels, as defined by the skin
Definition: GUILabel.h:74
EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override
Perform a mouse action.
Definition: GUISpinControl.cpp:1008
bool OnMouseOver(const CPoint &point) override
Called when the mouse is over the control. Default implementation selects the control.
Definition: GUISpinControl.cpp:994
Simple class for mouse events.
Definition: Key.h:114