Variables and Methods Created in the Module's Namespace

CreateWnd
This method will create a window with the Apply, Next, Prev, Cancel buttons.
  • This window will be embedded in the panel region of HyperWorks (or the float, if it cannot be embedded).
  • Takes the name of the window and text to appear on the Apply button as arguments.
WndExists
Will be implemented in the future.
  • Will not be recreating the window if it has already been created.
  • This function will return 0 if the window has never been created.
  • This function will return 1 and display the window if the window has already been created.
  • Currently, this function always returns 0.
RestoreOriginalState
This method will restore the (completion) state of the task to what it was prior to you visiting/revisiting the task.
  • Will be called by the module if you leave the task without executing it or changing any of its data.
variable id
This variable is set as the name of the task.
  • Will be useful in prefixing/namespacing data that will be stored in the DataModel.
  • This will be a key argument for all of the Tcl APIs provided by the Process Manager framework.
Variable mainWnd
The CreateWnd method sets this variable.
  • It is the window handle.
  • The module will add more UI components to this window based on the requirements of the module.
#######################################################################
#  Create the UI components in the window
#######################################################################
proc ::hw::pmgr::${::hw::pmgr::namespace}::DisplayWnd {}
variable mainWnd;
variable id;

if {[WndExists] == 0}
CreateWnd "HWPM -- Load Template" "Apply"

 
# Add other components to the UI
set lblTpl [label $mainWnd.lblwip -text "Madymo template:" \
-font [hwt::AppFont] -anchor w];
set txtfldMadFileName [entry $mainWnd.madymofile \
-font [hwt::AppFont] -width 60]
set btnMadFBrowser [button $mainWnd.fb -text " Browse... " \
-command  "::hw::pmgr::${::hw::pmgr::namespace}::OnBrowseMadymoFile" \
-font [hwt::AppFont]];
pack $ lblTpl $txtfldMadFileName $btnMadFBrowser \
-side left -padx 5 -pady 5

#Get the data from the DataModel and update the UI
GetDataFromDataModel
}
return 0;
}