JugiMap Framework
GuiSlider Class Reference

The GuiSlider class provides a widget for sliders. More...

#include <jmGuiWidgetsA.h>

Inherits GuiWidget.

Public Member Functions

 GuiSlider (ComposedSprite *_sprite)
 Construct a new gui slider from the given *_sprite*. More...
 
void SetDisabled (bool _disabled) override
 Set the disabled state of this widget. More...
 
void SetVisible (bool _visible) override
 Set the visibility of this widget. More...
 
bool IsValueChangedViaStepButtons ()
 Returns true is the value has been changed with increment or decrement button. More...
 
void SetValue (float _value)
 Set the value of this slider. More...
 
float GetValue ()
 Returns the value of this slider. More...
 
int GetIntValue ()
 Returns the value of this slider rounded to integer. More...
 
void SetValueMin (float _valueMin)
 Set the minimum value of this slider. More...
 
float GetValueMin ()
 Returns the minimum value of this slider. More...
 
void SetValueMax (float _valueMax)
 Set the maximum value of this slider. More...
 
float GetValueMax ()
 Returns the maximum value of this slider. More...
 
void SetValueLabelPrecision (int _precision)
 Set the displayed label precision (number of decimal digits) of this slider. More...
 
void SetValueLabelSuffix (const std::string &_suffix)
 Set the label suffix of this slider. More...
 
void SetDeltaValue (float _deltaValue, bool _inPercents)
 Set the delta value step fot the incrementing and decrementing buttons. More...
 
void SetSnapDivision (int _nSnapDivision)
 Set the snap division. More...
 
- Public Member Functions inherited from GuiWidget
bool IsCursorDown ()
 Returns true if the cursor is hold down over this widget; otherwise returns false. More...
 
bool IsCursorOver ()
 Returns true if the cursor is over this widget; otherwise returns false. More...
 
bool IsPressed ()
 Returns true if the cursor is pressed while over this widget; otherwise returns false. More...
 
bool IsValueChanged ()
 Returns true if this widget's value is changed; otherwise returns false. More...
 
bool IsDisabled ()
 Returns true if this widget is disabled; otherwise returns false. More...
 
bool IsVisible ()
 Returns true if this widget is visible; otherwise returns false. More...
 
void SetName (const std::string &_name)
 Set the name of this widget. More...
 
std::string GetName ()
 Returns the name of this widget. More...
 
void SetTag (int _tag)
 Set the tag of this widget. More...
 
int GetTag ()
 Returns the tag of this widget. More...
 
GuiWidgetKind GetKind ()
 Returns the kind of this widget. More...
 
std::string GetDesignKind ()
 Returns the design kind of this widget. More...
 
void AssignCustomObject (CustomObject *_customObject)
 Assign the given *_customObject* to this widget. More...
 
CustomObjectGetCustomObject ()
 Returns the custom object of this widget or nullptr if none. More...
 
void AssignCallback (GuiWidgetCallback *_callback)
 Assign the given *_callback* to this widget. More...
 
GuiWidgetCallbackGetCallback ()
 Returns the callback of this widget or nullptr if none. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GuiWidget
static GuiWidgetGetInteracted ()
 Returns the interacted widget. More...
 
static GuiWidgetGetInteracted (const std::string &_name)
 Returns the interacted widget with the given *_name*. More...
 
static GuiWidgetGetInteracted (int _tag)
 Returns the interacted widget with the given *_tag*. More...
 
static GuiWidgetGetInteracted (CustomObject *_customObject)
 Returns the interacted widget which has assigned the given *_customObject*. More...
 
static GuiWidgetGetInteracted_Pressed ()
 Returns the interacted widget which is pressed. More...
 
static GuiWidgetGetInteracted_Pressed (const std::string &_name)
 Returns the interacted widget with the given *_name* which is pressed. More...
 
static GuiWidgetGetInteracted_Pressed (int _tag)
 Returns the interacted widget with the given *_tag* which is pressed. More...
 
static GuiWidgetGetInteracted_Pressed (CustomObject *_customObject)
 Returns the interacted widget with assigned *_customObject* which is pressed. More...
 
static GuiWidgetGetInteracted_ValueChanged ()
 Returns the interacted widget which has changed value. More...
 
static GuiWidgetGetInteracted_ValueChanged (const std::string &_name)
 Returns the interacted widget with the given *_name* which has changed value. More...
 
static GuiWidgetGetInteracted_ValueChanged (int _tag)
 Returns the interacted widget with the given *_tag* which has changed value. More...
 
static GuiWidgetGetInteracted_ValueChanged (CustomObject *_customObject)
 Returns the interacted widget with assigned *_customObject* which has changed value. More...
 
static GuiWidgetGetInteracted_CursorOver ()
 Returns the interacted widget which has the cursor over. More...
 
static GuiWidgetGetInteracted_CursorOver (const std::string &_name)
 Returns the interacted widget with the given *_name* which has the cursor over. More...
 
static GuiWidgetGetInteracted_CursorOver (int _tag)
 Returns the interacted widget with the given *_tag* which has the cursor over. More...
 
static GuiWidgetGetInteracted_CursorOver (CustomObject *_customObject)
 Returns the interacted widget with assigned *_customObject* which has the cursor over. More...
 
static GuiWidgetGetInteracted_cursorDown ()
 Returns the interacted widget which has the cursor hold down. More...
 
static GuiWidgetGetInteracted_CursorDown (const std::string &_name)
 Returns the interacted widget with the given *_name* which has the cursor hold down. More...
 
static GuiWidgetGetInteracted_CursorDown (int _tag)
 Returns the interacted widget with the given *_tag* which has the cursor hold down. More...
 
static GuiWidgetGetInteracted_CursorDown (CustomObject *_customObject)
 Returns the interacted widget with assigned *_customObject* which has the cursor hold down. More...
 

Detailed Description

The GuiSlider class provides a widget for sliders.

Constructor & Destructor Documentation

◆ GuiSlider()

GuiSlider ( ComposedSprite _sprite)

Construct a new gui slider from the given *_sprite*.

The slider properties are obtained from the sprite custom parameters.

Member Function Documentation

◆ SetDisabled()

void SetDisabled ( bool  _disabled)
overridevirtual

Set the disabled state of this widget.

See also
IsDisabled

Reimplemented from GuiWidget.

◆ SetVisible()

void SetVisible ( bool  _visible)
overridevirtual

Set the visibility of this widget.

This function is not available for GuiTextField.

See also
IsVisible

Reimplemented from GuiWidget.

◆ IsValueChangedViaStepButtons()

bool IsValueChangedViaStepButtons ( )
inline

Returns true is the value has been changed with increment or decrement button.

◆ SetValue()

void SetValue ( float  _value)

Set the value of this slider.

◆ GetValue()

float GetValue ( )
inline

Returns the value of this slider.

◆ GetIntValue()

int GetIntValue ( )
inline

Returns the value of this slider rounded to integer.

◆ SetValueMin()

void SetValueMin ( float  _valueMin)

Set the minimum value of this slider.

◆ GetValueMin()

float GetValueMin ( )
inline

Returns the minimum value of this slider.

◆ SetValueMax()

void SetValueMax ( float  _valueMax)

Set the maximum value of this slider.

◆ GetValueMax()

float GetValueMax ( )
inline

Returns the maximum value of this slider.

◆ SetValueLabelPrecision()

void SetValueLabelPrecision ( int  _precision)
inline

Set the displayed label precision (number of decimal digits) of this slider.

◆ SetValueLabelSuffix()

void SetValueLabelSuffix ( const std::string &  _suffix)
inline

Set the label suffix of this slider.

◆ SetDeltaValue()

void SetDeltaValue ( float  _deltaValue,
bool  _inPercents 
)
inline

Set the delta value step fot the incrementing and decrementing buttons.

If the *_inPercents* is set to true, the *_spinStep* must be a percentage number from 0 to 100 in which case the actual step will be obtained from the slider range.

◆ SetSnapDivision()

void SetSnapDivision ( int  _nSnapDivision)

Set the snap division.

A slider with snap division will be constrained to snapping point along the scale. The snap division must be larger then 1. To disable snapping set the snap division to 0.


The documentation for this class was generated from the following files: