Forms
[WINDEV]
Last Edit: January 30, 2018 the alpha360 team
All Form windows have the following definition:
IWF_MyForm(LOCAL p_OpenWindow is ST_a360_DynamicWindow,sReturnPK is string="", bChanged is boolean=False)Independent HFSQL context:
always turned ONUI elements:
They usually have edit controls, combos etc. linked to local window variablesThe Embeds [most common]:
End of Initialization of IWB_MyFormUI_UserAccess() // Controls user accessUI_Format() // Formats currencies and numbersUI_Translate // Translate the WindowUI_Init() // Clears or Retrieves data etc .The LOCAL Procedures [most common]:
UI_UserAccess() // Controls user accessUI_Format() // Formats currencies and numbersUI_RefreshWindow() // Refreshes windows UIUI_RefreshLookups() // Refreshes COMBO boxes etc .UI_Init // Clears or Retrieves data etc .UI_Cancel // Cancels the editing ...UI_Close // Closes the formUI_Save // Saves - completes and Add, Edit or DeleteUI_CheckRequiredFields // Checks for missing dataUI_CleanUpData // Clean up data UI_CreateTranslation // Automatically Create Translation entriesForms are usually used when adding (or editing or deleting or viewing) simple objects - like product records - or more complex objects - like invoices.
They are usually called from Browses but you can call them from anywhere you want.
Lets see how the IWF_Product form works:
1. Pass a p_OpenWindow structure to the IWF_Product form when we "call it"2. In the Global declarations area of the form we create 2 variables of type gProduct3. call UI_UserAccess 4. call UI_Format5. call UI_Translate6. call UI_InitIF p_OpenWindow.nAction = 1 was passed -> this is an ADD/INSERTIF p_OpenWindow.nAction = 2 (or 3 or 4) this is an EDIT (or DELETE or VIEW)7. the user clicks the Save Button and UI_Save is executedComplex forms generally work the same way as simple forms do.
They just have to handle data in temporary tables also - like products in invoices.
Take a look at the code in the IWF_Sales procedure and post any questions you may have in our support forums.
next - > Reports [WIN}
Copyright 2017/18 - computerplus