This member of Class WaveLinkFactory is supported on: Palm, CE
The CreateMenubar Method creates a menubar containing a set of menus. Each menu is associated with a pop-up list that activates when the user taps it.
Syntax
public WaveLinkWidget CreateMenubar(WaveLinkMenubarInfo menuInfo, WaveLinkWidgetCollection targetCollection)
throws WaveLinkError
Parameters
menuInfo |
The name of the WaveLinkMenubarInfo object to associate with the widget |
targetCollection |
The name of the collection that will contain the widget |
Returns
A pointer to the menubar widget
Throws
WaveLinkError
Remarks
The menubar displays menu names based on stored WaveLinkMenu configurations. The menu configuration used by the menubar must be stored on the device before the menubar can access it. The menubar widget returns the menu index of the user-selected option.
Use the WaveLinkMenubarInfo object to create a list of menus for the menubar widget.
While creating the widget object, the CreateMenubar Method automatically calls the SetSpecialInfo Method. If you want to modify the list of menus for the current menubar widget, use the SpecialString Property.
Example
WaveLinkFactory factoryIface = new WaveLinkFactory();
WaveLinkWidgetCollection colIface = new WaveLinkWidgetCollection();
WaveLinkMenubarInfo infoIface = new WaveLinkMenubarInfo();
WaveLinkMenu mnuIface = new WaveLinkMenu();
try {
// Create the menus that appear in the menubar.
mnuIface.ResetMenu();
mnuIface.AddTitleLine("Widget Demo's");
mnuIface.AddOption("Buttons");
mnuIface.AddOption("Pen Capture");
mnuIface.StoreMenu("MenOne");
mnuIface.ResetMenu();
mnuIface.AddTitleLine("Exit");
mnuIface.AddOption("Quit");
mnuIface.StoreMenu("MenTwo");
// Insert the menus into the WaveLinkMenubarInfo object, using a –1 to automatically tack the menu to the end of the list.
infoIface.Insert(–1, "MenOne");
infoIface.Insert(–1, "MenTwo");
.
.
.
factoryIface.CreateMenubar(myMenInfo, colIface);
colIface.StoreWidgets();
}
catch (WaveLinkError wlErr) {
//Do error handling
}
Was this article useful?
The topic was:
Inaccurate
Incomplete
Not what I expected
Other