Home | All Classes | Grouped Classes | Index | Search

Class CL_Menu

Menu component More...

Derived from: CL_Component
Derived by: none
Group: GUI (Controls)

#include <ClanLib/gui.h>

Construction:

CL_Menu

CL_Menu Constructor

Attributes:

is_open

Returns true if the menu is open

is_vertical

Returns true if the menu is vertical, false if horizontal

is_root_collapsing

Returns true if the root menu collapses when a click outside the menus takes place. Ignored by non-root menus.

is_auto_resize

Returns true if menu resized automatically when its parent is resized.

has_mouse_over

Returns true if the mouse cursor is on top of the menu

has_mouse_in_submenus

Returns true if the mouse cursor is in a open submenu of the menu

get_parent_node

Returns the parent node of this menu.

get_root_menu

Returns the top level parent of the menu tree.

get_node_list

Returns a list containing the CL_MenuNode's in this menu.

get_items_height

Returns the total height of items in a menu

get_items_width

Returns the total width of items in a menu

is_click_to_open

Returns true if the menus submenus need to be clicked to open. By default they open on mouse enter for vertical menus and on click with horizontal menus when it doesn't have focus.

get_menu

Returns a pointer to the menu in the path given, or 0 if no such menu exsists.

get_node

Returns a pointer to the menu node in the path given, or 0 if no such menu exsists.

get_item

Returns a pointer to the menu item (CL_Component*) in the path given, or 0 if no such menu item exsists.

Signals:

sig_reposition

This signal is emitted when a repositioning of the menus is requsted.

Operations:

reposition

Calculates a position and size for the menu, using code in the GUI theme.

set_auto_resize

Makes the menu resize automatically when its parent is resized

set_vertical

Makes the menu vertical (true) or horizontal (false).

set_root_collapsing

Set weather the root menu should collapse when a click outside the menus takes place. Ignored by non-root menus.

add_node

Add a CL_MenuNode to the menu.

remove_node

Remove a CL_MenuNode from the menu.

set_parent_node

Set the parent node of this menu.

open

Open the menu.

collapse

Close the menu.

collapse_submenus

Close all submenus of the menu.

set_click_to_open

Set the opening mode of submenus to open on click (true) or open on mouse over (false)

create_menu

Convenience function for easy creation of menus. Creates needed menus, items and nodes automatically

create_node

Convenience function for easy creation of menus. Creates needed menus, items and nodes automatically

create_item

Convenience function for easy creation of menus. Creates needed menus, items and nodes automatically Returns the parent node of the created item.

create_toggle_item

Convenience function for easy creation of menus. Creates a toggling menu item in the specified path. Returns the parent node of the created item.

Detailed description:

!group=GUI/Controls! !header=gui.h!


Questions or comments, write to the
ClanLib mailing list.