Tizen Native API  5.0

toolbar_inheritance_tree.png
toolbar.png

A toolbar is a widget that displays a list of items inside a box. It can be scrollable, show a menu with items that don't fit to toolbar size or even crop them.

Only one item can be selected at a time.

Items can have multiple states, or show menus when selected by the user.

This widget implements the elm-scrollable-interface interface, so that all (non-deprecated) functions for the base Scroller widget also work for toolbars (since 1.8)

Smart callbacks one can listen for:

  • "clicked" - when the user clicks on a toolbar item and becomes selected.
  • "longpressed" - when the toolbar is pressed for a certain amount of time.
  • "language,changed" - when the program language changes.
  • "focused" - When the toolbar has received focus. (since 1.8)
  • "unfocused" - When the toolbar has lost focus. (since 1.8)
  • "item,focused" - When the toolbar item has received focus. (since 1.10)
  • "item,unfocused" - When the toolbar item has lost focus. (since 1.10)
  • "selected" - when an item is selected. event_info is a selected item. (since 1.11)
  • "unselected" - when an item is unselected. event_info is a unselected item. (since 1.11)

Available styles for it:

  • "default"
  • "transparent" - no background or shadow, just show the content

Default text parts of the toolbar items that you can use for are:

  • "default" - A label of the toolbar item

Supported elm_object_item common APIs.

List of examples:

Functions

Elm_Widget_Itemelm_toolbar_selected_item_get (const Elm_Toolbar *obj)
 Get the selected item in the widget.
Elm_Widget_Itemelm_toolbar_first_item_get (const Elm_Toolbar *obj)
 Get the first item in the widget.
Elm_Widget_Itemelm_toolbar_last_item_get (const Elm_Toolbar *obj)
 Get the last item in the widget.
void elm_toolbar_standard_priority_set (Elm_Toolbar *obj, int priority)
 Set the standard priority of visible items in a toolbar.
int elm_toolbar_standard_priority_get (const Elm_Toolbar *obj)
 Set the standard priority of visible items in a toolbar.
Elm_Widget_Itemelm_toolbar_more_item_get (const Elm_Toolbar *obj)
 Get the more item which is auto-generated by toolbar.
Elm_Widget_Itemelm_toolbar_item_insert_before (Elm_Toolbar *obj, Elm_Widget_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Insert a new item into the toolbar object before item before.
Elm_Widget_Itemelm_toolbar_item_insert_after (Elm_Toolbar *obj, Elm_Widget_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Insert a new item into the toolbar object after item after.
Elm_Widget_Itemelm_toolbar_item_append (Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Append item to the toolbar.
unsigned int elm_toolbar_items_count (const Elm_Toolbar *obj)
 Get the number of items in a toolbar.
Elm_Widget_Itemelm_toolbar_item_prepend (Elm_Toolbar *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
 Prepend item to the toolbar.
Elm_Widget_Itemelm_toolbar_item_find_by_label (const Elm_Toolbar *obj, const char *label)
 Returns a pointer to a toolbar item by its label.
void elm_toolbar_item_state_unset (Elm_Object_Item *it)
Evas_Objectelm_toolbar_add (Evas_Object *parent)
void elm_toolbar_reorder_mode_set (Evas_Object *obj, Eina_Bool reorder_mode)
Eina_Bool elm_toolbar_reorder_mode_get (const Evas_Object *obj)
void elm_toolbar_transverse_expanded_set (Evas_Object *obj, Eina_Bool transverse_expanded)
Eina_Bool elm_toolbar_transverse_expanded_get (const Evas_Object *obj)
void elm_toolbar_icon_order_lookup_set (Evas_Object *obj, Elm_Icon_Lookup_Order order)
Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get (const Evas_Object *obj)
void elm_toolbar_horizontal_set (Evas_Object *obj, Eina_Bool horizontal)
 Change a toolbar's orientation.
Eina_Bool elm_toolbar_horizontal_get (const Evas_Object *obj)
 Get toolbar's current orientation.

Function Documentation

Add a new toolbar widget to the given parent Elementary (container) object.

Parameters:
parentThe parent object.
Returns:
a new toolbar widget handle or NULL, on errors.

This function inserts a new toolbar widget on the canvas.

Since :
N/A
Examples:
toolbar_example_01.c, toolbar_example_02.c, toolbar_example_03.c, and web_example_02.c.
Elm_Widget_Item* elm_toolbar_first_item_get ( const Elm_Toolbar *  obj)

Get the first item in the widget.

Parameters:
[in]objThe object.
Returns:
The first item or null.
Since :
N/A

Get toolbar's current orientation.

Use this function to get orientation of toolbar.

Returns:
If true, the toolbar is horizontal.
Since :
N/A
void elm_toolbar_horizontal_set ( Evas_Object obj,
Eina_Bool  horizontal 
)

Change a toolbar's orientation.

By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.

Parameters:
[in]horizontalIf true, the toolbar is horizontal.
Since :
N/A

Gets icon lookup order, for toolbar items' icons.

Icons added before calling this function will not be affected. The default lookup order is ELM_ICON_LOOKUP_THEME_FDO.

Returns:
The icon lookup order. (If getting the icon order loopup fails, it returns ELM_ICON_LOOKUP_THEME_FDO)
Since :
N/A

Sets icon lookup order, for toolbar items' icons.

Icons added before calling this function will not be affected. The default lookup order is ELM_ICON_LOOKUP_THEME_FDO.

Parameters:
[in]orderThe icon lookup order. (If getting the icon order loopup fails, it returns ELM_ICON_LOOKUP_THEME_FDO)
Since :
N/A
Elm_Widget_Item* elm_toolbar_item_append ( Elm_Toolbar *  obj,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Append item to the toolbar.

A new item will be created and appended to the toolbar, i.e., will be set as last item.

Items created with this method can be deleted with elm_object_item_del().

Associated data can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().

If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If such function isn't needed, just passing NULL as func is enough. The same should be done for data.

Toolbar will load icon image from fdo or current theme. This behavior can be set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is provided it will load it direct from a file.

Note:
This function does not accept relative icon path.

See: elm_toolbar_item_icon_set()

Parameters:
[in]objThe object.
[in]iconA string with icon name or the absolute path of an image file.
[in]labelThe label of the item.
[in]funcThe function to call when the item is clicked.
[in]dataThe data to associate with the item for related callbacks.
Returns:
The created item or NULL upon failure.
Since :
N/A
Examples:
toolbar_example_01.c, toolbar_example_02.c, toolbar_example_03.c, and web_example_02.c.
Elm_Widget_Item* elm_toolbar_item_find_by_label ( const Elm_Toolbar *  obj,
const char *  label 
)

Returns a pointer to a toolbar item by its label.

Parameters:
[in]objThe object.
[in]labelThe label of the item to find.
Returns:
The pointer to the toolbar item matching label or NULL on failure.
Since :
N/A
Elm_Widget_Item* elm_toolbar_item_insert_after ( Elm_Toolbar *  obj,
Elm_Widget_Item after,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Insert a new item into the toolbar object after item after.

A new item will be created and added to the toolbar. Its position in this toolbar will be just after item after.

Items created with this method can be deleted with elm_object_item_del().

Associated data can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().

If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If such function isn't needed, just passing NULL as func is enough. The same should be done for data.

Toolbar will load icon image from fdo or current theme. This behavior can be set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is provided it will load it direct from a file.

Note:
This function does not accept relative icon path.

See: elm_toolbar_item_icon_set()

Parameters:
[in]objThe object.
[in]afterThe toolbar item to insert after.
[in]iconA string with icon name or the absolute path of an image file.
[in]labelThe label of the item.
[in]funcThe function to call when the item is clicked.
[in]dataThe data to associate with the item for related callbacks.
Returns:
The created item or NULL upon failure.
Since :
N/A
Elm_Widget_Item* elm_toolbar_item_insert_before ( Elm_Toolbar *  obj,
Elm_Widget_Item before,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Insert a new item into the toolbar object before item before.

A new item will be created and added to the toolbar. Its position in this toolbar will be just before item before.

Items created with this method can be deleted with elm_object_item_del().

Associated data can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().

If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If such function isn't needed, just passing NULL as func is enough. The same should be done for data.

Toolbar will load icon image from fdo or current theme. This behavior can be set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is provided it will load it direct from a file.

Note:
This function does not accept relative icon path.

See: elm_toolbar_item_icon_set()

Parameters:
[in]objThe object.
[in]beforeThe toolbar item to insert before.
[in]iconA string with icon name or the absolute path of an image file.
[in]labelThe label of the item.
[in]funcThe function to call when the item is clicked.
[in]dataThe data to associate with the item for related callbacks.
Returns:
The created item or NULL upon failure.
Since :
N/A
Elm_Widget_Item* elm_toolbar_item_prepend ( Elm_Toolbar *  obj,
const char *  icon,
const char *  label,
Evas_Smart_Cb  func,
const void *  data 
)

Prepend item to the toolbar.

A new item will be created and prepended to the toolbar, i.e., will be set as first item.

Items created with this method can be deleted with elm_object_item_del().

Associated data can be properly freed when item is deleted if a callback function is set with elm_object_item_del_cb_set().

If a function is passed as argument, it will be called every time this item is selected, i.e., the user clicks over an unselected item. If such function isn't needed, just passing NULL as func is enough. The same should be done for data.

Toolbar will load icon image from fdo or current theme. This behavior can be set by elm_toolbar_icon_order_lookup_set() function. If an absolute path is provided it will load it direct from a file.

Note:
This function does not accept relative icon path.

See: elm_toolbar_item_icon_set()

Parameters:
[in]objThe object.
[in]iconA string with icon name or the absolute path of an image file.
[in]labelThe label of the item.
[in]funcThe function to call when the item is clicked.
[in]dataThe data to associate with the item for related callbacks.
Returns:
The created item or NULL upon failure.
Since :
N/A

Unset the state of it.

Parameters:
itThe toolbar item.

The default icon and label from this item will be displayed.

See also:
elm_toolbar_item_state_set() for more details.
Since :
N/A
unsigned int elm_toolbar_items_count ( const Elm_Toolbar *  obj)

Get the number of items in a toolbar.

Parameters:
[in]objThe object.
Returns:
The number of items in obj toolbar
Since :
N/A
Elm_Widget_Item* elm_toolbar_last_item_get ( const Elm_Toolbar *  obj)

Get the last item in the widget.

Parameters:
[in]objThe object.
Returns:
The last item or null.
Since :
N/A
Elm_Widget_Item* elm_toolbar_more_item_get ( const Elm_Toolbar *  obj)

Get the more item which is auto-generated by toolbar.

Toolbar generates 'more' item when there is no more space to fit items in and toolbar is in #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_EXPAND mode. The more item can be manipulated by elm_object_item_text_set() and elm_object_item_content_set.

Parameters:
[in]objThe object.
Returns:
The toolbar more item.
Since :
N/A

Get the reorder mode

Parameters:
objThe toolbar object
Returns:
The reorder mode (EINA_TRUE = on, EINA_FALSE = off)
Since :
N/A
void elm_toolbar_reorder_mode_set ( Evas_Object obj,
Eina_Bool  reorder_mode 
)

Set reorder mode

Parameters:
objThe toolbar object
reorder_modeThe reorder mode (EINA_TRUE = on, EINA_FALSE = off)
Since :
N/A
Elm_Widget_Item* elm_toolbar_selected_item_get ( const Elm_Toolbar *  obj)

Get the selected item in the widget.

Parameters:
[in]objThe object.
Returns:
The selected item or null.
Since :
N/A
Examples:
web_example_02.c.
int elm_toolbar_standard_priority_get ( const Elm_Toolbar *  obj)

Set the standard priority of visible items in a toolbar.

If the priority of the item is up to standard priority, it is shown in basic panel. The other items are located in more menu or panel. The more menu or panel can be shown when the more item is clicked.

Parameters:
[in]objThe object.
Returns:
The standard_priority of visible items
Since (EFL) :
1.7
Since :
N/A
void elm_toolbar_standard_priority_set ( Elm_Toolbar *  obj,
int  priority 
)

Set the standard priority of visible items in a toolbar.

If the priority of the item is up to standard priority, it is shown in basic panel. The other items are located in more menu or panel. The more menu or panel can be shown when the more item is clicked.

Parameters:
[in]objThe object.
[in]priorityThe standard_priority of visible items
Since (EFL) :
1.7
Since :
N/A

Get the transverse expansion of toolbar obj.

Parameters:
objThe toolbar object.
Returns:
The transverse expansion of the item. (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)
See also:
elm_toolbar_transverse_expand_set() for details.
Since :
N/A
void elm_toolbar_transverse_expanded_set ( Evas_Object obj,
Eina_Bool  transverse_expanded 
)

Set the item's transverse expansion of a given toolbar widget obj.

Parameters:
objThe toolbar object.
transverse_expandedThe transverse expansion of the item. (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)

This will expand the transverse length of the item according the transverse length of the toolbar. The default is what the transverse length of the item is set according its min value.

Since :
N/A