- Elementary
- Main
- Authors
- Examples
- Files
- Pages
- Types
- Modules

Macros | Functions
Menu

## Macros
#define | elm_obj_menu_move(x, y) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_MOVE), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)
| Move the menu to a new position. More...
#define | elm_obj_menu_close() ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_CLOSE)
| Close a opened menu. More...
#define | elm_obj_menu_item_add(parent, icon, label, func, data, ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)
| Add an item at the end of the given menu widget. More...
#define | elm_obj_menu_item_separator_add(parent, ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item **, ret)
| Add a separator item to menu obj under `parent`. More...
#define | elm_obj_menu_items_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)
| Returns a list of item's items. More...
#define | elm_obj_menu_first_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
| Get the first item in the menu. More...
#define | elm_obj_menu_last_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
| Get the last item in the menu. More...
#define | elm_obj_menu_selected_item_get(ret) ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)
| Get the selected item in the menu. More...

## Functions
Evas_Object * | elm_menu_item_object_get (const Elm_Object_Item *it)
| Get the real Evas(Edje) object created to implement the view of a given menu `item`. More...
void | elm_menu_item_icon_name_set (Elm_Object_Item *it, const char *icon)
| Set the icon of a menu item to the standard icon with name `icon`. More...
const char * | elm_menu_item_icon_name_get (const Elm_Object_Item *it)
| Get the string representation from the icon of a menu item. More...
void | elm_menu_item_selected_set (Elm_Object_Item *it, Eina_Bool selected)
| Set the selected state of `item`. More...
Eina_Bool | elm_menu_item_selected_get (const Elm_Object_Item *it)
| Get the selected state of `item`. More...
Eina_Bool | elm_menu_item_is_separator (Elm_Object_Item *it)
| Returns whether `item` is a separator. More...
const Eina_List * | elm_menu_item_subitems_get (const Elm_Object_Item *it)
| Returns a list of `item's` subitems. More...
void | elm_menu_item_subitems_clear (Elm_Object_Item *it)
| Remove all sub-items (children) of the given item. More...
unsigned int | elm_menu_item_index_get (const Elm_Object_Item *it)
| Get the position of a menu item. More...
Elm_Object_Item * | elm_menu_item_next_get (const Elm_Object_Item *it)
| Get the next item in the menu. More...
Elm_Object_Item * | elm_menu_item_prev_get (const Elm_Object_Item *it)
| Get the previous item in the menu. More...
Evas_Object * | elm_menu_add (Evas_Object *parent)
| Add a new menu to the parent. More...
void | elm_menu_parent_set (Evas_Object *obj, Evas_Object *parent)
| Set the parent for the given menu widget. More...
Evas_Object * | elm_menu_parent_get (const Evas_Object *obj)
| Get the parent for the given menu widget. More...
void | elm_menu_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y)
| Move the menu to a new position. More...
void | elm_menu_close (Evas_Object *obj)
| Close a opened menu. More...
Elm_Object_Item * | elm_menu_item_add (Evas_Object *obj, Elm_Object_Item *parent, const char *icon, const char *label, Evas_Smart_Cb func, const void *data)
| Add an item at the end of the given menu widget. More...
Elm_Object_Item * | elm_menu_item_separator_add (Evas_Object *obj, Elm_Object_Item *parent)
| Add a separator item to menu `obj` under `parent`. More...
const Eina_List * | elm_menu_items_get (const Evas_Object *obj)
| Returns a list of `item's` items. More...
Elm_Object_Item * | elm_menu_first_item_get (const Evas_Object *obj)
| Get the first item in the menu. More...
Elm_Object_Item * | elm_menu_last_item_get (const Evas_Object *obj)
| Get the last item in the menu. More...
Elm_Object_Item * | elm_menu_selected_item_get (const Evas_Object *obj)
| Get the selected item in the menu. More...

## Detailed Description

A menu is a list of items displayed above its parent. When the menu is showing its parent is darkened. Each item can have a sub-menu. The menu object can be used to display a menu on a right click event, in a toolbar, anywhere.

Signals that you can add callbacks for are:

- `"clicked"` - the user clicked the empty space in the menu to dismiss.
- `"dismissed"` - the user clicked the empty space in the menu to dismiss (since 1.8)

Default content parts of the menu items that you can use for are:

- `"default"` - A main content of the menu item

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

- `"default"` - label in the menu item

Supported elm_object_item common APIs.

- elm_object_item_del
- elm_object_item_part_text_set
- elm_object_item_part_text_get
- elm_object_item_part_content_set
- elm_object_item_part_content_get
- elm_object_item_disabled_set
- elm_object_item_disabled_get

See Also
  Menu Example

## Macro Definition Documentation

#define elm_obj_menu_close | ( |  | ) | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_CLOSE)

Close a opened menu.

Since
  1.8

See Also
  elm_menu_close

Referenced by elm_menu_close().

#define elm_obj_menu_first_item_get | ( |  | ret | ) | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_FIRST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Get the first item in the menu.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_menu_first_item_get

Referenced by elm_menu_first_item_get().

#define elm_obj_menu_item_add | ( |  | parent,
|  |  | icon,
|  |  | label,
|  |  | func,
|  |  | data,
|  |  | ret
| ) |  | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(const char *, icon), EO_TYPECHECK(const char *, label), EO_TYPECHECK(Evas_Smart_Cb, func), EO_TYPECHECK(const void *, data), EO_TYPECHECK(Elm_Object_Item **, ret)

Add an item at the end of the given menu widget.

Since
  1.8

Parameters

  [in] | parent |
  [in] | icon |
  [in] | label |
  [in] | func |
  [in] | data |
  [out] | ret |

See Also
  elm_menu_item_add

Referenced by elm_menu_item_add().

#define elm_obj_menu_item_separator_add | ( |  | parent,
|  |  | ret
| ) |  | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEM_SEPARATOR_ADD), EO_TYPECHECK(Elm_Object_Item *, parent), EO_TYPECHECK(Elm_Object_Item **, ret)

Add a separator item to menu obj under `parent`.

Since
  1.8

Parameters

  [in] | parent |
  [out] | ret |

See Also
  elm_menu_item_separator_add

Referenced by elm_menu_item_separator_add().

#define elm_obj_menu_items_get | ( |  | ret | ) | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_ITEMS_GET), EO_TYPECHECK(const Eina_List **, ret)

Returns a list of item's items.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_menu_items_get

Referenced by elm_menu_items_get().

#define elm_obj_menu_last_item_get | ( |  | ret | ) | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_LAST_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Get the last item in the menu.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_menu_last_item_get

Referenced by elm_menu_last_item_get().

#define elm_obj_menu_move | ( |  | x,
|  |  | y
| ) |  | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_MOVE), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y)

Move the menu to a new position.

Since
  1.8

Parameters

  [in] | x |
  [in] | y |

See Also
  elm_menu_move

Referenced by elm_menu_move().

#define elm_obj_menu_selected_item_get | ( |  | ret | ) | ELM_OBJ_MENU_ID(ELM_OBJ_MENU_SUB_ID_SELECTED_ITEM_GET), EO_TYPECHECK(Elm_Object_Item **, ret)

Get the selected item in the menu.

Since
  1.8

Parameters

  [out] | ret |

See Also
  elm_menu_selected_item_get

Referenced by elm_menu_selected_item_get().

## Function Documentation

Evas_Object* elm_menu_add | ( | Evas_Object * | parent | ) |

Add a new menu to the parent.

Parameters

  parent | The parent object.

Returns
  The new object or NULL if it cannot be created.

void elm_menu_close | ( | Evas_Object * | obj | ) |

Close a opened menu.

Parameters

  obj | the menu object

Returns
  void

Hides the menu and all it's sub-menus.

References elm_obj_menu_close.

Elm_Object_Item* elm_menu_first_item_get | ( | const Evas_Object * | obj | ) |

Get the first item in the menu.

Parameters

  obj | The menu object

Returns
  The first item, or NULL if none

References elm_obj_menu_first_item_get.

Elm_Object_Item* elm_menu_item_add | ( | Evas_Object * | obj,
|  | Elm_Object_Item * | parent,
|  | const char * | icon,
|  | const char * | label,
|  | Evas_Smart_Cb | func,
|  | const void * | data
| ) |  |

Add an item at the end of the given menu widget.

Parameters

  obj | The menu object.
  parent | The parent menu item (optional)
  icon | An icon display on the item. The icon will be destroyed by the menu.
  label | The label of the item.
  func | Function called when the user select the item.
  data | Data sent by the callback.

Returns
  Returns the new item.

Note
  This function does not accept relative icon path.

References elm_obj_menu_item_add.

const char* elm_menu_item_icon_name_get | ( | const Elm_Object_Item * | it | ) |

Get the string representation from the icon of a menu item.

Parameters

  it | The menu item object.

Returns
  The string representation of `item's` icon or NULL

See Also
  elm_menu_item_icon_name_set()

void elm_menu_item_icon_name_set | ( | Elm_Object_Item * | it,
|  | const char * | icon
| ) |  |

Set the icon of a menu item to the standard icon with name `icon`.

Parameters

  it | The menu item object.
  icon | The name of icon object to set for the content of `item`

Once this icon is set, any previously set icon will be deleted.

References elm_icon_standard_set(), elm_layout_edje_get(), and elm_layout_signal_emit().

unsigned int elm_menu_item_index_get | ( | const Elm_Object_Item * | it | ) |

Get the position of a menu item.

Parameters

  it | The menu item

Returns
  The item's index

This function returns the index position of a menu item in a menu. For a sub-menu, this number is relative to the first item in the sub-menu.

Note
  Index values begin with 0

Eina_Bool elm_menu_item_is_separator | ( | Elm_Object_Item * | it | ) |

Returns whether `item` is a separator.

Parameters

  it | The item to check

Returns
  If true, `item` is a separator

See Also
  elm_menu_item_separator_add()

Elm_Object_Item* elm_menu_item_next_get | ( | const Elm_Object_Item * | it | ) |

Get the next item in the menu.

Parameters

  it | The menu item object.

Returns
  The item after it, or NULL if none

Evas_Object* elm_menu_item_object_get | ( | const Elm_Object_Item * | it | ) |

Get the real Evas(Edje) object created to implement the view of a given menu `item`.

Parameters

  it | The menu item.

Returns
  The base Edje object containing the swallowed content associated with `it`.

Warning
  Don't manipulate this object!

Elm_Object_Item* elm_menu_item_prev_get | ( | const Elm_Object_Item * | it | ) |

Get the previous item in the menu.

Parameters

  it | The menu item object.

Returns
  The item before it, or NULL if none

Eina_Bool elm_menu_item_selected_get | ( | const Elm_Object_Item * | it | ) |

Get the selected state of `item`.

Parameters

  it | The menu item object.

Returns
  The selected/unselected state of the item

See Also
  elm_menu_item_selected_set()

void elm_menu_item_selected_set | ( | Elm_Object_Item * | it,
|  | Eina_Bool | selected
| ) |  |

Set the selected state of `item`.

Parameters

  it | The menu item object.
  selected | The selected/unselected state of the item

References elm_layout_edje_get(), and elm_layout_signal_emit().

Elm_Object_Item* elm_menu_item_separator_add | ( | Evas_Object * | obj,
|  | Elm_Object_Item * | parent
| ) |  |

Add a separator item to menu `obj` under `parent`.

Parameters

  obj | The menu object
  parent | The item to add the separator under

Returns
  The created item or NULL on failure

This is item is a Separator.

References elm_obj_menu_item_separator_add.

void elm_menu_item_subitems_clear | ( | Elm_Object_Item * | it | ) |

Remove all sub-items (children) of the given item.

Since
  1.8

Parameters

  it | The item

This removes all items that are children (and their descendants) of the given item `it`.

See Also
  elm_object_item_del()

References elm_object_item_del().

const Eina_List* elm_menu_item_subitems_get | ( | const Elm_Object_Item * | it | ) |

Returns a list of `item's` subitems.

Parameters

  it | The item

Returns
  An Eina_List* of `item's` subitems

See Also
  elm_menu_add()

const Eina_List* elm_menu_items_get | ( | const Evas_Object * | obj | ) |

Returns a list of `item's` items.

Parameters

  obj | The menu object

Returns
  An Eina_List* of `item's` items

References elm_obj_menu_items_get.

Elm_Object_Item* elm_menu_last_item_get | ( | const Evas_Object * | obj | ) |

Get the last item in the menu.

Parameters

  obj | The menu object

Returns
  The last item, or NULL if none

References elm_obj_menu_last_item_get.

void elm_menu_move | ( | Evas_Object * | obj,
|  | Evas_Coord | x,
|  | Evas_Coord | y
| ) |  |

Move the menu to a new position.

Parameters

  obj | The menu object.
  x | The new position.
  y | The new position.

Sets the top-left position of the menu to (`x`,`y`).

Note
  `x` and `y` coordinates are relative to parent.

References elm_obj_menu_move.

Evas_Object* elm_menu_parent_get | ( | const Evas_Object * | obj | ) |

Get the parent for the given menu widget.

Parameters

  obj | The menu object.

Returns
  The parent.

See Also
  elm_menu_parent_set()

void elm_menu_parent_set | ( | Evas_Object * | obj,
|  | Evas_Object * | parent
| ) |  |

Set the parent for the given menu widget.

Parameters

  obj | The menu object.
  parent | The new parent.

Elm_Object_Item* elm_menu_selected_item_get | ( | const Evas_Object * | obj | ) |

Get the selected item in the menu.

Parameters

  obj | The menu object

Returns
  The selected item, or NULL if none

See Also
  elm_menu_item_selected_get()
  elm_menu_item_selected_set()

References elm_obj_menu_selected_item_get.

Copyright ©2000-2014 Enlightenment.org - Samsung Electronics supports the EFL Documentation Project - Generated Wed Jan 8 2014 20:51:14