Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

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.

scrolled_view.png
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:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Scrolled_View
Properties:
  • "hpolicy": The visibility policy of the horizontal scrollbar
    • Type: Integer (Etk_Scrolled_View_Policy)
    • Access: Read/Write
    • Default Value: ETK_POLICY_AUTO
  • "vpolicy": The visibility policy of the vertical scrollbar
    • Type: Integer (Etk_Scrolled_View_Policy)
    • Access: Read/Write
    • Default 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())

Gets the type of a scrolled_view

Referenced by etk_scrolled_view_new().

#define ETK_SCROLLED_VIEW ( obj   )     (ETK_OBJECT_CAST((obj), ETK_SCROLLED_VIEW_TYPE, Etk_Scrolled_View))

Casts the object to an Etk_Scrolled_View

Referenced by etk_iconbox_current_model_set(), etk_iconbox_scrolled_view_get(), etk_tree_row_scroll_to(), etk_tree_rows_height_set(), and etk_tree_scrolled_view_get().

#define ETK_IS_SCROLLED_VIEW ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_SCROLLED_VIEW_TYPE))

Checks if the object is an Etk_Scrolled_View


Enumeration Type Documentation

enum Etk_Scrolled_View_Policy

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

Etk_Widget * etk_scrolled_view_new ( void   ) 

Creates a new scrolled view.

Returns:
Returns the new scrolled view widget

References ETK_SCROLLED_VIEW_TYPE, and etk_widget_new().

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, ...

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().

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, ...

Parameters:
scrolled_view a scrolled view
Returns:
Returns the vertical scrollbar of the scrolled view

References ETK_RANGE, and vscrollbar.

Referenced by etk_iconbox_current_model_set(), etk_tree_row_scroll_to(), and etk_tree_rows_height_set().

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.

Parameters:
scrolled_view a scrolled view
child the child to add to the viewport

References ETK_BIN, ETK_CONTAINER, etk_container_add(), ETK_IS_VIEWPORT, etk_viewport_new(), etk_widget_internal_set(), and etk_widget_show().

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.

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

References ETK_OBJECT, etk_object_notify(), ETK_WIDGET, etk_widget_redraw_queue(), hpolicy, and vpolicy.

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.

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().

Etk_Bool etk_scrolled_view_dragable_get ( Etk_Scrolled_View *  scrolled_view  ) 

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().

Etk_Bool etk_scrolled_view_drag_bouncy_get ( Etk_Scrolled_View *  scrolled_view  ) 

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.