39. CWM

Routines for common widget manipulation

39.1. Authors

  • Jiri Srain <jsrain@suse.cz>

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

    39.3. Global Functions

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

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

    39.3.3. DisableButtons

    Disable given bottom buttons of the wizard sequencer

    Function parameters

    • list<string> buttons

    Return value

    • void

    39.3.4. GetProcessedWidget

    Return description map of currently processed widget

    Return value

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

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

    39.3.6. MergeHelps

    Merge helps from the widgets

    Function parameters

    • list<map<string,any> > widgets

    Return value

    • string - merged helps of the widgets

    39.3.7. OkCancelBox

    Create a term with OK and Cancel buttons placed horizontally

    Return value

    • term - the term (HBox)

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

    39.3.9. ReplaceWidgetHelp

    Replace help for a particular widget

    Function parameters

    • string widget

    • string help

    Return value

    • void

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

    39.3.11. SetValidationFailedHandler

    Set handler to be called after validation of a dialog failed

    Return value

    • void

    39.3.12. ShowAndRun

    Display the dialog and run its event loop

    Function parameters

    • map<string,any> settings

    Return value

    • symbol

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

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

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

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

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

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

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

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

    39.3.21. initWidgets

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

    Function parameters

    • list<map<string, any> > widgets

    Return value

    • void

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

    39.3.23. prepareWidget

    Prepare a widget for usage

    Function parameters

    • map<string, any> widget_descr

    Return value

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

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

    39.3.25. validateWidget

    Validate single widget

    Function parameters

    • map<string, any> widget

    • map event

    • string key

    Return value

    • boolean - true if validation succeeded

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

    39.4. Global Variables

    39.5. Module Requirements

    39.5.1. Module Imports

    • Label
    • Report
    • Wizard

    39.5.2. Module Includes