Difference between revisions of "ShowWindow"

m (4.7 -> 5.0)
Line 10: Line 10:
 
:<code>"Object"</code>: Show the [[Object window]] for «obj».
 
:<code>"Object"</code>: Show the [[Object window]] for «obj».
 
:<code>"Result"</code>: Show the [[Result Tables and Graphs|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 [[Preferences|preference settings]].
 
:<code>"Result"</code>: Show the [[Result Tables and Graphs|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 [[Preferences|preference settings]].
:<code>"Graph"</code>: Show the [[Result Window - Graph|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.
+
:<code>"Graph"</code>: Show the [[graph view of a result]] 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.
:<code>"ResultTable"</code> (or just <code>"Table"</code>): Show the [[Result Window - Table|result window in table view]]. «Obj» should be a variable. Causes the variable to be evaluated, which could cause an evaluation error to display.
+
:<code>"ResultTable"</code> (or just <code>"Table"</code>): Show the [[table view of a result]]. «Obj» should be a variable. Causes the variable to be evaluated, which could cause an evaluation error to display.
 
:<code>"Definition"</code>: Shows the definition of «obj». When «Obj» is an [[Table|edit table]], an edit table window is opened.
 
:<code>"Definition"</code>: Shows the definition of «obj». When «Obj» is an [[Table|edit table]], an edit table window is opened.
 
:<code>"Outline"</code>: Opens the [[Outline window]], with the hierarchy opened to the module containing «obj» and «obj» selected.
 
:<code>"Outline"</code>: Opens the [[Outline window]], with the hierarchy opened to the module containing «obj» and «obj» selected.

Revision as of 00:36, 12 August 2016


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 graph view of a result 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 table view of a result. «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. Use ShowWindow(Null,"Typescript")

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