Difference between revisions of "User Interface Typescript Commands"
(→Open) |
|||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Typescript Commands]] | [[Category:Typescript Commands]] | ||
[[Category:User Interface Commands]] | [[Category:User Interface Commands]] | ||
− | |||
− | + | __TOC__ | |
− | + | The typescript commands described here can be used from the '''Typescript''' window or from a button script to manipulate the user interface. For example, they let you display or close selected windows. These commands generally have no effect when used from [[ADE]]. | |
− | + | == Open == | |
+ | :<code>Open ''module''</code> | ||
− | + | Makes «module» the current module. Any new objects declared/created from typescript are placed into the current module. | |
− | + | :<code>Open [diagram | object | definition | table | graph | result ] o</code> | |
− | diagram window | + | The first parameter specifies what kind of window to open: |
− | object window | + | :<code>diagram</code>: Diagram window |
− | Definition: | + | :<code>object</code>: Object window |
− | + | :<code>definition</code>: Definition | |
− | + | :<code>table</code>: Result as table | |
+ | :<code>graph</code>: Result as graph | ||
+ | :<code>result</code>: Result as table or graph depending on what it was last saved as. | ||
− | == Open Diagram ''m'' == | + | === Open Diagram ''m'' === |
+ | Opens the diagram window for module «m». | ||
− | Opens the | + | === Open Object ''o'' === |
+ | Opens the object window for «o». | ||
− | == Open | + | === Open Definition ''o'' === |
+ | Opens the Edit table window if «o» is defined as edit table, otherwise input control if there is one, otherwise definition attribute. | ||
− | Opens the | + | === Open Table ''v'' === |
+ | Opens the result table for «v». The view mode ([[Mid]], [[Mean]], [[PDF]], etc) is determined by the value of the ''ValueState'' attribute of «v». It will open to the previously viewed mode, unless you alter this attribute prior to executing. | ||
− | == Open | + | === Open Graph ''v'' === |
+ | Opens the result graph for «v». The view mode ([[Mid]], [[Mean]], [[PDF]], etc) is determined by the value of the ''ValueState'' attribute of «v». | ||
− | + | === Open Result ''v'' === | |
+ | Opens the Result window for «v», showing a [[Table]] or graph, depending on the last view selected. The last view shown is and the result mode are stored as the 7th and 8th fields of the [[Analytica Attributes|ValueState]] attribute. (Its other fields store the location and size of the window). | ||
− | == | + | == Close == |
− | + | === Close ''m'' === | |
− | |||
− | |||
− | = | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == Close ''m'' == | ||
When used within the typescript window, there is always a "current module". If you've created a module from typescript by typing: | When used within the typescript window, there is always a "current module". If you've created a module from typescript by typing: | ||
Line 54: | Line 49: | ||
:Close ''m'' | :Close ''m'' | ||
− | This can be used when | + | This can be used when «m» is the current module. If «m» is the current module and also the top-level module, it will close your model, prompting whether you want to save changes if any unsaved changes are pending, and then exit Analytica. If «m» is a sub-module and the current one, then the current module will become the parent of «m». If «m» is not the current module, it signals an error. |
− | == Close Diagram ''m'' == | + | === Close Diagram ''m'' === |
+ | Closes the diagram window for module «m». | ||
− | Closes the | + | === Close Object ''o'' === |
+ | Closes the object window for «o». | ||
− | == Close | + | === Close Definition ''o'' === |
+ | Closes the edit table window for object «o». | ||
− | + | === Close Graph ''v'', Close Table ''v'', Close Result ''v'' === | |
+ | These all close the result window for «v». | ||
− | == | + | == Edit == |
+ | :Edit «v» | ||
− | + | Same as: Open Definition «v» | |
− | == | + | == ResynchAllWindows == |
− | + | In rare situations, Scripts button or assignments may cause changes that don't immediately update corresponding information displayed on screen. Thus, the user interface may show information inconsistent with what is in the model. The command ResynchAllWindows cures this by re-displaying all open windows so that they are synchronized with the underlying model. It has no parameters. | |
− | |||
− | + | == BrowseModeOn == | |
+ | Equivalent to pressing the Browse tool button on the toolbar. Changes the user into browse-mode if he is currently in edit mode. | ||
− | |||
− | : | + | *(New to [[What%27s_new_in_Analytica_6.5%3F|6.5]]) A module (even non-filed modules) can be set as browse-only from the typescript window as follows: |
+ | <nowiki> </nowiki><code>with ModuleName</code><br /> | ||
+ | <nowiki> </nowiki><code>BrowseModeOn </code><br /> | ||
− | + | * (New to [[Analytica 6.5|6.5]]): Accepts an optional integer with bit flags, e.g., | |
+ | ::<code>BrowseModeOn 3</code> | ||
+ | : Bit 1 means it shouldn't enable model-level UI options like File/Save As... when diagram is in focus. | ||
+ | : Bit 2 means it shouldn't control the model-level toolbar options such as browse/edit mode when diagram is in focus. | ||
− | = | + | == Bye == |
+ | When executed from within a file, as the file is loading, terminates the loading of that file. | ||
− | + | When used from the typescript window, or from a button script, terminates Analytica. Equivalent to selecting '''Quit''' on the [[File menu]]. | |
− | + | (new to [[Analytica 6.0]]) With a minus sign as a parameter, it terminates Analytica without asking to save (and without saving) changes to your model. E.g.: | |
+ | :<code>Bye -</code> | ||
+ | As with any typescript command, from a button [[OnClick]] event, this needs to be run as | ||
+ | :<code>[[EvaluateScript]]('Bye -')</code> | ||
− | + | ==See Also== | |
+ | * [[Typescript]] | ||
+ | * [[User interfaces]] |
Latest revision as of 19:59, 3 January 2025
The typescript commands described here can be used from the Typescript window or from a button script to manipulate the user interface. For example, they let you display or close selected windows. These commands generally have no effect when used from ADE.
Open
Open module
Makes «module» the current module. Any new objects declared/created from typescript are placed into the current module.
Open [diagram | object | definition | table | graph | result ] o
The first parameter specifies what kind of window to open:
diagram
: Diagram windowobject
: Object windowdefinition
: Definitiontable
: Result as tablegraph
: Result as graphresult
: Result as table or graph depending on what it was last saved as.
Open Diagram m
Opens the diagram window for module «m».
Open Object o
Opens the object window for «o».
Open Definition o
Opens the Edit table window if «o» is defined as edit table, otherwise input control if there is one, otherwise definition attribute.
Open Table v
Opens the result table for «v». The view mode (Mid, Mean, PDF, etc) is determined by the value of the ValueState attribute of «v». It will open to the previously viewed mode, unless you alter this attribute prior to executing.
Open Graph v
Opens the result graph for «v». The view mode (Mid, Mean, PDF, etc) is determined by the value of the ValueState attribute of «v».
Open Result v
Opens the Result window for «v», showing a Table or graph, depending on the last view selected. The last view shown is and the result mode are stored as the 7th and 8th fields of the ValueState attribute. (Its other fields store the location and size of the window).
Close
Close m
When used within the typescript window, there is always a "current module". If you've created a module from typescript by typing:
- Module myModuleIdent
then this will be the current module. If you've used the typescript command:
- Open myModule
then that will be your current module. When you create new objects from typescript, they are placed into the current module.
- Close m
This can be used when «m» is the current module. If «m» is the current module and also the top-level module, it will close your model, prompting whether you want to save changes if any unsaved changes are pending, and then exit Analytica. If «m» is a sub-module and the current one, then the current module will become the parent of «m». If «m» is not the current module, it signals an error.
Close Diagram m
Closes the diagram window for module «m».
Close Object o
Closes the object window for «o».
Close Definition o
Closes the edit table window for object «o».
Close Graph v, Close Table v, Close Result v
These all close the result window for «v».
Edit
- Edit «v»
Same as: Open Definition «v»
ResynchAllWindows
In rare situations, Scripts button or assignments may cause changes that don't immediately update corresponding information displayed on screen. Thus, the user interface may show information inconsistent with what is in the model. The command ResynchAllWindows cures this by re-displaying all open windows so that they are synchronized with the underlying model. It has no parameters.
BrowseModeOn
Equivalent to pressing the Browse tool button on the toolbar. Changes the user into browse-mode if he is currently in edit mode.
- (New to 6.5) A module (even non-filed modules) can be set as browse-only from the typescript window as follows:
with ModuleName
BrowseModeOn
- (New to 6.5): Accepts an optional integer with bit flags, e.g.,
BrowseModeOn 3
- Bit 1 means it shouldn't enable model-level UI options like File/Save As... when diagram is in focus.
- Bit 2 means it shouldn't control the model-level toolbar options such as browse/edit mode when diagram is in focus.
Bye
When executed from within a file, as the file is loading, terminates the loading of that file.
When used from the typescript window, or from a button script, terminates Analytica. Equivalent to selecting Quit on the File menu.
(new to Analytica 6.0) With a minus sign as a parameter, it terminates Analytica without asking to save (and without saving) changes to your model. E.g.:
Bye -
As with any typescript command, from a button OnClick event, this needs to be run as
EvaluateScript('Bye -')
Enable comment auto-refresher