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.


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

Casts the object to an Etk_Scrolled_View

#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

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

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

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

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

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