Difference between revisions of "CloseWindow"

(examples)
 
(ADE callback EW 18576)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
''new in [[Analytica 4.7]]''
+
[[category:User-interface functions]]
  
== CloseWindow( obj, windowType ) ==
+
== CloseWindow(obj, windowType) ==
  
 
Closes a window in the Analytica user interface.  
 
Closes a window in the Analytica user interface.  
Line 7: Line 7:
 
* «obj» is an identifier.  
 
* «obj» is an identifier.  
 
* «windowType» is one of the following:
 
* «windowType» is one of the following:
** <code>"Diagram"</code>: Closes the [[Diagram window]] for Module «obj».
+
: <code>"Diagram"</code>: Closes the [[Diagram window]] for Module «obj».
** <code>"Object"</code>: Closes the [[Object window]] for «obj».
+
: <code>"Object"</code>: Closes the [[Object window]] for «obj».
** <code>"Result"</code>: Closes the [[Result Tables and Graphs|Result window]] for «obj». «Obj» should be a variable.  
+
: <code>"Result"</code>: Closes the [[Result Tables and Graphs|Result window]] for «obj». «Obj» should be a variable.  
** <code>"EditTable"</code>: Closes the [[Table|edit table]] window for «obj».  
+
: <code>"EditTable"</code>: Closes the [[Table|edit table]] window for «obj».  
** <code>"Outline"</code>: Closes (hides) the [[Outline window]]. The «obj» parameter is ignored.
+
: <code>"Outline"</code>: Closes (hides) the [[Outline window]]. The «obj» parameter is ignored.
** <code>"Typescript"</code>: Closes the [[Typescript Window]]. The «obj» parameter is ignored.
+
: <code>"Typescript"</code>: Closes the [[Typescript Window]]. The «obj» parameter is ignored.
  
 
There is no meaningful return value.
 
There is no meaningful return value.
Line 24: Line 24:
  
 
== Examples ==
 
== Examples ==
 
 
Close the diagram for Module Mo2
 
Close the diagram for Module Mo2
:<code>CloseWindow(Mo2,"Diagram")</code>
+
:<code>CloseWindow(Mo2, "Diagram")</code>
  
 
Close the [[Object window]] for Va1
 
Close the [[Object window]] for Va1
Line 32: Line 31:
  
 
Close the [[Outline window]] (note: «obj» ignored, so can be anything)
 
Close the [[Outline window]] (note: «obj» ignored, so can be anything)
:<code>CloseWindow(Null,"Outline")</code>
+
:<code>CloseWindow(Null, "Outline")</code>
 +
 
 +
== From ADE ==
 +
When evaluated in [[ADE|the Analytica Decision Engine (ADE)]], it calls
 +
[[IAdeUIWindowCallbacks::CloseWindow]](...), from which the parent application implements the logic to jump to the requested UI window. To receive this callback, the parent application must have previously registered the callback with ADE using [[CAEngine::SetCallbackObject]]( ).
 +
 
 +
==History==
 +
Introduced in [[Analytica 5.0]].
  
 
== See Also ==
 
== See Also ==
 
+
* [[ShowWindow]]
* [[ShowWindow]]()
+
* [[Creating Interfaces for End Users]]

Latest revision as of 22:07, 17 September 2018


CloseWindow(obj, windowType)

Closes a window in the Analytica user interface.

  • «obj» is an identifier.
  • «windowType» is one of the following:
"Diagram": Closes the Diagram window for Module «obj».
"Object": Closes the Object window for «obj».
"Result": Closes the Result window for «obj». «Obj» should be a variable.
"EditTable": Closes the edit table window for «obj».
"Outline": Closes (hides) the Outline window. The «obj» parameter is ignored.
"Typescript": Closes the Typescript Window. The «obj» parameter is ignored.

There is no meaningful return value.

Notes

If you use this to close the last open window, not counting the typescript window, it will close the model. The user will be asked whether he wishes to save any changes if any changes have occurred.

The function fails quietly, meaning that it does not issue an error if the requested window is not open, or if you tell it to close a diagram for a non-module, a result for a non-variable, etc. Error messages are issued when the «obj» parameter does not identify an existing object or «windowType» is not a recognized value.

The function is usually used in a button's OnClick event expression.

Examples

Close the diagram for Module Mo2

CloseWindow(Mo2, "Diagram")

Close the Object window for Va1

CloseWindow(Va1, "Object")

Close the Outline window (note: «obj» ignored, so can be anything)

CloseWindow(Null, "Outline")

From ADE

When evaluated in the Analytica Decision Engine (ADE), it calls IAdeUIWindowCallbacks::CloseWindow(...), from which the parent application implements the logic to jump to the requested UI window. To receive this callback, the parent application must have previously registered the callback with ADE using CAEngine::SetCallbackObject( ).

History

Introduced in Analytica 5.0.

See Also

Comments


You are not allowed to post comments.