Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Related Pages

Menu_Base: The Basic Menu Functionality

Defines the basic menu classes that are extended to an actual menu implementation by inheriting classes such as Ewl_Menu and Ewl_IMenu. More...

Data Structures

struct  Ewl_Menu_Item
 Inherits from Ewl_Box to gain it's layout abilities, places policy on top of the box framework to provide a simple menu layout of icon and label. More...

struct  Ewl_Menu_Separator
 Inherits from Ewl_Menu_Item and limits it's functionality to simply provide a separator between items in a menu. More...

struct  Ewl_Menu_Item
 Inherits from Ewl_Box to gain it's layout abilities, places policy on top of the box framework to provide a simple menu layout of icon and label. More...

struct  Ewl_Menu_Separator
 Inherits from Ewl_Menu_Item and limits it's functionality to simply provide a separator between items in a menu. More...


Defines

#define EWL_MENU_ITEM(mi)   ((Ewl_Menu_Item *)mi)
 Typecasts a pointer to an Ewl_Menu_Item pointer.

#define EWL_MENU_SEPARATOR(s)   ((Ewl_Menu_Separator *)s)
 Typecasts a pointer to an Ewl_Menu_Separator pointer.

#define EWL_MENU_BASE(menu)   ((Ewl_Menu_Base *) menu)
 Typecasts a pointer to an Ewl_Menu_Base pointer.


Typedefs

typedef Ewl_Menu_Item Ewl_Menu_Item
 This serves as a basis for all menu related entries.

typedef Ewl_Menu_Separator Ewl_Menu_Separator
 A simple separator widget for putting lines between items in the menu.

typedef Ewl_Menu_Base Ewl_Menu_Base
 Provides the basic functionality common to the various menu classes.


Functions

Ewl_Widgetewl_menu_item_new (char *image, char *title)
 Create a new menu item to place in a menu.

int ewl_menu_item_init (Ewl_Menu_Item *menu, char *image, char *title)
 Initialize the fields of a menu item to their defaults.

char * ewl_menu_item_text_get (Ewl_Menu_Item *item)
 Get the text of a menu item.

void ewl_menu_item_text_set (Ewl_Menu_Item *item, char *text)
 Sets the text of a menu item.

char * ewl_menu_item_image_get (Ewl_Menu_Item *item)
 Get the image of a menu item.

void ewl_menu_item_image_set (Ewl_Menu_Item *item, char *image)
 Set the image of a menu item.

Ewl_Widgetewl_menu_separator_new (void)
 Create a separator menu item.

void ewl_menu_separator_init (Ewl_Menu_Separator *sep)
 Initialize a menu separator item.

void ewl_menu_base_init (Ewl_Menu_Base *menu, char *image, char *title)
 Initialize a menu item to default values.


Detailed Description

Defines the basic menu classes that are extended to an actual menu implementation by inheriting classes such as Ewl_Menu and Ewl_IMenu.


Typedef Documentation

typedef struct Ewl_Menu_Item Ewl_Menu_Item
 

This serves as a basis for all menu related entries.

It provides the most basic layout facilities for items in a menu.

typedef struct Ewl_Menu_Separator Ewl_Menu_Separator
 

A simple separator widget for putting lines between items in the menu.

Special widget so enclosing menus can assume it can be treated as an Ewl_Menu_Item.


Function Documentation

void ewl_menu_base_init Ewl_Menu_Base menu,
char *  image,
char *  title
 

Initialize a menu item to default values.

Parameters:
menu: the menu item to initialize
image: the icon for the menu item
title: the label for the menu item
Returns:
Returns nothing.
Sets up the internal variables for the menu item and places the icon from image and label from title in the menu item.

char* ewl_menu_item_image_get Ewl_Menu_Item item  ) 
 

Get the image of a menu item.

Returns:
Returns the image currently used by a menu item
Parameters:
item: the menu item

void ewl_menu_item_image_set Ewl_Menu_Item item,
char *  image
 

Set the image of a menu item.

Parameters:
item: the menu item
image: the image filename

int ewl_menu_item_init Ewl_Menu_Item item,
char *  image,
char *  text
 

Initialize the fields of a menu item to their defaults.

Parameters:
item: the item to be initialized
image: the path to image to be used, NULL for no image
text: the text for this menuitem
Returns:
Returns no value.
Initializes a menu item to default values and adds the image pointed to by the path image, and adds the text in text.

Ewl_Widget* ewl_menu_item_new char *  image,
char *  text
 

Create a new menu item to place in a menu.

Parameters:
image: the path to the image to use as an icon
text: the text to display for the menu item
Returns:
Returns a pointer to a new menu item on success, NULL on failure.

char* ewl_menu_item_text_get Ewl_Menu_Item item  ) 
 

Get the text of a menu item.

Returns:
Returns the text currently used by a menu item
Parameters:
item: the menu item

void ewl_menu_item_text_set Ewl_Menu_Item item,
char *  text
 

Sets the text of a menu item.

Parameters:
item: the menu item of which to set the text
text: the text in string form

void ewl_menu_separator_init Ewl_Menu_Separator sep  ) 
 

Initialize a menu separator item.

Parameters:
sep: the menu separator item to initialize
Returns:
Returns no value.
Sets up the internal fields of the menu separator item to some sane defaults.

Ewl_Widget* ewl_menu_separator_new void   ) 
 

Create a separator menu item.

Returns:
Returns a new menu item separator on success, NULL on failure.