CreatePopupTrigger Method

This member of Class WaveLinkFactory is supported on: Palm, CE

The CreatePopupTrigger Method creates a popup trigger that displays a pop-up list when the user taps it. The currently selected item appears to the right of the trigger.

Syntax

public WaveLinkWidget  CreatePopupTrigger(int XCoord, int YCoord, intWidth,  int Height, String menuName, int initialOption, WaveLinkWidgetCollection targetCollection)
throws WaveLinkError

Parameters

XCoord

The starting left coordinate of the widget

YCoord

The starting top coordinate of the widget

Width

The horizontal extent of the widget

Height

The vertical extent of the widget

menuName

The name of the WaveLinkMenu configuration associated with the widget

initialOption

The initial menu-index value of the widget (for example, passing a 1 indicates the first menu entry in the WaveLinkMenu configuration)

targetCollection

The name of the collection that will contain the widget

Returns

A pointer to the popup trigger widget

Throws

WaveLinkError

Remarks

The popup trigger populates its menu options with a stored WaveLinkMenu configuration. The menu must be stored on the device before the popup trigger can access it. The widget returns the menu index of the user-selected option.

The CreatePopupTrigger Method automatically stores the menu name associated with the current widget in the SpecialString Property.

For the Width and Height parameters, pass a value of 0 to set the width or height automatically. Set the size of the widget to AUTOSIZE by setting both the width and height to zero (0).

We recommend that you use the AUTOSIZE setting for the height and width of the popup trigger. Using a value other than AUTOSIZE does not change the size of the widget, only the extent of the clickable area surrounding it.

Example

WaveLinkFactory factoryIface = new WaveLinkFactory();

WaveLinkWidgetCollection colIface = new WaveLinkWidgetCollection();

WaveLinkIO ioIface = new WaveLinkIO();

WaveLinkMenu mnuIface = new WaveLinkMenu();

try {

// Create the menu that appears in the widget

mnuIface.ResetMenu();

mnuIface.MenuWidth(18);

mnuIface.AddOption("Basic Car Wash");

mnuIface.AddOption("Basic Wash/Wax");

mnuIface.AddOption("Carnuba Wax");

mnuIface.AddOption("Interior Clean");

mnuIface.AddOption("Full Detail");

mnuIface.AddOption("Special Detail");

mnuIface.AddOption("Device Version");

mnuIface.AddOption("Exit");

mnuIface.StoreMenu("MainMenu");

.

.

.

ioIface.RFPrint(0, 0, "Select Wash:", WaveLinkIO.WLCLEAR);

factoryIface.CreatePopupTrigger(3, 5, 0, 0, "MainMenu", 1, colIface);

colIface.StoreWidgets();

}

catch (WaveLinkError wlErr) {

//Do error handling

}

 


Was this article useful?    

The topic was:

Inaccurate

Incomplete

Not what I expected

Other

Privacy and Legal