ShowWindow

Revision as of 23:31, 30 December 2015 by Lchrisman (talk | contribs) (history)

new in Analytica 4.7

ShowWindow( obj, windowType )

Shows a window in the Analytica user interface.

  • «obj» is an identifier.
  • «windowType» is one of the following:
    • "Diagram": Show the Diagram window. «Obj» should identify a module.
    • "Object": Show the Object window for «obj».
    • "Result": Show the Result window for «obj». «Obj» should be a variable. Causes the variable to be evaluated, which could cause an evaluation error to display. The result window may open in either a table or graph view, depending on how it was most recently viewed, or on your preference settings.
    • "Graph": Show the Result graph for «obj». «Obj» should be a variable. Causes the variable to be evaluated, which could cause an evaluation error to display. If the result is not graphable (e.g., if it is a scalar), a result table might be shown instead.
    • "ResultTable" (or just "Table"): Show the result window in table view. «Obj» should be a variable. Causes the variable to be evaluated, which could cause an evaluation error to display.
    • "Definition": Shows the definition of «obj». When «Obj» is an edit table, an edit table window is opened.
    • "Outline": Opens the Outline window, with the hierarchy opened to the module containing «obj» and «obj» selected.
    • "Typescript": Opens the Typescript Window. The «obj» parameter is ignored.

Notes

The return value is always Null.

This function is usually used from the OnClick expression of a button. Note that alternative options often exist for accomplishing the same thing. For example, you can insert a Module alias to provide a shortcut to a particular module, or a user output node to bring up a result.

If you select an «obj» and «windowType» combination that doesn't make sense, the function returns without issuing an error. An example would be trying to open a diagram for a variable object. However, an error is issued if «obj» is not the identifier of an existing object, or if «windowType» is not one of the valid types listed above.

If the requested window is already open, but behind other windows, ShowWindow brings it to the top. If it is iconified (aka. minimized), then it un-minimizes it.

Examples

Open the diagram for Module Mo2

ShowWindow(Mo2,"diagram")

Open the result graph for Variable Y

ShowWindow(Y,"Graph")

Compute which diagram to open based on whether b is true or false, and open it.

LocalAlias m := If b Then Handle(Mo2) Else Handle(Mo3);
ShowWindow(m,"Diagram")

History

The functions ShowWindow and CloseWindow were added in Analytica 4.7 to replace the same functionality that was previously available using the Open and Close typescript commands. The new ShowWindow and CloseWindow functions are more convenient to use from OnClick expressions (or from UDFs called from button scripts), and reduce the need for you to learn about a separate set of Typescript commands.

See Also

Comments


You are not allowed to post comments.