How to work with forms and controls
Creating a Form
To create a form:
Open the GUI Builder window.
Click on the New Form button on the toolbar.
Type a name for the form. You cannot name as follows:
- A number or underscores cannot be used at the beginning of the name.
- You cannot use the same form name as the project name you are editing. From the [New Form] dialog, you can optionally copy another form by selecting it from the [Copy from existing form] list.
Deleting a Form
To delete a form, right click on the form in the Forms Explorer, then select Delete. A confirmation message will be displayed. Click Yes to delete the form.
Also, you can use the following methods.
- Click on the [Delete Form] button on the tool bar
- Right click on the form tab, then select Delete.
- Right-click the form in the project explorer and select [Delete].
Opening and Closing Forms
Two ways to change the window size of a form:
- Double-click a form in the project explorer.
- Click a form in the form explorer.
To close a form, right click on the form in Forms Explorer and select Close, or right click on the form tab and select Close.
Zooming In and Out a Form
Two ways to adjust the display size of the form:
- After clicking anywhere in the GUI Builder window design area, move a scroll wheel of a mouse while holding down the [Ctrl] key.
- Click the following buttons on the status bar of the GUI Builder window.
Button | Description |
---|---|
+ | Zooming in the form. |
- | Zooming out the form. |
×1 | Makes the window the default size. |
Changing the Size of a Form
You can change the size of a form using two methods:
- Use the mouse to drag one of the form size handles in the GUI Builder window design area.
- Change the Height and Width properties in the Property Grid at design time or using GSet at runtime.
Editing Multiple Forms
The GUI Builder window allows you to work with multiple forms using a tab interface.
You can switch between currently open forms by clicking on the corresponding tab.
You can copy controls from one form and paste them in another form.
Creating Controls
To create a control
- Open the form to which you want to add a control.
- Click on the control button on the GUI Builder window toolbar.
A cross cursor will be displayed. - You can single click on the form near the location where you want the control and the control will be created with the default size.
Or, you can use the mouse to draw an outline of the control size on the form and release the mouse to create the control using the size of the outline.
Deleting Controls
To delete a control
- Open the form from which you want to delete one or more controls.
- Click on the control you want to delete.
To select more controls, hold down the Ctrl or Shift key and click on each additional control. - Press the Del key on the keyboard. The controls will be deleted.
Sizing and Moving Controls
To change the size of a control
Use the mouse to drag one of the control's size handles in the GUI Builder window design area.
Note
This Operation cannot be performed when multiple controls are selected.Change the Height and Width properties in the Property Grid at design time or using GSet at runtime.
While holding down the Ctrl key, click the arrow [↑/↓/←/→] in the direction you want to resize. If you want to increase the amount of resizing, hold down the Shift key in addition to the Ctrl key and click the arrows [↑/↓/←/→].
To move a control
- Click the control to activate it, then release the mouse. A move cursor is now displayed when the mouse is over the control. Click and drag the control to its new position.
- Change the Left and Top properties in the Property Grid at design time, or use GSet at runtime to change the Left and Top properties.
Copy, Cut, Paste for Controls
Selecting controls for copy or cut
First, click on one control. To select more controls, hold down the Ctrl or Shift key and click on each additional control. The selected controls are indicated by white (first control) and black size handles.
Copy selected controls
- To copy the selected controls, type Ctrl+C,
- or click the Copy button on the main toolbar,
- or select Copy from the Edit menu.
Cut selected controls
- To cut the selected controls, type Ctrl+X,
- or click the Cut button on the main toolbar,
- or select Cut from the Edit menu.
Pasting controls
- To paste controls that have been copied or cut, type Ctrl+V,
- or click the Paste button on the main toolbar,
- or select Paste from the Edit menu.
Editing Properties
To edit properties, first click on the form or control to display the associated properties in the Property Grid.
For properties that require text input
Click on the property to change in the Property Grid. Then type in the new value and press Enter or select another property row to apply the change.For properties that provide a dropdown list of values
Click on the property to change in the Property Grid. Click the down arrow button on the right side of the value. Select the new value from the dropdown list. The change is applied after you make the selection.For properties that provide a button for selecting values
Click on the property to change in the Property Grid. Click browse button on the right side of the value. Set the new value(s) from the dialog.
Working with Event Handlers
Event handlers are SPEL+ functions with the correct parameters for the specified event.
Event handler functions can be in any SPEL+ program file in the current project.
By default, event handlers are created in a program file that is created for a form. For example, when you create an event handler for a Button control Click event, a form program file is created first if it does not already exist, then the function is added to the file.
To create an event handler Three ways to create an event handler:
- Double click on the form or control to create the default event handler. For example, if you double click on a Button control, the Click event handler function is created.
- In the Events grid, double click on the event name.
- In the Events grid, select a function that already exists in the project in the value dropdown list for the event. Only functions with the correct parameters are shown in the list.
To change an event handler
You can change the event handler function by selecting another function in the event value dropdown list.
To disable an event handler
Sometimes after creating an event handler, you may decide that it is no longer needed.
To disable the event handler, select (None) in the event value dropdown list. The associated function is not deleted. But it will not be called when the event occurs.
Using EventTaskType
When an event occurs, the event handler function is started as a SPEL+ task.
The EventTaskType property lets you specify which type of task will be executed. This is important for events that need to execute in a pause condition or emergency stop condition.
For example, if a button click event handler will execute Pause or Cont, the EventTaskType must be set to 1 – NoPause. Or if an event handler must execute Reset during an emergency stop condition, then the EventTaskType must be set to 2 – NoEmgAbort.
Saving Your Work
After making changes in the GUI Builder window, you can save your work using three methods:
- Press Ctrl+S.
- From the File menu, select Save.
- Click the Project Save toolbar button on the Epson RC+ main toolbar.