[Home] [Table of Contents] [Previous Section] [Next Section]
Breck Carter
Last modified: October 21, 1999
mail to: bcarter@bcarter.com


Tip 90: UltraLite Lite


8 - Design the Palm User Interface

This section switches back and forth between two programs: the CodeWarrior IDE where a CodeWarrior project is created, and the Constructor where the application GUI is designed.

The end result will be a Constructor project or resource file, stored inside the CodeWarrior project. In a later section the C code will be added, but this section concentrates on creating the Palm user interface.

  1. If you haven't done so already, create a master directory (folder) to hold the database and other project files. This article is using c:\amisc\ull where "ull" stands for "UltraLite Lite".

  2. Use Start - Programs
    - Metrowerks CodeWarrior
    - CodeWarrior IDE
    .

  3. Choose File - New Project
    and highlight Palm OS - Palm OS C App.

  4. Uncheck Create Folder because you have already created the c:\amisc\ull master directory.

    CodeWarrior IDE - File - New Project

  5. Press OK to display the Name new project as dialog box,
    then type ULLDemo1 in the File name field and
    choose directory c:\amisc\ull.

  6. Select the following items, and delete them all with
    Project - Remove Selected Items:

    • Starter.c
    • Starter.rsrc
    • StartupCode.lib
    • Palm OS C App Readme.txt

    New CodeWarrior Project ULLDemo1.mcp

  7. Delete the following files; these files were created by CodeWarrior as a "template" or "starting point" when you chose File - New Project, and they aren't used in this article:
       c:\amisc\ull
          Palm OS C App Readme.txt
       c:\amisc\ull\Src
          Starter.c
          Starter.rsrc
          StarterRsc.c
          StarterRsc.h
       c:\amisc\ull\Resource.frk
          Starter.rsrc
    

  8. Use Start - Programs
    - Metrowerks CodeWarrior
    - Constructor for Palm OS
    .

  9. Choose File - New Project File,
    then File - Save.

  10. In the Save As dialog box
    type ULLDemo1 in the File name field
    and choose directory c:\amisc\ull\Src.

  11. Type ULLDemo1 in the Project Settings - Application Icon Name field
    and 0.0.1 the Version String field:

    New Constructor Project ULLDemo1.rsrc

  12. In the ULLDemo1.rsrc window, highlight the Forms bar
    and choose Edit - New Form Resource.

  13. Click on the form name and change it from untitled to ulldemo1.

    Warning! When you click on a field in the Constructor, you might have to wait for a split second before the field actually becomes editable.
  14. Double-click on the ulldemo1 form bar
    to display the Form 1000, "ulldemo1" window.

  15. Type ULLDemo1 in the Form Title and press Enter:

    New Constructor Form ULLDemo1 in ULLDemo1.rsrc

  16. Use Window - Catalog or Ctrl+Y to open the Catalog window:

    Constructor Catalog Window

  17. Drag a Button from the Catalog window
    to the Layout Appearance pane.

  18. Change the button's Object Identifier field
    from the default value Unnamed1001 to Exit.

  19. Change the button's Label field
    from the default value OK to Exit.

  20. Note that the form and the button are automatically assigned ID values like 1000 and 1001. These values are important to your program code but you don't have to remember them or code them as numbers.

    To see your form without the ID values, use Layout - Hide Object IDs:

    Exit Button on Constructor Form ULLDemo1

  21. Drag a Field from the Catalog window
    to the Layout Appearance pane.

  22. Resize the field to show several lines, and change the attributes as follows:
    Object Identifier: Hello
    Max Characters: 100

    Hello Field on Constructor Form ULLDemo1

  23. Save the Constructor project with File - Save, then have a look at the resulting source file ULLDemo1_res.h in c:\amisc\ull\Src:

    (This file will referenced as #include "ULLDemo1_res.h"
    in Section 9 - Write the C and ESQL Source Code.)

    Automatically Generated Constructor Header ULLDemo1_res.h

  24. Back in the ULLDemo1.mcp window in CodeWarrior,
    select AppResources and use Project - Add Files
    to add the Constructor resource file name:
       c:\amisc\ULLDemo\Src\ULLDemo1.rsrc
    

    Don't panic! If you can't see the resource file,
    it just means the Select files to add... window
    defaults to showing only source files.

    Change it to show All Files and ULLDemo1.rsrc will show up:

    CodeWarrior Project - Add Files - Show All Files

  25. At this point you have created two projects:

    • a Constructor project or resource file in c:\amisc\ull\Src\ULLDemo1.rsrc, and

    • a CodeWarrior project in c:\amisc\ull\ULLDemo1.mcp which contains the Constructor project:

    ULLDemo1.mcp with only ULLDemo1.rsrc


[Home] [Table of Contents] [Previous Section] [Next Section] [mail to: bcarter@bcarter.com]