CreateButton Method

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

The CreateButton Method creates a standard labeled button that triggers a specific action when the user "clicks" it.

Syntax

public WaveLinkWidget CreateButton(int XCoord, int YCoord, int Width, int Height, String displayText, 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

displayText

The display text of the widget

targetCollection

The name of the widget collection

Returns

A pointer to the button widget

Throws

WaveLinkError

Remarks

The default value returned by a button widget through an RFInput Method call is the display text.

The DefaultCoordinateType Property determines how the application interprets the values entered for the position, width, and height of the widget.

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). AUTOSIZE sizes the button widget according to the size of the text that it contains.

Example

WaveLinkFactory factoryIface = new WaveLinkFactory();

WaveLinkWidgetCollection colIface = new WaveLinkWidgetCollection();

WaveLinkIO ioIface = new WaveLinkIO();

try {

ioIface.RFPrint(0, 0, "WaveLink Corporation", WaveLinkIO.WLCLEAR | WaveLinkIO.WLREVERSE);

ioIface.RFPrint(0, 1, " Auto Detailing ", WaveLinkIO.WLNORMAL);

factoryIface.CreateButton(4, 12, 0, 0, " Start ", 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