Ewl_Range: A Value Selector from a Range
Detailed Description
Defines an Ewl_Widget with a draggable button enclosed, used to select a value from a range.
- Remarks:
- Inherits from Ewl_Container.
Tutorial
Data Structures | |
struct | Ewl_Range |
Inherits from Ewl_Container and extends to provide a basic range widget. More... | |
Defines | |
#define | EWL_RANGE(range) ((Ewl_Range *) range) |
#define | EWL_RANGE_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_RANGE_TYPE)) |
#define | EWL_RANGE_TYPE "range" |
Typedefs | |
typedef struct Ewl_Range | Ewl_Range |
Functions | |
void | ewl_range_decrease (Ewl_Range *r) |
Decrease the value of a range by it's step size. | |
void | ewl_range_increase (Ewl_Range *r) |
Increase the value of a range by it's step size. | |
int | ewl_range_init (Ewl_Range *r) |
Initialize the range to some sane starting values. | |
unsigned int | ewl_range_invert_get (Ewl_Range *r) |
Retrieve the current invert value from a range. | |
void | ewl_range_invert_set (Ewl_Range *r, unsigned int invert) |
Changes the invert property on the range for inverting it's scale. | |
double | ewl_range_maximum_value_get (Ewl_Range *r) |
Retrieves the maximum value for the range. | |
void | ewl_range_maximum_value_set (Ewl_Range *r, double maxv) |
Set the maximum value possible for a range. | |
double | ewl_range_minimum_value_get (Ewl_Range *r) |
Retrieves the minimum value for the range. | |
void | ewl_range_minimum_value_set (Ewl_Range *r, double minv) |
Set the minimum value possible for a range. | |
double | ewl_range_step_get (Ewl_Range *r) |
Retrieve the step size of the range. | |
void | ewl_range_step_set (Ewl_Range *r, double step) |
Set the steps between increments. | |
unsigned int | ewl_range_unknown_get (Ewl_Range *r) |
Retrieve the current unknown value from a range. | |
void | ewl_range_unknown_set (Ewl_Range *r, unsigned int unknown) |
Change the unknown property of the range if you do not know the max/min values. | |
double | ewl_range_value_get (Ewl_Range *r) |
Retrieve the current value of the range. | |
void | ewl_range_value_set (Ewl_Range *r, double v) |
Set the value of pointer of the range. |
Define Documentation
#define EWL_RANGE | ( | range | ) | ((Ewl_Range *) range) |
Typecasts a pointer to an Ewl_Range pointer.
Referenced by ewl_colorpicker_alpha_get(), ewl_colorpicker_alpha_set(), ewl_colorpicker_cb_alpha_change(), ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_current_rgb_set(), ewl_colorpicker_init(), ewl_progressbar_cb_configure(), ewl_progressbar_cb_value_changed(), ewl_progressbar_custom_label_set(), ewl_progressbar_init(), ewl_scrollbar_init(), ewl_scrollbar_step_get(), ewl_scrollbar_step_set(), ewl_scrollbar_value_get(), ewl_scrollbar_value_set(), ewl_seeker_cb_child_show(), ewl_seeker_cb_configure(), ewl_seeker_cb_key_down(), ewl_seeker_cb_mouse_down(), ewl_seeker_cb_mouse_move(), ewl_seeker_init(), ewl_spinner_cb_decrease_value(), ewl_spinner_cb_focus_out(), ewl_spinner_cb_increase_value(), ewl_spinner_cb_wheel(), and ewl_spinner_init().
#define EWL_RANGE_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_RANGE_TYPE)) |
Returns TRUE if the widget is an Ewl_Range, FALSE otherwise
#define EWL_RANGE_TYPE "range" |
The type name for the Ewl_Range widget
Referenced by ewl_range_decrease(), ewl_range_increase(), ewl_range_init(), ewl_range_invert_get(), ewl_range_invert_set(), ewl_range_maximum_value_get(), ewl_range_maximum_value_set(), ewl_range_minimum_value_get(), ewl_range_minimum_value_set(), ewl_range_step_get(), ewl_range_step_set(), ewl_range_unknown_get(), ewl_range_unknown_set(), ewl_range_value_get(), and ewl_range_value_set().
Typedef Documentation
The Ewl_Range provides a means to select a value from a range using a draggable button.
Function Documentation
void ewl_range_decrease | ( | Ewl_Range * | r | ) |
Decrease the value of a range by it's step size.
- Parameters:
-
r,: the range to decrease
- Returns:
- Returns no value. Decreases the value of the range r by one increment of it's step size.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, ewl_range_value_set(), step, and value.
Referenced by ewl_seeker_cb_key_down(), ewl_spinner_cb_decrease_value(), and ewl_spinner_cb_increase_value().
void ewl_range_increase | ( | Ewl_Range * | r | ) |
Increase the value of a range by it's step size.
- Parameters:
-
r,: the range to increase
- Returns:
- Returns no value. Increases the value of the range r by one increment of it's step size.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, ewl_range_value_set(), step, and value.
Referenced by ewl_seeker_cb_key_down(), ewl_spinner_cb_decrease_value(), and ewl_spinner_cb_increase_value().
int ewl_range_init | ( | Ewl_Range * | r | ) |
Initialize the range to some sane starting values.
- Parameters:
-
r,: the range to be initialized
- Returns:
- Returns no value. Note, there is no ewl_range_new(), becasue range only serves as a common API for seeker, spinner and progressbar
References DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_CONTAINER, ewl_container_init(), EWL_RANGE_TYPE, EWL_WIDGET, ewl_widget_inherit(), invert, max_val, min_val, step, and value.
Referenced by ewl_progressbar_init(), ewl_seeker_init(), and ewl_spinner_init().
unsigned int ewl_range_invert_get | ( | Ewl_Range * | r | ) |
Retrieve the current invert value from a range.
- Parameters:
-
r,: the range to retrieve invert property value
- Returns:
- Returns the current value of the invert property in the range.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_RANGE_TYPE, and invert.
void ewl_range_invert_set | ( | Ewl_Range * | r, | |
unsigned int | invert | |||
) |
Changes the invert property on the range for inverting it's scale.
- Parameters:
-
r,: the range to set invert property invert,: the new value for the ranges invert property
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, EWL_WIDGET, ewl_widget_configure(), and invert.
double ewl_range_maximum_value_get | ( | Ewl_Range * | r | ) |
Retrieves the maximum value for the range.
- Parameters:
-
r,: the range to retrieve maximum value
- Returns:
- Returns the currently set maximum value for the specified range.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_RANGE_TYPE, and max_val.
void ewl_range_maximum_value_set | ( | Ewl_Range * | r, | |
double | maxv | |||
) |
Set the maximum value possible for a range.
- Parameters:
-
r,: the range to change the maximum possible value maxv,: the new maximum possible value for r
- Returns:
- Returns no value. Sets the smallest value that r can obtain to maxv.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, ewl_range_value_set(), max_val, and value.
Referenced by ewl_colorpicker_init(), and ewl_scrollbar_init().
double ewl_range_minimum_value_get | ( | Ewl_Range * | r | ) |
Retrieves the minimum value for the range.
- Parameters:
-
r,: the range to retrieve minimum value
- Returns:
- Returns the currently set minimum value for the specified range.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_RANGE_TYPE, and min_val.
void ewl_range_minimum_value_set | ( | Ewl_Range * | r, | |
double | minv | |||
) |
Set the minimum value possible for a range.
- Parameters:
-
r,: the range to change the minimum possible value minv,: the new minimum possible value for r
- Returns:
- Returns no value. Sets the smallest value that r can obtain to minv.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, ewl_range_value_set(), min_val, and value.
Referenced by ewl_colorpicker_init().
double ewl_range_step_get | ( | Ewl_Range * | r | ) |
Retrieve the step size of the range.
- Parameters:
-
r,: the range to retrieve step size
- Returns:
- Returns the step size of the range r.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_RANGE_TYPE, and step.
Referenced by ewl_scrollbar_step_get().
void ewl_range_step_set | ( | Ewl_Range * | r, | |
double | step | |||
) |
Set the steps between increments.
- Parameters:
-
r,: the range to change step step,: the new step value for the range
- Returns:
- Returns no value. Changes the amount that each increment or decrement changes the value of the range r.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, max_val, min_val, and step.
Referenced by ewl_colorpicker_init(), ewl_scrollbar_init(), and ewl_scrollbar_step_set().
unsigned int ewl_range_unknown_get | ( | Ewl_Range * | r | ) |
Retrieve the current unknown value from a range.
- Parameters:
-
r,: the range to retrieve the unknown property value
- Returns:
- Returns the current value of the unknown property in the range.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_RANGE_TYPE, and unknown_range.
void ewl_range_unknown_set | ( | Ewl_Range * | r, | |
unsigned int | unknown | |||
) |
Change the unknown property of the range if you do not know the max/min values.
- Parameters:
-
r,: range to set unknown property unknown,: the new value for the ranges unknown property
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE_TYPE, EWL_WIDGET, ewl_widget_configure(), and unknown_range.
double ewl_range_value_get | ( | Ewl_Range * | r | ) |
Retrieve the current value of the range.
- Parameters:
-
r,: the ranges to retrieve the value
- Returns:
- Returns 0 on failure, the value of the range on success.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_RANGE_TYPE, and value.
Referenced by ewl_colorpicker_alpha_get(), ewl_colorpicker_cb_alpha_change(), ewl_colorpicker_cb_spinner_change(), ewl_colorpicker_current_rgb_set(), and ewl_scrollbar_value_get().
void ewl_range_value_set | ( | Ewl_Range * | r, | |
double | v | |||
) |
Set the value of pointer of the range.
- Parameters:
-
r,: the range whose value will be changed v,: the new value of the range, checked against the valid range
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, ewl_callback_call(), EWL_CALLBACK_VALUE_CHANGED, EWL_RANGE_TYPE, EWL_WIDGET, ewl_widget_configure(), max_val, min_val, unknown_range, and value.
Referenced by ewl_colorpicker_alpha_set(), ewl_colorpicker_init(), ewl_range_decrease(), ewl_range_increase(), ewl_range_maximum_value_set(), ewl_range_minimum_value_set(), ewl_scrollbar_init(), ewl_scrollbar_value_set(), ewl_seeker_cb_key_down(), ewl_seeker_cb_mouse_down(), ewl_seeker_cb_mouse_move(), ewl_spinner_cb_focus_out(), and ewl_spinner_cb_wheel().