 |
 |
 |
 |
Etk_Scrolled_View
Detailed Description
The Etk_Scrolled_View widget is a container with two scrollbars that allow the user to scroll its unique child.
A scrolled view is made up of a hscrollbar which controls the horizontal scrolling of the child, and of a vscrollbar which controls the vertical scrolling of the child.
These two scrollbars can have different visibility policy:
- ETK_POLICY_SHOW: the scrollbar is always shown
- ETK_POLICY_HIDE: the scrollbar is always hidden
- ETK_POLICY_AUTO: the scrollbar is shown and hidden automatically whether or not the child can fit entirely in the scrolled view
The visibility policy can be set with etk_scrolled_view_policy_set().
Most of the widgets doesn't have a scrolling ability, which means that you have to create an Etk_Viewport that implements this ability, attach the child to the viewport, and add the viewport to the scrolled view. etk_scrolled_view_add_with_viewport() is a convenient function that does that for you.
- Object Hierarchy:
-
- Properties:
- "hpolicy": The visibility policy of the horizontal scrollbar
Type: Integer (Etk_Scrolled_View_Policy)Access: Read/WriteDefault Value: ETK_POLICY_AUTO
- "vpolicy": The visibility policy of the vertical scrollbar
Type: Integer (Etk_Scrolled_View_Policy)Access: Read/WriteDefault Value: ETK_POLICY_AUTO
|
Data Structures |
struct | Etk_Scrolled_View |
| [Widget] The structure of a scrolled view More...
|
Defines |
#define | ETK_SCROLLED_VIEW_TYPE (etk_scrolled_view_type_get()) |
#define | ETK_SCROLLED_VIEW(obj) (ETK_OBJECT_CAST((obj), ETK_SCROLLED_VIEW_TYPE, Etk_Scrolled_View)) |
#define | ETK_IS_SCROLLED_VIEW(obj) (ETK_OBJECT_CHECK_TYPE((obj), ETK_SCROLLED_VIEW_TYPE)) |
Enumerations |
enum | Etk_Scrolled_View_Policy {
ETK_POLICY_AUTO,
ETK_POLICY_SHOW,
ETK_POLICY_HIDE
} |
| Etk_Scrolled_View_Policy describes whether the scrollbar should be always visible, always hidden, or whether it should be shown/hidden automatically. More...
|
Functions |
Etk_Widget * | etk_scrolled_view_new (void) |
| Creates a new scrolled view.
|
Etk_Range * | etk_scrolled_view_hscrollbar_get (Etk_Scrolled_View *scrolled_view) |
| Gets the hoizontal scrollbar of the scrolled view. You can then change its value, bound values, ...
|
Etk_Range * | etk_scrolled_view_vscrollbar_get (Etk_Scrolled_View *scrolled_view) |
| Gets the vertical scrollbar of the scrolled view. You can then change its value, bound values, ...
|
void | etk_scrolled_view_add_with_viewport (Etk_Scrolled_View *scrolled_view, Etk_Widget *child) |
| A convenient function that creates a viewport, attachs the child to it and adds the viewport to the scrolled view. It's useful for widgets that have no scrolling ability.
|
void | etk_scrolled_view_policy_set (Etk_Scrolled_View *scrolled_view, Etk_Scrolled_View_Policy hpolicy, Etk_Scrolled_View_Policy vpolicy) |
| Sets the visibility policy of the hscrollbar and the vscrollbar of the scrolled view.
|
void | etk_scrolled_view_policy_get (Etk_Scrolled_View *scrolled_view, Etk_Scrolled_View_Policy *hpolicy, Etk_Scrolled_View_Policy *vpolicy) |
| Gets the visibility policy of the hscrollbar and the vscrollbar of the scrolled view.
|
void | etk_scrolled_view_dragable_set (Etk_Scrolled_View *scrolled_view, Etk_Bool dragable) |
| Set the scrolled view dragable or not.
|
Etk_Bool | etk_scrolled_view_dragable_get (Etk_Scrolled_View *scrolled_view) |
| Get the scrolled view dragable flag.
|
void | etk_scrolled_view_drag_bouncy_set (Etk_Scrolled_View *scrolled_view, Etk_Bool bouncy) |
| Set the scrolled view boucy or not.
|
Etk_Bool | etk_scrolled_view_drag_bouncy_get (Etk_Scrolled_View *scrolled_view) |
| Get the scrolled view bouncy flag.
|
double | etk_scrolled_view_drag_sample_interval_set (Etk_Scrolled_View *scrolled_view, double interval) |
| Set the scrolled view sample interval to calculate the scrolling speed.
|
double | etk_scrolled_view_drag_sample_interval_get (Etk_Scrolled_View *scrolled_view) |
| Get the scrolled view sample interval to calculate the scrolling speed.
|
unsigned int | etk_scrolled_view_drag_damping_set (Etk_Scrolled_View *scrolled_view, unsigned int damping) |
| Set the damping magic number of a dragable scrolled view.
|
unsigned int | etk_scrolled_view_drag_damping_get (Etk_Scrolled_View *scrolled_view) |
| Get the damping magic number of a dragable scrolled view.
|
Define Documentation
#define ETK_SCROLLED_VIEW_TYPE (etk_scrolled_view_type_get()) |
#define ETK_SCROLLED_VIEW |
( |
obj |
|
) |
(ETK_OBJECT_CAST((obj), ETK_SCROLLED_VIEW_TYPE, Etk_Scrolled_View)) |
#define ETK_IS_SCROLLED_VIEW |
( |
obj |
|
) |
(ETK_OBJECT_CHECK_TYPE((obj), ETK_SCROLLED_VIEW_TYPE)) |
Enumeration Type Documentation
Etk_Scrolled_View_Policy describes whether the scrollbar should be always visible, always hidden, or whether it should be shown/hidden automatically.
- Enumerator:
-
ETK_POLICY_AUTO |
The scrollbar is shown and hidden automatically whether or not the child can fit entirely in the scrolled view |
ETK_POLICY_SHOW |
The scrollbar is always visible |
ETK_POLICY_HIDE |
The scrollbar is always hidden |
Function Documentation
Gets the hoizontal scrollbar of the scrolled view. You can then change its value, bound values, ...
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the hoizontal scrollbar of the scrolled view
References ETK_RANGE, and hscrollbar.
Referenced by etk_iconbox_current_model_set().
Gets the visibility policy of the hscrollbar and the vscrollbar of the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
| hpolicy | the location where to store the visibility policy of the hscrollbar |
| vpolicy | the location where to store the visibility policy of the vscrollbar |
References ETK_POLICY_AUTO, hpolicy, and vpolicy.
void etk_scrolled_view_dragable_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
Etk_Bool |
dragable | |
|
) |
| | |
Set the scrolled view dragable or not.
- Parameters:
-
| scrolled_view | a scrolled view |
| dragable | The scrolled view is dragable or not? |
References drag, ETK_OBJECT, and etk_object_notify().
Get the scrolled view dragable flag.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns ETK_TURE if the scrolled view is dragable
References drag.
void etk_scrolled_view_drag_bouncy_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
Etk_Bool |
bouncy | |
|
) |
| | |
Set the scrolled view boucy or not.
- Parameters:
-
| scrolled_view | a scrolled view |
| bouncy | The scrolled view is bouncy or not (Default TRUE) |
References drag, ETK_OBJECT, and etk_object_notify().
Get the scrolled view bouncy flag.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns ETK_TURE if the scrolled view is bouncy
References drag.
double etk_scrolled_view_drag_sample_interval_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
double |
interval | |
|
) |
| | |
Set the scrolled view sample interval to calculate the scrolling speed.
- Parameters:
-
| scrolled_view | a scrolled view |
| interval | The interval of sampling latest scrolling speed (minimial 0.2 second, default 0.5 second) |
- Returns:
- Returns the actual sampling interval set. If scrolled_view is NULL returns 0.0f.
References drag, ETK_OBJECT, and etk_object_notify().
double etk_scrolled_view_drag_sample_interval_get |
( |
Etk_Scrolled_View * |
scrolled_view |
) |
|
Get the scrolled view sample interval to calculate the scrolling speed.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the sampling interval. If scrolled_view is NULL return 0.0f.
References drag.
unsigned int etk_scrolled_view_drag_damping_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
unsigned int |
damping | |
|
) |
| | |
Set the damping magic number of a dragable scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
| damping | The damping factor of the dragable scrolled view (default 100) |
- Returns:
- Returns the actual damping factor set
References drag, ETK_OBJECT, and etk_object_notify().
unsigned int etk_scrolled_view_drag_damping_get |
( |
Etk_Scrolled_View * |
scrolled_view |
) |
|
Get the damping magic number of a dragable scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the actual damping factor
References drag.
|
 |
 |
 |
 |
|