Custom Instrument GUI - Editing Placed Objects on the Form
After an object has been placed on the form, there are a variety of ways in which its location, size, or appearance can be edited. These methods of editing generally fall into two categories – graphical editing, directly within the form, and editing performed using the associated attributes on the Properties panel.
Graphical Editing
When you click to select an object on the form, a number of editing handles will appear. To relocate the object, simply click on it, away from any editing handles, and drag to the required new position (Figure 1).
If the object can be resized – such as a Graph or Progress Bar – the cursor will change to a double-headed arrow when hovered over an editing handle. Using the applicable editing handle, you can simply click and drag to resize the object as required, in the vertical or horizontal (or both) planes (Figure 2).
In addition to these basic graphical editing features, there are also various commands available on the right-click context menu that apply to the currently selected object or objects (use Shift+click to select multiple objects).
- Align To Grid – use this command to align the selected object(s) to the form's grid.
- Bring To Front – use this command to bring the selected object to the front in terms of drawing order for a group of collocated objects.
- Send To Back – use this command to send the selected object to the back in terms of drawing order for a group of collocated objects.
- Align – use this command to access the Alignment dialog. This dialog is most useful when you want to align multiple selected objects on the form. For a single object, you can quickly center it in the vertical and/or horizontal planes.
- Size – use this command to access the Size dialog, from where you can quickly change the size of the selected object(s) in terms of width and/or height. Options are also provided to quickly resize all objects in a selection based on the width and/or height of either the smallest object in the selection, or the largest.
- Scale – use this command to access the Scale dialog, which is used to enlarge or reduce the selected object(s) based on the positive scaling factor entered. The default value of
100
equates to no change. If you want to halve the size, enter a value of50
. To double, enter a value of200
, and so on. The result is similar to resizing an object by using the bottom-right editing handle.
- Tab Order – use this command to access the Tab Order dialog. This dialog lists all those components and controls currently exist on the form, which can be used by the user to make something happen – such as an edit box or a clickable button. Use the dialog to determine the order in which these objects will be accessed on the run-time instrument panel when using the Tab key.
- Creation Order – use this command to access the Creation Order dialog. This dialog lists all non-visual components currently used on the form. Non-visual components are not seen by the user on the run-time instrument panel. The creation order becomes important where one non-visual component requires the existence of another non-visual component prior to executing its functionality. Use this dialog to determine that creation order as required.
Editing of Associated Properties
The main avenue used when defining the look and feel of a control on the form – especially when that control is being used to display the value of a monitored signal – is the Properties panel.
Simply select the object whose properties you wish to change in some way, and then edit the required attributes on the panel as required. The majority of properties are straight forward and intuitive (e.g. Font, Color, Width, etc). Bear in mind that the Properties panel will populate with only those properties applicable to the selected object type.
If multiple objects are selected, only those properties that are common to all objects will be displayed for editing on the Properties panel.
Figure 8 illustrates how changing properties can make a Gauge control appear differently on the form.