17 #include "GUITexture.h" 21 #define SLIDER_CONTROL_TYPE_INT 1 22 #define SLIDER_CONTROL_TYPE_FLOAT 2 23 #define SLIDER_CONTROL_TYPE_PERCENTAGE 3 28 const char *formatString;
42 RangeSelectorLower = 0,
43 RangeSelectorUpper = 1
46 CGUISliderControl(
int parentID,
int controlID,
float posX,
float posY,
float width,
float height,
const CTextureInfo& backGroundTexture,
const CTextureInfo& mibTexture,
const CTextureInfo& nibTextureFocus,
int iType, ORIENTATION orientation);
50 void Process(
unsigned int currentTime, CDirtyRegionList &dirtyregions)
override;
51 void Render()
override;
52 bool OnAction(
const CAction &action)
override;
53 virtual bool IsActive()
const {
return true; }
54 void AllocResources()
override;
55 void FreeResources(
bool immediately =
false)
override;
56 void DynamicResourceAlloc(
bool bOnOff)
override;
57 void SetInvalid()
override;
58 virtual void SetRange(
int iStart,
int iEnd);
59 virtual void SetFloatRange(
float fStart,
float fEnd);
62 unsigned int currentTime,
64 RangeSelector selector);
65 void SetRangeSelection(
bool rangeSelection);
66 bool GetRangeSelection()
const {
return m_rangeSelection; }
67 void SetRangeSelector(RangeSelector selector);
68 void SwitchRangeSelector();
69 void SetInfo(
int iInfo);
70 void SetPercentage(
float iPercent, RangeSelector selector = RangeSelectorLower,
bool updateCurrent =
false);
71 float GetPercentage(RangeSelector selector = RangeSelectorLower)
const;
72 void SetIntValue(
int iValue, RangeSelector selector = RangeSelectorLower,
bool updateCurrent =
false);
73 int GetIntValue(RangeSelector selector = RangeSelectorLower)
const;
74 void SetFloatValue(
float fValue, RangeSelector selector = RangeSelectorLower,
bool updateCurrent =
false);
75 float GetFloatValue(RangeSelector selector = RangeSelectorLower)
const;
76 void SetIntInterval(
int iInterval);
77 void SetFloatInterval(
float fInterval);
78 void SetType(
int iType) { m_iType = iType; }
79 int GetType()
const {
return m_iType; }
80 std::string GetDescription()
const override;
81 void SetTextValue(
const std::string& textValue) {
m_textValue = textValue; }
82 void SetAction(
const std::string &action);
90 virtual void Move(
int iNumSteps);
91 virtual void SetFromPosition(
const CPoint &point,
bool guessSelector =
false);
95 float GetProportion(RangeSelector selector = RangeSelectorLower)
const;
101 std::unique_ptr<CGUITexture> m_guiBackground;
102 std::unique_ptr<CGUITexture> m_guiSelectorLower;
103 std::unique_ptr<CGUITexture> m_guiSelectorUpper;
104 std::unique_ptr<CGUITexture> m_guiSelectorLowerFocus;
105 std::unique_ptr<CGUITexture> m_guiSelectorUpperFocus;
108 bool m_rangeSelection;
109 RangeSelector m_currentSelector;
111 std::array<float, 2> m_percentValues;
113 std::array<int, 2> m_intValues;
118 std::array<float, 2> m_floatValues;
127 ORIENTATION m_orientation;
Definition: GUISliderControl.h:25
std::string m_textValue
Allows overriding of the text value to be displayed (parent must update when the slider updates) ...
Definition: GUISliderControl.h:124
Definition: GUIListItem.h:30
bool HitTest(const CPoint &point) const override
Used to test whether the point is inside a control.
Definition: GUISliderControl.cpp:580
EVENT_RESULT OnMouseEvent(const CPoint &point, const CMouseEvent &event) override
Perform a mouse action.
Definition: GUISliderControl.cpp:639
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
bool m_dragging
Whether we're in a (mouse/touch) drag operation or not - some actions are sent only on release...
Definition: GUISliderControl.h:126
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition: Action.h:22
const SliderAction * m_action
Allows the skin to configure the action of a click on the slider.
Definition: GUISliderControl.h:125
Definition: GUITexture.h:51
Definition: GUITexture.h:73
Definition: GUIMessage.h:365
Definition: GUISliderControl.h:37
void SendClick()
Send a click message (and/or action) to the app in response to a slider move.
Definition: GUISliderControl.cpp:348
float GetProportion(RangeSelector selector=RangeSelectorLower) const
Get the current position of the slider as a proportion.
Definition: GUISliderControl.cpp:753
Simple class for mouse events.
Definition: Key.h:114