First Guide to SQL Anywhere Studio
PART 2. Getting Results with SQL Anywhere Studio
CHAPTER 7. Creating Forms with InfoMaker
Now you will add three buttons to the form. Later when you run the form, you can click the buttons to add and delete contacts.
About controls The controls you can use on a form are listed in the Controls menu and are represented by buttons in the PainterBar. To see the list of controls, click Controls on the menu bar. |
Select Controls(CommandButton from the menu bar.
Move the pointer to an empty area of the form and click.
If you need to move the button, drag it.
How to drag |
A button with the text none displays. The text none also displays in a text box in the StyleBar.
If the text box does not display |
Make sure the button is still selected.
Type Add a contact.
The text displays on the button as you type and in the text box in the StyleBar.
Click B (for bold) on the StyleBar.
The text displays in bold. Next you will make the button work. To do this you will associate an InfoMaker action with the button.
Using the StyleBar To use options on the StyleBar, you select a control with text and then click the appropriate button on the StyleBar. |
Move the pointer to the Add a contact button.
Press the right mouse button to display the popup menu for the button.
Select Action from the popup menu.
The Select Action dialog box displays. It lists the actions you can assign to the button.
About InfoMaker actions Whenever you associate an InfoMaker action with a button, InfoMaker creates the code to enable the button to perform the action. You do not see the code. All you have to do is select the action for the button. InfoMaker comes with predefined actions. PowerBuilder users at your site can create additional actions, which will also display in the Select Action dialog box. |
Scroll through the list of actions and double-click Insert_Row.
InfoMaker creates the code that enables your Add a contact button to display a blank form so you can add information for a new contact. You will see the button work later.
Now you will add two more buttons.
Select Controls(CommandButton from the menu bar.
Move the pointer below the Add a contact button and click.
Type Delete a contact.
Display the Delete a contact button's popup menu and select Action.
Select the action Delete_Row from the Select Action dialog box.
Click OK.
Select Controls(CommandButton from the menu bar.
Move the pointer below the Delete a contact button and click.
Type Save changes.
Display the Save changes button's popup menu and select Action.
Select the action Update_Row from the Select Action dialog box.
Click OK.
Now you have three buttons. InfoMaker has created the code that enables the buttons to work.