Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

GSubMenu Class Reference

Sub menu. More...

#include <GMenu.h>

Inheritance diagram for GSubMenu:

GTarget GFlags GMenu List of all members.

Public Member Functions

 GSubMenu (char *name=(char *)"", bool Popup=true)
 Constructor.
OsSubMenu Handle ()
 Returns the OS handle.
GMenuItemAppendItem (char *Str, int Id, bool Enabled, int Where=-1)
 Add a new item.
GSubMenuAppendSub (char *Str, int Where=-1)
 Add a submenu.
GMenuItemAppendSeparator (int Where=-1)
 Add a separator.
void Empty ()
 Delete all items.
bool RemoveItem (int i)
 Detachs an item from the sub menu but doesn't delete it.
bool RemoveItem (GMenuItem *Item)
 Detachs an item from the sub menu but doesn't delete it.
GMenuItemItemAt (int i)
 Return a pointer to an item.
GMenuItemFindItem (int Id)
 Returns a pointer to an item.
GSubMenuFindSubMenu (int Id)
 Returns a pointer to an item.
int Float (GView *Parent, int x, int y, bool Left=false)
 Floats the submenu anywhere on the screen.
GMenuItemGetParent ()
 Returns the parent menu item.
GMenuGetMenu ()
 Returns the menu that this belongs to.

Protected Attributes

GMenuItemParent
 The parent menu item or NULL if the root menu.
GMenuMenu
 The top level window this sub menu belongs to or NULL.
GViewWindow
 The window that the menu belongs to or NULL.

Friends

class GMenuItem
class GMenu

Detailed Description

Sub menu.


Constructor & Destructor Documentation

GSubMenu::GSubMenu char *  name = (char *)"",
bool  Popup = true
 

Constructor.

Parameters:
name  Name of the menu
Popup  True if it's popup


Member Function Documentation

GMenuItem * GSubMenu::AppendItem char *  Str,
int  Id,
bool  Enabled,
int  Where = -1
 

Add a new item.

Parameters:
Str  The text of the item.

If you put a tab control in the text, anything after the tab is considered to be the keyboard shortcut for the menu item. The shortcut can be a combination of keys added together with '+'.

e.g.

  • Ctrl+S
  • Alt+Del
  • F2
Id  Command ID to post to the OnCommand() handler
Enabled  True if the item should be enabled
Where  The index into the list to insert at, or -1 to insert at the end

GSubMenu * GSubMenu::AppendSub char *  Str,
int  Where = -1
 

Add a submenu.

Parameters:
Str  The text of the item
Where  The index to insert the item, or -1 to insert on the end

GMenuItem * GSubMenu::FindItem int  Id  ) 
 

Returns a pointer to an item.

Parameters:
Id  The ID of the item to return

GSubMenu * GSubMenu::FindSubMenu int  Id  ) 
 

Returns a pointer to an item.

Parameters:
Id  The ID of the sub menu to return

int GSubMenu::Float GView Parent,
int  x,
int  y,
bool  Left = false
 

Floats the submenu anywhere on the screen.

Parameters:
From  The parent view
x  The x coord of the top-left corner
y  The y coord of the top-left corner
Left  True if the menu is tracking the left button, else it tracks the right button

GMenuItem * GSubMenu::ItemAt int  i  ) 
 

Return a pointer to an item.

Parameters:
Id  The index of the item to return

bool GSubMenu::RemoveItem GMenuItem Item  ) 
 

Detachs an item from the sub menu but doesn't delete it.

Parameters:
Item  Pointer of the item to remove

bool GSubMenu::RemoveItem int  i  ) 
 

Detachs an item from the sub menu but doesn't delete it.

Parameters:
i  The index of the item to remove


The documentation for this class was generated from the following files:
Generated on Wed Oct 26 14:47:03 2005 for Lgi by  doxygen 1.4.1