36. CWM

Routines for common widget manipulation

36.1. Summary of Module Globals

List of Global Functions

  • AdjustButtons - Adjust the labels of the bottom buttons of the wizard sequencer

  • CreateWidgets - Read widgets with listed names

  • DisableButtons - Disable given bottom buttons of the wizard sequencer

  • GetProcessedWidget - Return description map of currently processed widget

  • InitNull - Do-nothing replacement for a widget initialization function. Used for push buttons if all the other widgets have a fallback.

  • MergeHelps - Merge helps from the widgets

  • OkCancelBox - Create a term with OK and Cancel buttons placed horizontally

  • PrepareDialog - Prepare the dialog, replace strings in the term with appropriate widgets

  • ReplaceWidgetHelp - Replace help for a particular widget

  • Run - Generic function to create dialog and handle it's events

  • SetValidationFailedHandler - Set handler to be called after validation of a dialog failed

  • ShowAndRun - Display the dialog and run its event loop

  • ShowAndRunOrig - Display the dialog and run its event loop

  • StoreNull - Do-nothing replacement for a widget storing function. Used for push buttons if all the other widgets have a fallback.

  • StringsOfTerm - Process term with the dialog, return all strings. To be used as an argument for widget_names until they are obsoleted.

  • ValidateBasicType - Validate the value against the basic type

  • ValidateMaps - Validate widget description map, check for maps structure Also checks option description maps if present

  • ValidateValueType - Validate type of entry of the widget/option description map Also checks option description maps if present

  • cleanupWidgets - Cleanup after dialog was finished (independently on what event) global only because of testsuites

  • handleWidgets - Handle change of widget after event generated global only because of testsuites

  • initWidgets - Set widgets according to internally stored settings global only because of testsuites

  • mergeFunctions - Add fallback functions to a widget global only because of testsuites

  • prepareWidget - Prepare a widget for usage

  • saveWidgets - Save changes of widget after event generated global only because of testsuites CWMTab uses it too

  • validateWidget - Validate single widget

  • validateWidgets - Validate dialog contents for allow it to be saved

List of Global Variables

    36.2. Global Functions

    36.2.1. AdjustButtons

    Adjust the labels of the bottom buttons of the wizard sequencer

    Function parameters

    • string next

    • string back

    • string abort

    • string help

    Return value

    • void

    36.2.2. CreateWidgets

    Read widgets with listed names

    Function parameters

    • list<string> names

    • map<string,map<string,any> > source

    Return value

    • list<map<string, any> > - of maps representing widgets

    36.2.3. DisableButtons

    Disable given bottom buttons of the wizard sequencer

    Function parameters

    • list<string> buttons

    Return value

    • void

    36.2.4. GetProcessedWidget

    Return description map of currently processed widget

    Return value

    • map<string, any> - description map of currently processed widget

    36.2.5. InitNull

    Do-nothing replacement for a widget initialization function. Used for push buttons if all the other widgets have a fallback.

    Function parameters

    • string key

    Return value

    • void

    36.2.6. MergeHelps

    Merge helps from the widgets

    Function parameters

    • list<map<string,any> > widgets

    Return value

    • string - merged helps of the widgets

    36.2.7. OkCancelBox

    Create a term with OK and Cancel buttons placed horizontally

    Return value

    • term - the term (HBox)

    36.2.8. PrepareDialog

    Prepare the dialog, replace strings in the term with appropriate widgets

    Function parameters

    • term dialog

    • list<map<string,any> > widgets

    Return value

    • term - updated term ready to be used as a dialog

    36.2.9. ReplaceWidgetHelp

    Replace help for a particular widget

    Function parameters

    • string widget

    • string help

    Return value

    • void

    36.2.10. Run

    Generic function to create dialog and handle it's events

    Function parameters

    • list<map<string, any> > widgets

    • map<any, any> functions

    Return value

    • symbol - wizard sequencer symbol

    36.2.11. SetValidationFailedHandler

    Set handler to be called after validation of a dialog failed

    Return value

    • void

    36.2.12. ShowAndRun

    Display the dialog and run its event loop

    Function parameters

    • map<string,any> settings

    Return value

    • symbol

    36.2.13. ShowAndRunOrig

    Display the dialog and run its event loop

    Function parameters

    • list<string> widget_names

    • map<string,map<string,any> > widget_descr

    • term contents

    • string caption

    • string back_button

    • string next_button

    • map<any, any> fallback

    Return value

    • symbol - wizard sequencer symbol

    36.2.14. StoreNull

    Do-nothing replacement for a widget storing function. Used for push buttons if all the other widgets have a fallback.

    Function parameters

    • string key

    • map event

    Return value

    • void

    36.2.15. StringsOfTerm

    Process term with the dialog, return all strings. To be used as an argument for widget_names until they are obsoleted.

    Function parameters

    • term t

    Return value

    • list<string> - strings found in the term

    36.2.16. ValidateBasicType

    Validate the value against the basic type

    Function parameters

    • any value

    • string type

    Return value

    • boolean - true on success or if do not know how to validate

    36.2.17. ValidateMaps

    Validate widget description map, check for maps structure Also checks option description maps if present

    Function parameters

    • map<string,map<string,any> > widgets

    Return value

    • boolean - true on success

    36.2.18. ValidateValueType

    Validate type of entry of the widget/option description map Also checks option description maps if present

    Function parameters

    • string key

    • any value

    • string widget

    Return value

    • boolean - true if validation succeeded

    36.2.19. cleanupWidgets

    Cleanup after dialog was finished (independently on what event) global only because of testsuites

    Function parameters

    • list<map<string,any> > widgets

    Return value

    • void

    36.2.20. handleWidgets

    Handle change of widget after event generated global only because of testsuites

    Function parameters

    • list<map <string, any> > widgets

    • map event_descr

    Return value

    • symbol - modified action (sometimes may be needed) or nil

    36.2.21. initWidgets

    Set widgets according to internally stored settings global only because of testsuites

    Function parameters

    • list<map<string, any> > widgets

    Return value

    • void

    36.2.22. mergeFunctions

    Add fallback functions to a widget global only because of testsuites

    Function parameters

    • list<map <string, any> > widgets

    • map<any, any> functions

    Return value

    • list<map <string, any> > - a list of modified widget description maps

    36.2.23. prepareWidget

    Prepare a widget for usage

    Function parameters

    • map<string, any> widget_descr

    Return value

    • map<string, any> - modified widget description map

    36.2.24. saveWidgets

    Save changes of widget after event generated global only because of testsuites CWMTab uses it too

    Function parameters

    • list<map<string,any> > widgets

    • map event

    Return value

    • void

    36.2.25. validateWidget

    Validate single widget

    Function parameters

    • map<string, any> widget

    • map event

    • string key

    Return value

    • boolean - true if validation succeeded

    36.2.26. validateWidgets

    Validate dialog contents for allow it to be saved

    Function parameters

    • list<map <string, any> > widgets

    • map event

    Return value

    • boolean - true if everything is OK, false if something is wrong

    36.3. Global Variables

    36.4. Module Requirements

    36.4.1. Module Imports

    • Label
    • Report
    • Wizard

    36.4.2. Module Includes