33. CWM

Routines for common widget manipulation

33.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

  • GetProcessedWidget - Return description map of currently processed widget

  • 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 Processes only `VBox, `HBox, `Left and `Right

  • ReplaceWidgetHelp - Replace help for a particular widget

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

  • ShowAndRun - Display the dialog and run its event loop

  • ShowAndRunOrig - Display the dialog and run its event loop

  • 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

    33.2. Global Functions

    33.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

    33.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

    33.2.3. GetProcessedWidget

    Return description map of currently processed widget

    Return value

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

    33.2.4. MergeHelps

    Merge helps from the widgets

    Function parameters

    • list<map<string,any> > widgets

    Return value

    • string - merged helps of the widgets

    33.2.5. OkCancelBox

    Create a term with OK and Cancel buttons placed horizontally

    Return value

    • term - the term (HBox)

    33.2.6. PrepareDialog

    Prepare the dialog, replace strings in the term with appropriate widgets Processes only `VBox, `HBox, `Left and `Right

    Function parameters

    • term dialog

    • list<map<string,any> > widgets

    Return value

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

    33.2.7. ReplaceWidgetHelp

    Replace help for a particular widget

    Function parameters

    • string widget

    • string help

    Return value

    • void

    33.2.8. 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

    33.2.9. ShowAndRun

    Display the dialog and run its event loop

    Function parameters

    • map<string,any> settings

    Return value

    • symbol

    33.2.10. 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

    33.2.11. 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

    33.2.12. 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

    33.2.13. 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

    33.2.14. 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

    33.2.15. 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

    33.2.16. initWidgets

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

    Function parameters

    • list<map<string, any> > widgets

    Return value

    • void

    33.2.17. 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

    33.2.18. prepareWidget

    Prepare a widget for usage

    Function parameters

    • map<string, any> widget_descr

    Return value

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

    33.2.19. 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

    33.2.20. validateWidget

    Validate single widget

    Function parameters

    • map<string, any> widget

    • map event

    • string key

    Return value

    • boolean - true if validation succeeded

    33.2.21. 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

    33.3. Global Variables

    33.4. Module Requirements

    33.4.1. Module Imports

    • Label
    • Report
    • Wizard

    33.4.2. Module Includes