WireLess Studio Widgets Developer's Guide |
Call this method to create a new widget. Once a widget is created, it can be manipulated using the WStWidget object and can be attached to a form using the WStForm::AddObject method.
VARIANT_BOOL CreateWidgetById(SHORT usType, SHORT usId, LPCTSTR sName, SHORT usXCoord, SHORT usYCoord, SHORT usWidth, SHORT usHeight, LPCTSTR sText);
VARIANT_BOOL CreateWidget(SHORT usType, SHORT usId, LPCTSTR sName, SHORT usXCoord, SHORT usYCoord, SHORT usWidth, SHORT usHeight, LPCTSTR sText);
On success, CreateWidget returns TRUE, FALSE otherwise. To get extended information, call WStError::GetLastErrorCode.
The widget's type can be one of the following constants found on the WSTFactoryConstants enumeration: WS_BITMAP, WS_BUTTON, WS_CHECKBOX, WS_FIELD, WS_HTML_CTRL, WS_LABEL, WS_LINE, WS_LIST_CTRL, WS_MENU, WS_PROGRESS_BAR and WS_RADIO_BUTTON.
The description of the available widgets can be found here.
CreateWidgetById tries to index the widget only by its id, if it fails the widget creation fails.
Unlike CreateWidgetById, CreateWidget tries to index the widget by its id or its name, if it fails the widget creation fails. If the indexation success by both id and name, the WStWidget methods with the suffix ById and ByName can be used to customize the widget.
The widget's size and position depends on the coordinates type used by the form the widget is attached to. (For more information see WStForm::SetCoordType).
The first id that can be to create a widget is 11, lower numbers are reserved.
using WirelessStudioOleWidgets; WStFactory oFactory = new WStFactory(); oFactory.CreateWidgetBy((short)WSTFactoryConstants.WS_LINE, 33, "MyLine", 15, 15, 30, 30, "")
Public wsForm As New WStForm Public wsFactory As New WStFactory ... wsFactory.CreateWidget WS_LABEL, 0, "formTittle", 33, 0, 40, 5, "Basic Properties Demo" wsFactory.CreateWidget WS_BUTTON, 0, "exitButton", 5, 80, 29, 12, "Exit" wsFactory.CreateWidget WS_BUTTON, 0, "resetButton", 35, 80, 29, 12, "Reset" wsFactory.CreateWidget WS_LINE, 0, "topLine", 5, 6, 90, 1, "" ...
CloneObject | WStForm::AddObject | CreateForm
WStWiget class reference | WStForm class reference | WStFactory class reference | WStError class reference
WireLess Studio by SofToGo S.A. | Visit our site www.softogo.com | Contact us help@softogo.com |