Contents Hide
An aspect refers to the appearance and orientation of a form on the device, which differs from the project's base form size.
Using aspects, you can create a form which will display in portrait or landscape mode, depending on the orientation of the device. Multiple layouts can also be created, allowing an application to handle different screen sizes and configurations. These layouts may be specifically configured to adopt the operating systems' general look and feel, while having all controls and operations in tact. As such, aspects allows developers to create a single application that would run on both a desktop or a range of mobile devices easily and effectively.
Important things to remember with Aspects:
The form editor window displays the join of the maximum height and width of the base form and aspects.
The Aspects node of a project contains several preset layouts, and also allows the creation of aspect templates which can be re-used within the application.
Each instance of a form aspect can be resized.
Each aspect of a form contains all the form controls available in the base form.
Control properties are focused, such that only visual aspects are editable across controls.
You can use the Aspects node to create multiple aspect templates to be used within the application.
BrightForms automatically detects which aspect is appropriate for the screen. If there are no aspects found, then the base form will be displayed.
Each form created in BrightBuilder will be created and opened with a single 'default' or 'base' aspect. Here, the base visual properties of controls may be edited, as well as the fundamental logic behind each control. These differ from other aspects in the form, which will allow editing of how controls are rendered in the form - such as position, size and colour, but not logic such as any expression or form opening actions associated with the control. Therefore, modifications to the form's key logic must be performed via the base aspect.
The dimensions of the base aspect is defined via a project's form height and width properties. Creating a form in a project for the first time will open the 'Default Form Size' dialog, which allows the specification of these values, and the default value subsequent forms are to be created with. This dialog contains on of standard screen areas for particular devices to choose from, while also providing the option for custom sizes may also be specified via the 'Custom' radio button and input field.
Android
screen sizes vary from device to device, and may be retrieved
via the BrightForms' About screen. For more information, please
refer to the BrightForms
on Android > Android Screen Size chapter of this document.
Once set, all new forms created in the project will have their height and width properties initialised to these base dimensions. The values may be modified via the 'Default Form Size' property of a BSP project.

To create an aspect template:
Double click the Aspects node of a project in BrightBuilder's Projects tree to open the Aspects editor. It will contain a list of pre-populated aspects for Windows, iOS and Android devices.
Tap on the 'Add New Aspect' button to create a new aspect in the list. Alternatively, right-click inside the Aspects dialog to display the pop-up menu and select 'Add New Aspect'. The default size added will be that of the project, else the Windows Mobile portrait size.
Modify the Width and Height requirements of the aspect.
Changes to the aspects will be applied after editing.
You can also delete or rename the aspect template and re-arrange the aspect order by using the Delete, Rename; and Move Up/Move down options from the pop-up menu in the Aspects editor.
As screen space is variable across many web-enabled devices, to ensure an optimal screen resolution is set, the aspects may also be used to define the screen space in these instances. This is achieved by the 'Client Browser Identities' table in the Aspects dialog. Here, strings that may be found in the device/browser's User Agent strings may be defined. When the application runs, if its client identifier is matched against an identifier in this table, the corresponding aspect and scale for that particular browser or device will be loaded, at the scale specified.
Identifiers may be a single string, but also consist of a series of string values, separated by the "$#BS#$" value separator. For identifiers consisting of a number of strings, all strings need to be present in the User Agent string for it to be considered a match.
For example,
"Windows NT$#BS#$Firefox/10.0.2"
would match with
"Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"
but not
"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.66 Safari/535.11"
Along with the User Agent string definition, the initial pixel scaling of the aspect when rendered in a web browser may be set for each identifier. The values range from any value greater than 0 to 2.5 the pixels displayed in the WYSIWYG form editor, and will be applied where applicable - usually on mobile device browsers when each form loads. The default scaling value is 1.5.
To apply an aspect on the form:
Create a form
Right-click outside of the base form layout to display the pop-up menu.
Select Aspects from the pop-up menu. This will display the Enable Aspects dialog.
Select the Aspects that is required by the application
Click Apply button to include the ticked aspects into the form. Notice how the form layout has multiple tabs depending on the number of aspects enabled.
The following are images of different aspects that can be created in BrightBuilder.
This image is the Base form, as shown, the current form is displayed with a 3D effect and the joined aspects form borders are displayed with the dashed lines.
This image is the Windows Mobile Landscape aspect which is a default aspect within BrightBuilder. As can be seen, the edit control added to the base form is also available in this aspect layout.
This last image is an iPhone 4 Portrait aspect template from the Project's Aspect properties.
As shown from the above image, the first tab of the Form layout is the base form layout. This is where all form controls properties can be modified. Only the font, visibility and enable properties can be changed in the aspect layout.
Each control added to any of the form aspects will also be added to all of the aspects, this includes the base form layout. These form controls can then be resized depending on the aspect.
The form layout in itself displays the joint of the maximum height and width of the base form and the aspect forms. This allows you to visualize the form in its entirety within the application.
You can also resize each instance of an aspect by dragging the borders of the aspect form, as shown below:
Notice how BrightBuilder displays the exact width and height of the aspect form, this allows you to take note of the form size so that when another aspect instance needs to be resized with that value.
The Clone Aspect feature of BrightBuilder allows an aspect to be created, based on another aspect's control properties, rather than the form's base aspect. This supports the ability to create similar looks and feels for similar sized devices with ease, as well as facilitating consistent control sizes in the event of portrait and landscape layouts.
In order to clone an aspect:
Navigate to an existing aspect in the form, and right click out of the form's bounds, selecting 'Clone Aspect'.
The 'Clone Aspect' dialog will appear. Select the target aspect from the drop down list, then tap 'Clone'.
The selected aspect will appear in the form, with aspect supported properties copied from the cloned aspect.
Please note that cloning aspects does not apply for base aspect, as simply adding an aspect to the form will place controls to base properties. Furthermore, aspects which are currently defined in the form will not be present for target selection in the 'Clone Aspect' dialog.
To remove an aspect instance from the form layout,
Right-click outside the layout on the base form.
Select Aspects from the pop-up menu.
Untick the aspect to be removed.
Click Apply button. This automatically removes the aspect form from the form layout view.
While aspect switching in an application is usually handled automatically, matching the closest form size with the device, aspects may also be set manually in expressions using the System object method SetDefaultAspect(). This takes in the aspect name as a string value, and if valid, sets the aspect for subsequently opened forms. This setting will also be persisted across BrightForms sessions, until reset with a non-existing aspect name (i.e. an invalid parameter), or if supplied with an empty string.
GetDefaultAspect() may also be used to retrieve the currently used name value.
For more information on these methods, please refer to Reference Manuals > Object Methods Reference > System Objects > System.
Form object's GetCurrentAspect() method returns the name of the current aspect rendered by the form.