WireLess Studio Widgets Developer's Guide
WSWDG ContentsWStForm class reference

CommitChanges

Call this method to serialize and transfer the modifications made to a specific form and the widgets attached to it.

Ole declaration

VARIANT_BOOL CommitChangesByName(LPCTSTR sFormName);

VARIANT_BOOL CommitChangesById(SHORT usFormId);

Parameters
sFormName
The form's name.
usFormId
The form's id.
Return Value

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

Remarks

If a widget is attached to more than one form the changes are transferred only to the form specified.

Example
C#
using WirelessStudioOleWidgets;
WStWidget oWidget = new WStWidget();
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.ShowById(formId, true, true);
oWidget.SetLineWidthById(lineId, 5);
oForm.CommitChangesById(formId);
Visual Basic 6 (Full Example: LineDemoModule.bas.txt)
Public wsForm As New WStForm
...
 wsWidget.SetTextColorByName "line", iRed, iGreen, iBlue
    
If bHorizontal Then
	wsWidget.SetOrientationByName "line", WS_ORIENTATION_HORIZ
Else
	wsWidget.SetOrientationByName "line", WS_ORIENTATION_VERT
End If

bHorizontal = Not bHorizontal
    
iWidth = Int((15 - 1 + 1) * Rnd + 1)
wsWidget.SetLineWidthByName "line", iWidth
    
bResult = wsForm.CommitChangesByName("myForm")
...	
See also

Show | SaveToTerminal | AddObject

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