For users of the Application Builder, COMSOL Multiphysics® version 5.2a brings new built-in Application Object methods, which enable you to modify your app's user interface after launch. There are also two new form objects that can be used to link to outside websites and embed videos directly into your app. Read about all of the Application Builder updates in detail below.
New Built-In Methods for Modifying the Application Builder User Interface
When building an app, you currently use the Form editor in the Application Builder's built-in tools to interactively design a user interface layout. Now, you can also modify the user interface after the app has been launched by using the new built-in Application Object methods. Compared to previous versions of the COMSOL® software, this updated functionality makes it possible to dynamically change many more aspects of a user interface, such as colors, text, icons, fonts, enable state, and much more. In addition, these updates are implemented immediately, instead of when the method is closed down. The Update Graphics command and the corresponding
updateGraphics built-in method have consequently been removed.
The Record Code tool outputs code that corresponds to the interactive modifications made to the application in the Form editor. This makes it easy to quickly create code using the new functionality.
In this example, the Record Code tool outputs code statements into a method for setting the color, font, size, and bold setting for Text Label 1.
Autocompletion for Application Objects
When editing an application object from a method, you can now utilize the autocompletion of code by pressing Ctrl+Space while working in the Method editor.
The autocompletion of code for the icon property of a button.
Shortcuts to User Interface Components
To more easily reference form objects (as well as menu, ribbon, and toolbar items), you can now create shortcuts using custom names. These shortcuts can be used both in other form objects as well as to shorten access to the new Application Object methods. For example, instead of referencing a form object using path syntax, such as
form1/button1, you can now create a shortcut,
plot_temp, and use it as an alias for all uses of
A shortcut is added to a button form object.
New and Improved Form Objects
There are two new form objects, Hyperlink and Video, which can be used to link to outside websites and embed videos into your app, respectively.
Additionally, there are a number of improvements to existing form objects, such as support for automatically making the entire model visible within the extent of a graphics object, via the Zoom Extents form object. You can also create tables with resizable columns through setting the growth policy to grow and create events for array input objects when their contents change, via the On data change event.
A Video form object makes it possible to play video files embedded directly into an application.
A new Unit Set declaration makes it easier to change units used for inputs and results in an application. You can, for example, create a Unit Set declaration to add multiple user-defined unit groups and then add a Combo Box or Radio Button form object to select between the different groups. This functionality is important, for example, when an application allows the use of both SI and imperial units.
A user interface for an application that supports two unit systems.
Event nodes now support Explicit selections, making it possible to run custom commands or methods whenever a selection changes. For example, when a user clicks a boundary in a graphics object, it can trigger an event. When the user adds or removes boundaries from a selection used for a boundary condition in this way, the application can analyze the resulting selection and, if needed, show a dialog box with additional information.
Configurable About Dialog
You can now add custom text to the About Dialog box shown in the user interface of an application. About Dialog is used, for example, to add information about the authors of the application as well as legal disclaimers and license information. You can configure the location of the link and choose between the options:Automatic, Menu bar, Toolbar, and Lower-right corner. The About Dialog section is available in the Settings window of the Main Window node.
Custom About Dialog text for an application, with a dropdown menu for choosing the placement.