Palm OS Programming With Satellite Forms (cont.)
Tutorial
Now that you have some of the basics behind how Satellite Forms works, we'll develop an application that allows you to draw on the screen using the Ink Control and save the drawings in a database table. The first step is to open the App Designer and create a new application. A blank form is created.
Figure 3 - The new application
The next step is to add a table to the application to store our drawings. This table could later be accessed by a database on the desktop if you needed. The table can be created by selecting EDIT || Insert Table.
Figure 4 - New Table
You can create three fields in the table as follows: Index, Drawing and Name. When you create or edit the fields, you can select a variety of options. The index field is a numerical field that will keep a count of our drawings, the Drawing field is of type inkpad and will be used to store the drawing and the final field stores the name of the drawing and will be 50 character wide.
The next step is to create our GUI. On the default form that was created, place an ink control, an edit control and 2 buttons. The properties of the controls can be edited by double clicking on them. This will allow you to link the controls to their corresponding fields, create simple scripts and set other properties. If you double click on a control, a dialogue box similar to Figure 6, will appear. Depending on the object, the properties will be different.
The buttons need to have their scripts altered to read Goto previous record and Goto next Record. Before you can link a control to a table, you must set the default table for a particular form. Double click on the form and set its default table to Table1 (if you didn't change it). Now you can link the Ink control and the Edit control to the appropriate fields.
Figure 5 - Our GUI
Figure 6 - Properties
Download And Run
This program is ready to download and run. Select Download || App & Tables to download and run the program. Additional functionality needs to be added to make this a truly useful operation, but you can see how powerful Satellite Forms really is.
Next: Final Thoughts
|