
MenuBar

MenuBar Methods
| MenuBar() | Constructor for the MenuBar class |
| AddSeparator() | Virtual method to add a separator to the menu bar |
| NumSeparators() | Virtual method to return number of separators in the menu bar |
| NumItems() | Virtual method to return number of "menu items" attached to the menu bar |
Derived Classes
None
See Also
Class Hierarchy, Dialog, Frame, ToolBar, MenuItem
public method MenuBar(Window Parent)
Parameters
Parent
Parent window of the menu bar
Return Value
None
Description
Constructor for the MenuBar class. The parent must be specified, and it must be a Dialog, Frame, ParentFrame or MenuItem window type (or derived from one of those). The MenuItem parent is used to tie a sub menu to a menu item.
MenuBar Class
public virtual method<int> AddSeparator(int Index = 0)
Parameters
Index
Will be added before the one based index. Zero means add to end.
Return Value
One based index where separator was added
Description
This virtual method adds a separator to the menu bar. The specified index is one based, and the separator gets added before that index. If the index is zero (default), the separator gets added to the end.
MenuBar Class
public virtual method<int> NumSeparators()
Parameters
None
Return Value
Number of separators in the menu bar
Description
This virtual method returns the number of separators which have been added to the menu bar.
MenuBar Class
public virtual method<int> NumItems()
Parameters
None
Return Value
Number of "MenuItem" objects attached to menu bar
Description
This virtual method returns the number of "MenuItem" objects which are attached to this menu bar object. It does not include separators.
MenuBar Class
public virtual method<SelectItem> GetItem(int Index)
Parameters
Index
One based index for the item
Return Value
Reference to MenuItem object or null
Description
This virtual method returns a reference to the MenuItem object associated with the specified one based index. If the index refers to a separator (or if the index is not valid), a null will be returned. A valid index will be in the range from one to the total of (separators + items).
This MenuBar implementation of this method will return a MenuItem reference.
MenuBar Class