The Main Window Node
The Main Window node () represents the main window of an application and is the top-level node for the user interface. It contains the window layout, the main menu specification, and an optional ribbon specification.
The Settings window for the Main Window contains the following sections.
General
The Title field contains the title of the application. The title is the text at the top of the main window. By default, it is the same as the title for the model used to create the application. The Show filename in title check box is selected by default. Clear it to exclude the application’s filename from the title.
To add an icon for the application other than the default COMSOL icon, 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 in the main window of the application. The Default setting loads cube.png. Click the Export button () to export the image to the file system (for use in another application, for example).
From the Menu type list, select the type of menu for the application.
Select Classic menu (the default) to use a main menu at the top of the application. The Main Window branch then includes a Menu Bar node and a Toolbar node, to which you can add menus and submenus with menu items, actions, and separators.
Select Ribbon to use a Windows-style ribbon toolbar at the top of the application. You can then, under Main Window, add a File Menu node (for an Exit command, for example) and a Ribbon node, to which you can add Ribbon Tab nodes. Under Ribbon Tab nodes, you can add Ribbon Section nodes to which you can add menus and submenus with menu items, actions, and separators.
From the Main window type list, choose Single window (the default) to treat the app as a single window using a single main form that is shown in the entire window, or choose Subwindows to create an app with subwindows, which can be resizable with dragging. With this setting, you can specify multiple subwindows in the Main Window editor window, in which forms can be opened and closed. To get to the Main Window editor window, double-click the Main Window node, or right-click the Main Window node or any of its subnodes and choose Edit. In the Main Window editor window, you can right-click and choose Insert Above, Insert Below, Insert Left, or Insert Right (if applicable), and if all options then under Row for Insert Above and Insert Below and Column for Insert Left or Insert Right. That way you can create a layout for your app with several subwindows. If you select subwindows that can be merged (that are connected), you can also right-click and choose Merge Cells to merge the selected subwindows, and if a subwindow that can be split is selected, you can right-click and choose Split Cell to split it into its original constituent subwindows. You can also right-click in a subwindow in the Main Window editor window and choose Settings to move to The Subwindow Settings, where you can add forms to the subwindow.
For an example of an app with resizable subwindows, see Helical Static Mixer in the COMSOL Multiphysics application library.
The Status bar list controls what to show in the status bar. Select Progress when running (the default, which adds a COMSOL progress bar in the lower-right corner of the application; see Progress Bar for adding custom progress bars) or None.
Main Form
This section is only available when you have selected Single window from the Main window type list above.
This section contains a reference to the form that the main window displays. Select the form to display from the Form list.
The Prefer inner scrollbars check box is selected by default to provide vertical scrollbars for the sections in the app with content that does not fit when you shrink the height of the application’s window. If you clear this check box, a vertical scrollbar appears to the very right in the application’s window. Clearing this check box can also be a way to avoid side effects that the algorithm to create inner scrollbars can sometimes cause.
Window Layout
This section is only available when you have selected Subwindows from the Main window type list above.
In the tables at the top of the section, in the Width and Height columns, define the size (width and height) for the columns and rows of the subwindows that you have defined in the Main Window window (see above).
Select the Allow dragging between subwindows check box if you want to create an app where the user can resize the subwindows by dragging between them.
Use the Show form header in subwindows with a single form check box to control whether forms in subwindows with a single form should have a header (by default, no headers are shown). This setting is only available when dragging between subwindows is not allowed.
Size
From the Initial size list, select how to set the initial size of the application window:
Select Maximized to open the application window in a maximized state that fills the screen.
Select Use main form’s size (the default) to adapt the application window size to the size of its main form, which is the form selected in the Main Form section above.
Select Manual to specify the application window’s initial size in the Width (default: 1280 pixels) and Height (default: 800 pixels) fields that appear.
Select the Center on screen check box to make the application centered in the middle of the computer screen when launched.
About Dialog
In this section, you can specify the contents of the About dialog box and the placement of the link to that dialog box.
From the Placement list, choose one of the following options for the placement of the link:
Automatic (the default), which puts the link to the About dialog box in the following place:
-
The File menu, if the Menu type list is set to Ribbon and there is an added File Menu
-
The toolbar, if the Menu type list is set to Menu bar and there is a toolbar but no menus
-
File menu or Menu bar (depending on the setting in the Menu type list).
Ribbon or Toolbar (depending on the setting in the Menu type list).
Lower-right corner (an About hyperlink in the lower-right corner of the application’s main form). If there is no form in the application, it uses the automatic placement instead.
Lower-left corner (an About hyperlink in the lower-left corner of the application’s main form). If there is no form in the application, it uses the automatic placement instead.
Clear the Show COMSOL Information check box if you do not want to include the standard information (logo, version number, and information about products used).
In the Custom text field, add any text that you want to include in the About dialog box. The text appears above the license, patent, and trademark information. If you include a web address, it will appear as a hyperlink in the About dialog box. The web address must be a valid URL that starts with http:// or www.
Language Localization
This section contains settings for localization of the app. Select the Localization check box if the app should support localization of its user interface. Then, from the Language list, choose From preferences to use the language specified in the Preferences window, or choose any added language file. When using From preferences, the software tries to locate a file that has been defined as having the same language as the language preference in the COMSOL Desktop (in the list of languages in the Languages node) and then use it for localizing the app. If there is no match, then the top (first) entry in the list of languages in the Languages node will be used, which provides a way to define a fallback language. See Languages for information about adding and managing language files for an app.
For an example of an app with localization, see Tubular Reactor with Jacket in the COMSOL Multiphysics application library.