|
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...
|
enum | Etk_Scrolled_View_Bouncy_Policy { ,
ETK_BOUNCY_BOUNCE,
ETK_BOUNCY_STOPTOOBJECT
} |
| Etk_Scrolled_View_Bouncy_Policy describes how the scrolled view bounce when hit the margin. 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_Scrolled_View_Bouncy_Policy bouncy) |
| Set the scrolled view boucy or not.
|
Etk_Scrolled_View_Bouncy_Policy | 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.
|
void | etk_scrolled_view_extra_vmargin_set (Etk_Scrolled_View *scrolled_view, int margin) |
| Set the vertical extra margin to the scrolled view.
|
int | etk_scrolled_view_extra_vmargin_get (Etk_Scrolled_View *scrolled_view) |
| Get the vertical extra margin to the scrolled view.
|
void | etk_scrolled_view_extra_hmargin_set (Etk_Scrolled_View *scrolled_view, int margin) |
| Set the horizontal extra margin to the scrolled view.
|
int | etk_scrolled_view_extra_hmargin_get (Etk_Scrolled_View *scrolled_view) |
| Get the horizontal extra margin to the scrolled view.
|
Define Documentation
#define ETK_SCROLLED_VIEW_TYPE (etk_scrolled_view_type_get()) |
Gets the type of a scrolled_view
#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 |
Etk_Scrolled_View_Bouncy_Policy describes how the scrolled view bounce when hit the margin.
- Enumerator:
-
ETK_BOUNCY_BOUNCE |
< No bounce at all, stop at margin. It's default |
ETK_BOUNCY_STOPTOOBJECT |
< Bounce to the margin, and do not stop. |
Function Documentation
Creates a new scrolled view.
- Returns:
- Returns the new scrolled view widget
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
Gets the vertical scrollbar of the scrolled view. You can then change its value, bound values, ...
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the vertical scrollbar of the scrolled view
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.
- Parameters:
-
| scrolled_view | a scrolled view |
| child | the child to add to the viewport |
Sets the visibility policy of the hscrollbar and the vscrollbar of the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
| hpolicy | the visibility policy to use for the hscrollbar |
| vpolicy | the visibility policy to use for the vscrollbar |
- See also:
- Etk_Scrolled_View_Policy
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 |
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? |
Get the scrolled view dragable flag.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns ETK_TURE if the scrolled view is dragable
Set the scrolled view boucy or not.
- Parameters:
-
| scrolled_view | a scrolled view |
| bouncy | The scrolled view is bouncy or not (Default NOBOUNCE) |
Get the scrolled view bouncy flag.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns bounce type
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.
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.
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
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
void etk_scrolled_view_extra_vmargin_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
int |
margin | |
|
) |
| | |
Set the vertical extra margin to the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
| margin | the extra margin in pixels |
Get the vertical extra margin to the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the vertical extra margin in pixels
void etk_scrolled_view_extra_hmargin_set |
( |
Etk_Scrolled_View * |
scrolled_view, |
|
|
int |
margin | |
|
) |
| | |
Set the horizontal extra margin to the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
| margin | the extra margin in pixels |
Get the horizontal extra margin to the scrolled view.
- Parameters:
-
| scrolled_view | a scrolled view |
- Returns:
- Returns the horizontal extra margin in pixels
|
|