Ewl_Scrollbar: A Simple Scrollbar Widget
Detailed Description
Defines an Ewl_Scrollbar for using when scrolling values are needed.
- Remarks:
- Inherits from Ewl_Box.
Tutorial
Data Structures | |
struct | Ewl_Scrollbar |
Inherits from Ewl_Box and extends to provide a scrollbar widget. More... | |
Defines | |
#define | EWL_SCROLLBAR(scrollbar) ((Ewl_Scrollbar *) scrollbar) |
#define | EWL_SCROLLBAR_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_SCROLLBAR_TYPE)) |
#define | EWL_SCROLLBAR_TYPE "scrollbar" |
Typedefs | |
typedef struct Ewl_Scrollbar | Ewl_Scrollbar |
Functions | |
Ewl_Widget * | ewl_hscrollbar_new (void) |
Allocate and initialize a new horizontal scrollbar widget. | |
void | ewl_scrollbar_cb_scroll_start (Ewl_Widget *w, void *ev_data, void *user_data) |
void | ewl_scrollbar_cb_scroll_stop (Ewl_Widget *w, void *ev_data, void *user_data) |
int | ewl_scrollbar_init (Ewl_Scrollbar *s) |
Initialize a scrollbar to default values. | |
char | ewl_scrollbar_inverse_scroll_get (Ewl_Scrollbar *s) |
Checks the inverse scrolling flag on a scrollbar. | |
void | ewl_scrollbar_inverse_scroll_set (Ewl_Scrollbar *s, char v) |
Sets the inverse scrolling flag on a scrollbar. | |
Ewl_Widget * | ewl_scrollbar_new (void) |
Allocate and initialize a new scrollbar widget. | |
Ewl_Orientation | ewl_scrollbar_orientation_get (Ewl_Scrollbar *s) |
Change the orientation of a scrollbar. | |
void | ewl_scrollbar_orientation_set (Ewl_Scrollbar *s, Ewl_Orientation orientation) |
Change the orientation of a scrollbar. | |
double | ewl_scrollbar_step_get (Ewl_Scrollbar *s) |
Get the current step size of the scrollbar. | |
void | ewl_scrollbar_step_set (Ewl_Scrollbar *s, double v) |
Change the step size of a scrollbar. | |
double | ewl_scrollbar_value_get (Ewl_Scrollbar *s) |
Get the current value of the dragbar. | |
void | ewl_scrollbar_value_set (Ewl_Scrollbar *s, double v) |
Set the current value of the dragbar. | |
Ewl_Widget * | ewl_vscrollbar_new (void) |
Allocate and initialize a new vertical scrollbar widget. |
Define Documentation
#define EWL_SCROLLBAR | ( | scrollbar | ) | ((Ewl_Scrollbar *) scrollbar) |
Typecasts a pointer to an Ewl_Scrollbar pointer.
Referenced by ewl_hscrollbar_new(), ewl_scrollbar_cb_scroll_start(), ewl_scrollbar_cb_scroll_stop(), ewl_scrollpane_cb_configure(), ewl_scrollpane_cb_focus_jump(), ewl_scrollpane_hscrollbar_step_get(), ewl_scrollpane_hscrollbar_value_get(), ewl_scrollpane_hscrollbar_value_set(), ewl_scrollpane_vscrollbar_step_get(), ewl_scrollpane_vscrollbar_value_get(), ewl_scrollpane_vscrollbar_value_set(), and ewl_vscrollbar_new().
#define EWL_SCROLLBAR_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_SCROLLBAR_TYPE)) |
Returns TRUE if the widget is an Ewl_Scrollbar, FALSE otherwise
#define EWL_SCROLLBAR_TYPE "scrollbar" |
- Widget Theme Keys:
- /hscrollbar/file
- Widget Theme Keys:
- /hscrollbar/group
- Widget Theme Keys:
- /vscrollbar/file
- Widget Theme Keys:
- /vscrollbar/group
- Widget Theme Keys:
- /hscrollbar/seeker/file
- Widget Theme Keys:
- /hscrollbar/seeker/group
- Widget Theme Keys:
- /vscrollbar/seeker/file
- Widget Theme Keys:
- /vscrollbar/seeker/group
- Widget Theme Keys:
- /hscrollbar/seeker/button/file
- Widget Theme Keys:
- /hscrollbar/seeker/button/group
- Widget Theme Keys:
- /vscrollbar/seeker/button/file
- Widget Theme Keys:
- /vscrollbar/seeker/button/group
Referenced by ewl_scrollbar_cb_scroll_start(), ewl_scrollbar_cb_scroll_stop(), ewl_scrollbar_init(), ewl_scrollbar_inverse_scroll_get(), ewl_scrollbar_inverse_scroll_set(), ewl_scrollbar_orientation_get(), ewl_scrollbar_orientation_set(), ewl_scrollbar_step_get(), ewl_scrollbar_step_set(), ewl_scrollbar_value_get(), and ewl_scrollbar_value_set().
Typedef Documentation
typedef struct Ewl_Scrollbar Ewl_Scrollbar |
Provides a seeker with increment and decrement buttons arranged in a specified order.
Function Documentation
Ewl_Widget* ewl_hscrollbar_new | ( | void | ) |
Allocate and initialize a new horizontal scrollbar widget.
- Returns:
- Returns NULL on failure, or a pointer to a new scrollbar on success.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ORIENTATION_HORIZONTAL, EWL_SCROLLBAR, ewl_scrollbar_new(), ewl_scrollbar_orientation_set(), and EWL_WIDGET.
Referenced by ewl_scrollpane_init().
void ewl_scrollbar_cb_scroll_start | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, direction, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_BOX, ewl_box_orientation_get(), EWL_SCROLLBAR, EWL_SCROLLBAR_TYPE, EWL_WIDGET_TYPE, increment, invert, start_time, and timer.
Referenced by ewl_scrollbar_init().
void ewl_scrollbar_cb_scroll_stop | ( | Ewl_Widget * | w, | |
void * | ev_data, | |||
void * | user_data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, direction, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_SCROLLBAR, EWL_SCROLLBAR_TYPE, start_time, and timer.
Referenced by ewl_scrollbar_init().
int ewl_scrollbar_init | ( | Ewl_Scrollbar * | s | ) |
Initialize a scrollbar to default values.
- Parameters:
-
s,: the scrollbar to initialize
- Returns:
- Returns no value.
References buttons_alignment, DCHECK_PARAM_PTR_RET, decrement, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_init(), ewl_box_orientation_set(), ewl_button_new(), ewl_callback_append(), EWL_CALLBACK_DESTROY, EWL_CALLBACK_MOUSE_DOWN, EWL_CALLBACK_MOUSE_UP, EWL_CALLBACK_VALUE_CHANGED, EWL_CONTAINER, ewl_container_callback_notify(), ewl_container_child_append(), EWL_FLAG_ALIGN_CENTER, EWL_FLAG_ALIGN_LEFT, EWL_FLAG_ALIGN_RIGHT, EWL_FLAG_FILL_HFILL, EWL_FLAG_FILL_HSHRINK, EWL_FLAG_FILL_NONE, ewl_hseeker_new(), EWL_OBJECT, ewl_object_alignment_set(), ewl_object_fill_policy_set(), EWL_ORIENTATION_HORIZONTAL, EWL_RANGE, ewl_range_maximum_value_set(), ewl_range_step_set(), ewl_range_value_set(), ewl_scrollbar_cb_scroll_start(), ewl_scrollbar_cb_scroll_stop(), EWL_SCROLLBAR_TYPE, EWL_WIDGET, ewl_widget_appearance_set(), ewl_widget_inherit(), ewl_widget_internal_set(), ewl_widget_show(), fill_percentage, increment, invert, and seeker.
Referenced by ewl_scrollbar_new().
char ewl_scrollbar_inverse_scroll_get | ( | Ewl_Scrollbar * | s | ) |
Checks the inverse scrolling flag on a scrollbar.
- Parameters:
-
s,: the scrollbar to get inverted scrolling value
- Returns:
- Returns the current value for inverted scrolling.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_SCROLLBAR_TYPE, and invert.
void ewl_scrollbar_inverse_scroll_set | ( | Ewl_Scrollbar * | s, | |
char | i | |||
) |
Sets the inverse scrolling flag on a scrollbar.
- Parameters:
-
s,: the scrollbar to set inverted scrolling value i,: value to set for inverse scrolling
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, direction, DLEAVE_FUNCTION, DLEVEL_STABLE, and EWL_SCROLLBAR_TYPE.
Ewl_Widget* ewl_scrollbar_new | ( | void | ) |
Allocate and initialize a new scrollbar widget.
- Returns:
- Returns NULL on failure, or a pointer to a new scrollbar on success.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_scrollbar_init(), EWL_WIDGET, ewl_widget_destroy(), and NEW.
Referenced by ewl_hscrollbar_new(), and ewl_vscrollbar_new().
Ewl_Orientation ewl_scrollbar_orientation_get | ( | Ewl_Scrollbar * | s | ) |
Change the orientation of a scrollbar.
- Parameters:
-
s,: the scrollbar to change orientation
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_BOX, ewl_box_orientation_get(), EWL_ORIENTATION_HORIZONTAL, and EWL_SCROLLBAR_TYPE.
void ewl_scrollbar_orientation_set | ( | Ewl_Scrollbar * | s, | |
Ewl_Orientation | o | |||
) |
Change the orientation of a scrollbar.
- Parameters:
-
s,: the scrollbar to change orientation o,: the new orientation to use on the scrollbar
- Returns:
- Returns no value.
References buttons_alignment, DCHECK_PARAM_PTR, DCHECK_TYPE, decrement, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, DRETURN, EWL_BOX, ewl_box_orientation_get(), ewl_box_orientation_set(), EWL_CONTAINER, ewl_container_child_append(), ewl_container_child_remove(), EWL_FLAG_ALIGN_BOTTOM, EWL_FLAG_ALIGN_LEFT, EWL_FLAG_ALIGN_RIGHT, EWL_FLAG_ALIGN_TOP, EWL_FLAG_FILL_HFILL, EWL_FLAG_FILL_HSHRINK, EWL_FLAG_FILL_VFILL, EWL_FLAG_FILL_VSHRINK, EWL_OBJECT, ewl_object_fill_policy_set(), EWL_ORIENTATION_HORIZONTAL, EWL_SCROLLBAR_TYPE, EWL_SEEKER, ewl_seeker_orientation_set(), ewl_theme_data_int_get(), EWL_WIDGET, ewl_widget_appearance_set(), increment, invert, and seeker.
Referenced by ewl_hscrollbar_new(), and ewl_vscrollbar_new().
double ewl_scrollbar_step_get | ( | Ewl_Scrollbar * | s | ) |
Get the current step size of the scrollbar.
- Parameters:
-
s,: the scrollbar to retrieve step size
- Returns:
- Returns the current step size of the scrollbar.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_RANGE, ewl_range_step_get(), EWL_SCROLLBAR_TYPE, and seeker.
Referenced by ewl_scrollpane_hscrollbar_step_get(), and ewl_scrollpane_vscrollbar_step_get().
void ewl_scrollbar_step_set | ( | Ewl_Scrollbar * | s, | |
double | v | |||
) |
Change the step size of a scrollbar.
- Parameters:
-
s,: the scrollbar to change step size v,: the new step size of the scrollbar
- Returns:
- Returns no value. Changes the step size of the scrollbar s to v.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE, ewl_range_step_set(), EWL_SCROLLBAR_TYPE, and seeker.
Referenced by ewl_scrollpane_cb_configure().
double ewl_scrollbar_value_get | ( | Ewl_Scrollbar * | s | ) |
Get the current value of the dragbar.
- Parameters:
-
s,: the scrollbar to get the current value
- Returns:
- Returns the current value of the scrollbar s.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_FLOAT, EWL_RANGE, ewl_range_value_get(), EWL_SCROLLBAR_TYPE, and seeker.
Referenced by ewl_scrollpane_cb_configure(), ewl_scrollpane_hscrollbar_value_get(), and ewl_scrollpane_vscrollbar_value_get().
void ewl_scrollbar_value_set | ( | Ewl_Scrollbar * | s, | |
double | v | |||
) |
Set the current value of the dragbar.
- Parameters:
-
s,: the scrollbar to set the current value v,: the new value for the scrollbar
- Returns:
- Returns no value. Sets the current value of the scrollbar s.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_RANGE, ewl_range_value_set(), EWL_SCROLLBAR_TYPE, and seeker.
Referenced by ewl_scrollpane_cb_focus_jump(), ewl_scrollpane_hscrollbar_value_set(), and ewl_scrollpane_vscrollbar_value_set().
Ewl_Widget* ewl_vscrollbar_new | ( | void | ) |
Allocate and initialize a new vertical scrollbar widget.
- Returns:
- Returns NULL on failure, or a pointer to a new scrollbar on success.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_ORIENTATION_VERTICAL, EWL_SCROLLBAR, ewl_scrollbar_new(), ewl_scrollbar_orientation_set(), and EWL_WIDGET.
Referenced by ewl_scrollpane_init().