This member of WaveLinkFactory Object is supported on: Palm, CE
The CreatePushButton method creates a set of buttons that store an on/off state. When the user selects a button, the selected button stores the "on" state, and all other buttons store the "off" state. Only one button can store the "on" state at any time.
VB
object.CreatePushButton XCoord, YCoord, Width, Height, MenuName, InitialOption, MyColl
VC++
HRESULT hr = object->CreatePushButton(short XCoord, short YCoord, short Width, short Height, BSTR MenuName, short InitialOption, WaveLinkWidgetCollection MyColl);
Parameters
XCoord |
The starting left coordinate of the widget |
YCoord |
The starting top coordinate of the widget |
Width |
The horizontal extent of the widget. Pass a value of 0 to set the width automatically. |
Height |
The vertical extent of the widget. Pass a value of 0 to set the height automatically. |
MenuName |
The name of the RFMenu configuration associated with the widget. |
InitialFlag |
The initial state of the widget. The possible values are: INITSTANDARD - Initial state of the widget is standard (shown and enabled) INITHIDDEN - Initial state of the widget is hidden INITDISABLED - Initial state of the widget is disabled |
MyColl |
The name of the collection that will contain the widget |
Remarks
The push button widget populates its menu options with a stored RFMenu configuration. The menu must be stored on the device before the push button can access it. The widget will return the menu index of the user-selected option.
The CreatePushButton method automatically stores the menu name associated with the current widget in the SpecialString property of the WaveLinkWidget object.
A disabled widget will appear on the RF screen, but it will not return when you click on it. The appearance of a disabled widget is platform dependent. Typically, a disabled widget will either be grayed out or a crosshatch pattern will fill its display text.
You can set other properties specific to the push button widget using the DisplayFlags property of the WaveLinkWidget object.
The DefaultCoordinateType property determines how the application interprets the values entered for the position, width, and height of the widget. You can set the size of the widget to AUTOSIZE by setting the width and height to zero (0). It is recommended that you use the AUTOSIZE setting for the height and width of the push button. Changing this value from its default will not affect the size of the widget, only the extent of the clickable area surrounding it.
Example
' VB Sample Code
Dim wlfactory As New WaveLinkFactory
Dim wlmaincoll As New WaveLinkWidgetCollection
Dim wlio As New RFIO
Dim WelcomeMenu As WaveLinkWidget
Dim wlmenu As New RFMenu
.
.
.
wlmenu.ResetMenu
wlmenu.SetMenuWidth 18
wlmenu.AddOption "1"
wlmenu.AddOption "2"
wlmenu.AddOption "3"
wlmenu.StoreMenu "DegofDif"
' In this example, show some context for the widget
wlio.RFPrint 0, 2, "Degree of ", WLNORMAL
wlio.RFPrint 0, 3, "Difficulty: ", WLNORMAL
' Create the widget
Set WelcomeMenu = wlfactory.CreatePushButton(3, 5, 0, 0, _
"DegofDif", 1, wlmaincoll)
WelcomeMenu.DisplayFlags = PBFIXED
wlmaincoll.StoreWidgets
Was this article useful?
The topic was:
Inaccurate
Incomplete
Not what I expected
Other