Slider
The slider adds a dragable “slider” widget for selecting the value of something within a range. More...
Functions | |
EAPI Evas_Object * | elm_slider_add (Evas_Object *parent) |
Add a new slider to the parent. | |
EAPI void | elm_slider_label_set (Evas_Object *obj, const char *label) |
Set the label of the slider. | |
EAPI const char * | elm_slider_label_get (Evas_Object *obj) |
Get the label of the slider. | |
EAPI void | elm_slider_icon_set (Evas_Object *obj, Evas_Object *icon) |
Set the icon object of the slider object. | |
EAPI Evas_Object * | elm_slider_icon_get (Evas_Object *obj) |
Get the icon object of the slider object. | |
EAPI void | elm_slider_span_size_set (Evas_Object *obj, Evas_Coord size) |
Set the length of the dragable region of the slider. | |
EAPI void | elm_slider_unit_format_set (Evas_Object *obj, const char *units) |
Set the format string of the unit area. | |
EAPI void | elm_slider_indicator_format_set (Evas_Object *obj, const char *indicator) |
Set the format string for the inducator area. | |
EAPI void | elm_slider_horizontal_set (Evas_Object *obj, Eina_Bool horizontal) |
Set orientation of the slider. | |
EAPI void | elm_slider_min_max_set (Evas_Object *obj, double min, double max) |
Set the minimum and maximum values for the slider. | |
EAPI void | elm_slider_value_set (Evas_Object *obj, double val) |
Set the value the slider indicates. | |
EAPI double | elm_slider_value_get (const Evas_Object *obj) |
Get the value the slider has. | |
EAPI void | elm_slider_inverted_set (Evas_Object *obj, Eina_Bool inverted) |
Invert the slider display. |
Detailed Description
The slider adds a dragable “slider” widget for selecting the value of something within a range.Signals that you can add callbacks for are:
changed - Whenever the slider value is changed by the user.
delay,changed - A short time after the value is changed by the user. This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, so it avoids possibly expensive reactions to the value change.
A slider can be horizontal or vertical. It can contain an Icon and has a primary label as well as a units label (that is formatted with floating point values and thus accepts a printf-style format string, like “1.2f units”. There is also an indicator string that may be somewhere else (like on the slider itself) that also accepts a format string like units. Label, Icon Unit and Indicator strings/objects are optional.
A slider may be inverted which means values invert, with high vales being on the left or top and low values on the right or bottom (as opposed to normally being low on the left or top and high on the bottom and right).
The slider should have its minimum and maximum values set by the application with elm_slider_min_max_set() and value should also be set by the application before use with elm_slider_value_set(). The span of the slider is its length (horizontally or vertically). This will be scaled by the object or applications scaling factor. At any point code can query the slider for its value with elm_slider_value_get().
Function Documentation
EAPI Evas_Object* elm_slider_add | ( | Evas_Object * | parent | ) |
Add a new slider to the parent.
- Parameters:
-
parent The parent object
- Returns:
- The new object or NULL if it cannot be created
EAPI void elm_slider_horizontal_set | ( | Evas_Object * | obj, | |
Eina_Bool | horizontal | |||
) |
Set orientation of the slider.
- Parameters:
-
obj The slider object horizontal If set, the slider will be horizontal
EAPI Evas_Object* elm_slider_icon_get | ( | Evas_Object * | obj | ) |
Get the icon object of the slider object.
- Parameters:
-
obj The slider object
- Returns:
- The icon object
EAPI void elm_slider_icon_set | ( | Evas_Object * | obj, | |
Evas_Object * | icon | |||
) |
Set the icon object of the slider object.
Once the icon object is set, it will become a child of the slider object and be deleted when the slider object is deleted. If another icon object is set then the previous one becomes orophaned and will no longer be deleted along with the slider.
- Parameters:
-
obj The slider object icon The icon object
EAPI void elm_slider_indicator_format_set | ( | Evas_Object * | obj, | |
const char * | indicator | |||
) |
Set the format string for the inducator area.
The slider may also display a value (the value of the slider) somewhere (for example above the slider knob that is dragged around). This sets the format string for this. See elm_slider_unit_format_set() for more information on how this works.
- Parameters:
-
obj The slider object units The format string for the indicator display
EAPI void elm_slider_inverted_set | ( | Evas_Object * | obj, | |
Eina_Bool | inverted | |||
) |
Invert the slider display.
Normally the slider will display and interpret values from low to high and when horizontal that is left to right. When vertical that is top to bottom. This inverts this (so from right to left or bottom to top) if inverted is set to 1.
- Parameters:
-
obj The slider object inverted The inverted flag. 1 == inverted, 0 == normal
EAPI const char* elm_slider_label_get | ( | Evas_Object * | obj | ) |
Get the label of the slider.
- Parameters:
-
obj The slider object
- Returns:
- The text label string in UTF-8
EAPI void elm_slider_label_set | ( | Evas_Object * | obj, | |
const char * | label | |||
) |
Set the label of the slider.
- Parameters:
-
obj The slider object label The text label string in UTF-8
EAPI void elm_slider_min_max_set | ( | Evas_Object * | obj, | |
double | min, | |||
double | max | |||
) |
Set the minimum and maximum values for the slider.
Maximum mut be greater than minimum.
- Parameters:
-
obj The slider object min The minimum value max The maximum value
EAPI void elm_slider_span_size_set | ( | Evas_Object * | obj, | |
Evas_Coord | size | |||
) |
Set the length of the dragable region of the slider.
Thois sets the minimum width or height (depending on orientation) of the area of the slider that allows the slider to be dragged around. This in turn affects the objects minimum size (along with icon label and unit text). Note that this will also get multiplied by the scale factor.
- Parameters:
-
obj The slider object size The length of the slider area
EAPI void elm_slider_unit_format_set | ( | Evas_Object * | obj, | |
const char * | units | |||
) |
Set the format string of the unit area.
If NULL, this disabls the unit area display. If not it sets the format string for the unit text. The unit text is provided a floating point value, so the unit text can display up to 1 floating point falue. Note that this is optional. Use a format string such as "%1.2f meters" for example.
- Parameters:
-
obj The slider object units The format string for the units display
EAPI double elm_slider_value_get | ( | const Evas_Object * | obj | ) |
Get the value the slider has.
- Parameters:
-
obj The slider object
- Returns:
- The value of the slider
EAPI void elm_slider_value_set | ( | Evas_Object * | obj, | |
double | val | |||
) |
Set the value the slider indicates.
- Parameters:
-
obj The slider object val The value (must be beween min and max for the slider)