|
Etk_Range
Detailed Description
Etk_Range is an abstract class used by widgets like scrollbars or sliders.
A range has a value that can't be lower than the lower bound of the range, or greater than the upper bound of the range.
Three other value have to be set when a new range is created:
- the "step increment" value is the value added or substracted to the current value of the range, when the arrow keys are used, or when the arrow buttons of a scrollbar are clicked for example. It is also the value used when the user uses the mouse wheel.
- the "page increment" value is the value added or substracted to current value of the range, when the page up/down keys are pressed, or when the trough of a scrollbar is clicked for example.
- the "page size" value is the size of viewport, used to calculate the size of the drag button of a scrollbar
- Object Hierarchy:
-
- Signals:
- "value-changed": Emitted when the value of the range is changed
Callback: Etk_Bool callback(Etk_Range *range, double value, void *data)
range: the range whose value has been changedvalue: the new value of the rangedata: the user data set when the callback has been connected to the signal
- Properties:
- "value": The value of the range
Type: DoubleAccess: Read/WriteDefault Value: 0.0
- "lower": The lower bound of the range. The value of the range can't be lower than its lower bound
Type: DoubleAccess: Read/WriteDefault Value: 0.0
- "upper": The upper bound of the range. The value of the range can't be greater than its upper bound
Type: DoubleAccess: Read/WriteDefault Value: 0.0
- "step-increment": The step increment value of the range. See the description of Etk_Range for more info
Type: DoubleAccess: Read/WriteDefault Value: 0.0
- "page-increment": The page increment value of the range. See the description of Etk_Range for more info
Type: DoubleAccess: Read/WriteDefault Value: 0.0
- "page-size": The page-size of the range. See the description of Etk_Range for more info
Type: DoubleAccess: Read/WriteDefault Value: 0.0
|
Data Structures |
struct | Etk_Range |
| An abstract class used by widgets like scrollbars or sliders. More...
|
Defines |
#define | ETK_RANGE_TYPE (etk_range_type_get()) |
#define | ETK_RANGE(obj) (ETK_OBJECT_CAST((obj), ETK_RANGE_TYPE, Etk_Range)) |
#define | ETK_IS_RANGE(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_RANGE_TYPE)) |
Functions |
Etk_Bool | etk_range_value_set (Etk_Range *range, double value) |
| Sets the value of the range.
|
double | etk_range_value_get (Etk_Range *range) |
| Gets the value of the range.
|
void | etk_range_range_set (Etk_Range *range, double lower, double upper) |
| Sets the range of values that the range widget can take.
|
void | etk_range_range_get (Etk_Range *range, double *lower, double *upper) |
| Gets the range of values that the range widget can take.
|
void | etk_range_increments_set (Etk_Range *range, double step, double page) |
| Sets the increment values of the range.
|
void | etk_range_increments_get (Etk_Range *range, double *step, double *page) |
| Gets the increment values of the range.
|
void | etk_range_page_size_set (Etk_Range *range, double page_size) |
| Sets the page size of the range: this value controls the size of the drag button of a scrollbar for example.
|
double | etk_range_page_size_get (Etk_Range *range) |
| Gets the page size of the range.
|
Define Documentation
#define ETK_RANGE_TYPE (etk_range_type_get()) |
#define ETK_RANGE |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_RANGE_TYPE, Etk_Range)) |
#define ETK_IS_RANGE |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_RANGE_TYPE)) |
Function Documentation
Etk_Bool etk_range_value_set |
( |
Etk_Range * |
range, |
|
|
double |
value | |
|
) |
| | |
Sets the value of the range.
- Parameters:
-
| range | a range |
| value | the value to set to the range |
- Returns:
- Returns ETK_TRUE if the value has actually been changed, ETK_FALSE otherwise (because the current value is equal to the new value)
double etk_range_value_get |
( |
Etk_Range * |
range |
) |
|
Gets the value of the range.
- Parameters:
-
- Returns:
- Returns the value of the range
void etk_range_range_set |
( |
Etk_Range * |
range, |
|
|
double |
lower, |
|
|
double |
upper | |
|
) |
| | |
Sets the range of values that the range widget can take.
- Parameters:
-
| range | a range |
| lower | the lower bound |
| upper | the upper bound |
void etk_range_range_get |
( |
Etk_Range * |
range, |
|
|
double * |
lower, |
|
|
double * |
upper | |
|
) |
| | |
Gets the range of values that the range widget can take.
- Parameters:
-
| range | a range |
| lower | the location where to store the lower bound |
| upper | the location where to store the upper bound |
void etk_range_increments_set |
( |
Etk_Range * |
range, |
|
|
double |
step, |
|
|
double |
page | |
|
) |
| | |
Sets the increment values of the range.
- Parameters:
-
| range | a range |
| step | the step increment value. Used when a arrow button of a scrollbar is clicked, or when the keyboard arrows are pressed |
| page | the page increment value. Used when the trough of a scrollbar is clicked, or when the page up/down keys are pressed |
void etk_range_increments_get |
( |
Etk_Range * |
range, |
|
|
double * |
step, |
|
|
double * |
page | |
|
) |
| | |
Gets the increment values of the range.
- Parameters:
-
| range | a range |
| step | the location where to store the step increment value |
| page | the location where to store the page increment value |
void etk_range_page_size_set |
( |
Etk_Range * |
range, |
|
|
double |
page_size | |
|
) |
| | |
Sets the page size of the range: this value controls the size of the drag button of a scrollbar for example.
- Parameters:
-
| range | a range |
| page_size | the value to set |
double etk_range_page_size_get |
( |
Etk_Range * |
range |
) |
|
Gets the page size of the range.
- Parameters:
-
- Returns:
- Returns the page size of the range
|
|