Manuals >User's Guide >Creating Graphic User Interfaces
Print version of this Book (PDF file)
prevnext

Controlling Dialogs

Launching Dialogs

You can launch dialogs defined in the GUI page via four iccap_func commands:

iccap_func("/mdl/dut/orSet/GuiName","Display Modal GUI",
          "InstanceName")
iccap_func("/mdl/dut/orSet/GuiName","Display Modeless
          GUI","InstanceName")

The above forms require that you provide a third argument, which is a unique name for that instance of the dialog. In this way you can raise three identical dialogs if it makes sense to do so.

iccap_func("/mdl/dut/orSet/GuiName","Display Single Modal 
           GUI")
iccap_func("/mdl/dut/orSet/GuiName","Display Single
           Modeless GUI")

These forms don't require a name, and thus you can only show the dialog once using this command. It's useful for callbacks—see the properties for the Wizard GUI Item's Cancel button in the gui_tutorial.mdl.

Auto Execute Feature

If you name a macro AutoExecute, it will run when the icon is double clicked on the main window. The normal Model window will not open. To open the normal Model window, select File > Edit... or right click on the icon and choose Edit... If an AutoExecute macro is not declared, double clicking the icon opens the Model window as usual. You can create an AutoExecute Dialog that creates a particular GUI. This alternate GUI could allow an extraction to be preformed without opening the model file. The following example shows a simple 2 line AutoExecute macro that first calls a transform in a particular setup, which resets the controlling flags of the GUI to a known state, then it displays a modeless dialog.

iccap_func("/mdl/dut/setup/resetGUI","Execute") 
           ! restore known state
iccap_func("/mdl/dut/setup/GuiName","Display Modeless
           GUI","your GUI name here")

For additional examples, see gui_tutorial.mdl or gui_demo.mdl.

Removing Dialogs

You can remove dialogs in two ways—Close and Destroy:

iccap_func("/mdl/dut/orSet/GUIName","Close GUI",
           "InstanceName")
iccap_func("/mdl/dut/orSet/GUIName","Destroy GUI",
           "InstanceName")
iccap_func("/mdl/dut/orSet/GUIName","Close Single GUI")
iccap_func("/mdl/dut/orSet/GUIName","Destroy Single GUI")
Close GUI merely takes the dialog off the screen. The dialog is still built and is reacting to modifications to the variables page, etc. Recalling Display after you've closed simply redisplays the dialog and is very fast.

Destroy GUI actually frees the memory associated with the dialog and the next Display needs to build the entire dialog again.

Automating GUI Items

Adding Items

You may add items to a GUI page via iccap_func on either the GUI Items page, or another GUI item. Two additional parameters are required to name the item and to declare the item's type. The type specification must be a code that uniquely declares the Item type. Select the Show Codes button on the Properties dialog of a GUI Item to see the codes for all Item types.

iccap_func("./GUIItems","Add GUI","ANewTable","TL")
iccap_func("./ANewTable","Add GUI","Button","PB")

Setting Options

You may change options on any Item on a GUI Page from PEL by using the Set GUI Options action on a GUI Item. You may enter as many additional arguments as desired. The last argument must be "" (a null string) to signify completion. Each argument is of the form <code>=<val>. Code is the associated code for the option as found by pressing Show Codes on the properties dialog. The <val> can be one of four forms.

    • A literal
<val> may be a string, or a number

    • A Variable Changed
If the first character after the equal sign is a %, the value is taken to track a variable by the given name.

    • An Enumerated type code
Many options have enumerated types such as list selection mode. Each of these possible values has an associated code which can be viewed on the properties dialog.

    • Multiple Enumerated types
Some options (sizing options, for example) allow multiple enumerated types to be set (fixed width and fixed height). These are indicated by specifying <code>|<code>.

Examples:

iccap_func("./someItem","Set GUI Options","OR=HO", 
           "CA="title","")
iccap_func("./some.other.item","Set GUI Options",
           "TO=FW|FH","")

Setting Callbacks

You may set a callback on a GUI item by using the action Set GUI Callback. This action requires three other arguments. The first is the code for the callback. The second and third extra argument are the two parameters to the callbacks associated iccap_func().

Example:

iccap_func("./someItem","Set GUI Callback","AC","aMacro", 
           "Execute)

prevnext