The Item Node
The Item node () is a menu option that runs a method as a menu item in a parent menu or as a button on a toolbar. You can add an Item node under a Menu node or to a Toolbar object in a form. Enter the name of the item object in the Name field.
In the Text field, enter the text to display on the menu item. To add an icon to the menu item, specify an image file to use from the Icon list, which includes all of the images in the Images library, or click the Add Image to Library and Use Here button () to locate an image to use on the file system. This image then becomes a part of the Images library and is selected as the icon for this menu item. If you do not want to use an icon, select None from the Icon list. Click the Export button () to export the image to the file system (for use in another application, for example).
For Item nodes directly under a Ribbon Section, you can select Large (the default) or Small from the Size list. This size controls the size of the button in the ribbon.
For Item nodes directly under a Ribbon Section, you can also add a tooltip, a descriptive text that displays when the user hovers the pointer over the ribbon button, in the Tooltip field.
You can define a shortcut for the item that you enter in the Keyboard shortcut field. To add a keyboard shortcut, make the Keyboard shortcut field active, and then type a keyboard shortcut on the keyboard.
You must use a modifier in the keyboard shortcut, not just a plain letter (for example, CTRL+SHIFT+D). The shortcut can include the Ctrl key (CTRL), Alt key (ALT), and Shift key (SHIFT). Note that the Ctrl key is interpreted as Command on OS X. Avoid using the following keys in your shortcut:
In addition, the Settings window contains the following section.
Choose Commands to Run
This section contains a tree with a filtered view of the trees in the Application Builder and Model Builder windows. The nodes either support a command or have children that do. When you select a node that supports one or more commands, the corresponding command toolbar buttons become enabled in the toolbar below the tree. You can also right-click a node to get a list of available commands for that particular node. Once you click a command with a node selected (or press Enter to add a command with its default command such as Run, Plot, or Set Value), the command and node appear in the last row of the table in the Choose Commands to Run section of the Settings window. This table contains all of the nodes that run. You can delete and move commands using the toolbar below the table.
In the Model branch, all of the nodes that represent some sort of data value, such as a parameter under the Parameters node, support the Set Value command. Add a Set Value command to the table to enable the third column, Arguments. In this column you type the value to set. For data that represents arrays, use curly braces and commas to enter the array elements. For example, enter {1,2,3} to set a three-element array with the values 1, 2, and 3. See The Array 1D String Node for more details about how to enter arrays and matrices. For nodes that represent a file import, such as a Filename node under an Interpolation function node, an Import File command is available. You can also add a Plot command for all View nodes, providing the name of a Graphics object as the argument.
The tree includes a number of branches from the application tree in addition to the Model branch:
The Forms branch: Form nodes support the commands Show, which sets the form as the main form of the application (that is, the content of the application window will be this form), and Show as Dialog, which brings up the form as a separate dialog window.
The GUI Commands branch: The commands under this branch are grouped in three subcategories:
-
File Commands: These include Save Application (to save the application under its current name); Save Application As (to open a file browser dialog allowing the user to save the application in a suitable location); Save Application on Server; Save Application on Server As; Open File (to open an application file resource specified using a valid URI path in the Arguments column); Save File As (similarly, to allow the user to save the file under a name specified in the Arguments column); and Exit Application (to close the running application). If the application is run on COMSOL Server, the Save Application on Server and Save Application on Server As commands save the current state as a new application in the COMSOL Server Application Library.
-
Graphics Commands: Here you find the commands Zoom Extents, Zoom to Selection, Reset Current View, Scene Light, Environment Reflections, Skybox, Transparency, Orthographic Projection, Print, Select All, Clear Selection, Show Selection Colors, and Show Material Color and Texture. For all graphics commands, add the name of the Graphics object that you want to apply the command to as an argument.
-
Model Commands: Here you find the commands Clear All Solutions and Clear All Meshes.
Double-click or right-click any of the nodes above to add a Run command.
The Declarations branch: This branch contains any variable declarations you have added under the Application Builder window’s Declarations branch grouped by type. Like parameters, they support the Set Value command.
The Methods branch: Method nodes support the Run command.
The Libraries branch: Under Sounds, you can choose between sound files to play in a command sequence.
When you click one of the commands underneath the tree, the command appears under Command in the list below. There is also a Symbol column and an Arguments column, where you can enter any applicable arguments that the command uses. A tooltip appears, indicating what type of argument the command expects. For example, for the downloadtoclient command, the argument is a file and its path, such as embedded:///myfile.txt, and there is a separate dialog box that helps you define such an argument. See File Schemes and File Handling for more information.
Click the Convert to Method toolbar button () and choose Convert to Method or Convert to Local Method to convert the entire list of commands in the table to a global or local method that contains the equivalent code. After this operation, the list of commands only contains a single Run operation on the created method. When you select a method under Command, or there is exactly one method in the list, you can go to the editor window for that method by clicking the Go to Method button (). For information about the Edit Argument button (), see Editing Initial Values and Arguments in Declarations and Command Sequences. Use the Move Up (), Move Down (), and Delete () toolbar buttons to organize and remove commands from the list (and the local method, if deleted).