WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStForm class reference

GetEvent

Call this method to wait for a single user input on a widget.

Almost every widget can trigger an event: A click, text input or a function key (For more information see GetLastEventType).

Ole declaration

VARIANT_BOOL GetEvent(void);

Parameters
Return Value

On success, GetEvent returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.

Remarks

When a new event is received, a few values are filled with information about the event. Those values can be retrieved by calling the methods GetLastEventStrValue, GetLastEventIntValue, GetLastEventSourceId, GetLastEventSourceName and GetLastEventType.

GetEvent calls CommitChanges on the form that is currently being shown before waiting for a new event.

Example
C#
using WirelessStudioOleWidgets;
WStFactory oFactory = new WStFactory();
WStForm oForm = new WStForm ();
short formId = 10;
short lineId = 15;
oFactory.CreateFormById(formId);
oFactory.CreateWidgetById((short)WSTFactoryConstants.WS_LINE, lineId , "MyLine", 15, 15, 30, 30, "");
oForm.AddObjectBydId(formId, lineId ;
oForm.SaveToTerminalById(formId);
oForm.ShowById(formId, true, true);
oForm.GetEvent();
Visual Basic 6 (Full Example: BitmapDemoModule.bas.txt)
Public wsForm As New WStForm
...
bResult = wsForm.ShowByName("myForm", True, True)
'Waits for an event and performs an action
While (bEnd = False And bResult)
	bResult = wsForm.GetEvent()
	If wsForm.GetLastEventSourceName() = "exitButton" Or _
		wsForm.GetLastEventSourceName() = "WSFunctionKeysController" Then
	bEnd = True
	End If
Wend
...	
See also

GetLastEventStrValue | GetLastEventIntValue | GetLastEventSourceId | GetLastEventSourceName | GetLastEventType | Show | SaveToTerminal | CommitChanges

WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference