Contents > PocketC Architect Basics

PocketC Architect Basics

| Introduction | An introduction to PocketC Architect.
| PocketC Architect Desktop | Using PocketC Architect Desktop Edition.
| PocketC Architect for Palm OS | Using PocketC Architect on the Palm OS.
| Creating an application | Creating applications, forms, and controls.
| OrbC resource langage | The syntax used to specify applications, forms, and controls.

Contents > PocketC Architect Basics > Introduction

Introduction

PocketC Architect is the evolution of PocketC. PocketC Architect is a programmer's tool with a powerful language and a rich, easy-to-use, object-oriented API. Applications written in PocketC Architect can be compiled on a Windows desktop or directly on a Palm OS device.

### Features

- Rapid application development
- Easy resource syntax for defining UI
- Automatic form resizing on supported devices
- Powerful, familiar C-like language
- Full support for objects, inheritance, and interfaces
- Debug language features (logging, asserts, debug-only code)
- Code completion and calltips in Windows editor
- Rich object-oriented APIs
- Support for native add-ins (custom functions and objects)

### Legacy PocketC Users

Users of PocketC 7.1 or earlier gain huge advantages by using PocketC Architect. Most of the features listed above were not available in PocketC, including the rich object-oriented API, the object-oriented language features, the resource syntax for defining forms, and a more productive, intelligent desktop editor.

### OrbForms Designer Users

Users of OrbForms Designer can compile their application with little or no modifications, because PocketC Architect uses the same OrbC compiler and runtime originally created for OrbForms. Using PocketC Architect allows an OrbForms Designer user to compile their application directly on a Palm device.

Contents > PocketC Architect Basics > PocketC Architect Desktop

PocketC Architect Desktop

PocketC Architect Desktop is a Windows-based editor and compiler for the OrbC language.

### Building a Project

Selecting Project | Build Project compiles the current project file using the settings in the Compile dialog and the properties in the `@app` resource. The first source file opened is considered to be the project file. To explicitly change the project file, select Project | Set Project File or right-click within a file and select Set as Project.

### Compile Dialog

The compile dialog gives you two options:

- Generate standalone application - Selecting this check box will create a standalone application - a .prc file which contains an embedded runtime and any required native add-ins. When developing an application, it is generally better not to create standalone applications, because using the debug version of OrbFormsRT-debug.prc will enable you to find bugs in your code more easily. When distributing an application, it is best to use standalone applications so that your users will only need to install one file. Legacy PocketC native libraries are not embedded in a standalone application. The demo version is not able to build standalone applications, so this checkbox will be disabled.
- Enable debug code- Selecting this checkbox enables all the features provided by the debug support.

### File Extensions

PocketC Architect uses three file extensions. The compiler and editor treats all files types the same, but their intent is as follows:

- OrbC Project File (.ocp) - An OrbC source file which is the primary project file. If other files are used in the project, they are included from this file. Generally the application resources are also defined in this file.
- OrbC Source File (.oc) - An OrbC source file other than the primary project file. It is convenient to use a separate .oc file for each form and gadget implementation in your application.
- PocketC Source File (.pc) - A legacy PocketC source file.

### QuickDocs

When you place the cursor on a function name, it displays the function declaration along with short documentation. The documentation for built-in functions is provided by the compiler. However, you can add documentation to your own functions very easily by adding an @doc directive before the function definition. For example:

    @doc "Create a new button";
    addButton(int x, int y, string name) { ... }

### Uploading to the Emulator or Simulator

The application's .prc will be automatically installed on the emulator or simulator if it is running. If the .prc file on the device is in use (i.e. the application is running), the file will not upload successfully. Select Options | Upload on Build to enable or disable this feature.

### Automatic Updates

PocketC Architect can automatically look for updates each time it is run. Select Options | Auto Update to enable or disable this feature. Checking for updates involves downloading a version info file from the OrbWorks server. No personally identifiable information is transfered.

### Compiling from the Command Line

To compile a project from the command line, you can use the included command line compiler, oc.exe.

`oc.exe -pocketc [-standalone] [-debug] project.ocp`

The -pocketc switch must always be used to provide PocketC compatibility. The remaining switches relate directly to the options specified in the Compile dialog when building from the editor.

Contents > PocketC Architect Basics > PocketC Architect for Palm OS

PocketC Architect for Palm OS

PocketC Architect is a PalmOS-based compiler for the OrbC language.

### Installing Source Code

Source code can be copied from your computer by running the Palm Desktop application, creating a new memo, and copying the source code to the new memo. PocketC architect also supports PDOC files, such as those created by Qed, SrcEdit, or TealDoc.

### Writing an Application

A PocketC Architect application can be written as a memo or a PDOC file. When using a memo, the first line of the source code must be a //-style comment which states the name of the file with a .ocp or .oc extension. If the source code is a doc file, it's name must end in .ocp or .oc in order to be displayed in the source code list.
Example: `"// Hello World.ocp"`.
You may also write source code on your computer, copy it to a memo (with the Palm Desktop software), and Hotsync.

### Compiling an Application

Select the source file that you would like to compile, and press the Compile button. The source code list displays all source files that end in .ocp or .orb (to make compiler OrbForms applications easy). If the Show classic PocketC checkbox is checked, all memo's that begin with // and all docs that end in .c or .pc will also be displayed in the list.

Selecting the Debug checkbox enables all the runtime features provided by the debug support.

Once an application is successfully compiled, return to the application launcher to run it. In the case of an error, an alert will popup to indicate the location and type of the first error, with an option to jump to the error location.

### Launching PocketC Architect from an Editor

If you are developing an editor, you can launch PocketC Architect to compile a given file. To do this, use the code snippet below to pass the name of the file (as it would be displayed in PocketC's source code list).

    #define sysAppLaunchCmdCompile (sysAppLaunchCmdCustomBase + 1)
    char* name = (char*)MemPtrNew(33);
    StrCopy(name, "NameOfFile");
    MemPtrSetOwner(name, 0); // so that the OS doesn't clean up when the app exits
    AppLaunchWithCommand('PCAr', sysAppLaunchCmdCompile, name);

This will launch PocketC Architect and begin compiling the file specified. If you would like PocketC Architect to also give you the results of the compile, use this code below:

    #define sysAppLaunchCmdCompileAndReturn (sysAppLaunchCmdCustomBase + 2)
    char* name = (char*)MemPtrNew(38); // room for file + creator id
    StrCopy(name, "NameOfFile,<id>");
    MemPtrSetOwner(name, 0); // so that the OS doesn't clean up when the app exits
    AppLaunchWithCommand('PCAr', sysAppLaunchCmdCompileAndReturn, name);

This will cause PocketC Architect to compile the specified file. After the compile, it will launch the app whose creator id is specified after the comma in the command line. In the snippet above, the creator id is "<id>". When the specified app is launched, it will be launched with the a launch code of 0x8001 and a parameter block which is a string containing the results. The results string is either "0" if the compile failed, or "1,<id>" if the compile succeeded. If it succeeded, "<id>" is the creator id of the application just compiled.

Calling the compiler in this way can also be done from an OrbC application using the launchCustomString() function. For example, to compile "file.ocp" from an application whose creator id is "Shll", use this code:

    launchCustomString("PCAr", 0x8002, "file.ocp,Shll");

Contents > PocketC Architect Basics > Creating an application

Creating an application

Creating an application with PocketC Architect is done by declaring the application properties, declaring the forms and controls, and implementing handlers for the events. This topic walks you through these steps to create a simple application.

### Define Application Properties

The first step in creating an application is to declare the app and set its properties. To do this, use the OrbC resource language, for example:

    @app myApp {
      creator = "MyAp"; // creator id
      name = "App Name"; // display name
      dbname = "AppName-MyAp"; // name of .prc database
    }

After declaring the application, you will need to implement at handler for the onstart event, discussed below.

### Create Forms

An application needs at least one form. The following is a simple form with a single button:

    @form myForm {
      id = 1000
      text = "My Form"
      x = 0, y = 0, w = 160, h = 160

      button myButton {
        id = 1001
        x = 60, y = 80, w = 40, h = 12
        text = "My Button"
      }
    }

The code above declares a form named `myForm`, containing a button named `myButton`. Both the form and the button use default values for all optional properties, e.g. a full screen non-modal form, a button with a standard frame and standard font. One thing you may notice is that both objects declared above have names and ids. Each id must be unique within the application, and must be less than 9000. Each name must also be unique.

The most interesting parts of the declaration above are the names of the objects. Declaring an app, form, or control actually creates a global variable by that name which can be referenced in code, and is used in implementing handlers.

### Implement Handlers

In order for an application to do anything, it must handle events. An event is handled by declaring an event handler, which is similar to a method - for complete details, see Event Handlers. All applications must implement the app handler onstart, which must load the main form:

    handler myApp.onstart() {
      myForm.load();
    }

To make the application more useful, implement handlers for the rest of the objects. For example, the following code will cause an alert to be displayed when the `myButton` is pressed:

    handler myButton.onselect() {
      alert("Button pressed");
    }

Contents > PocketC Architect Basics > OrbC resource langage

OrbC resource langage

The OrbC resource language allows you to easily specify any UI required for your application.

### General Syntax

OrbC resource language is embedded directly in OrbC source code. The @ symbol specifies the beginning of a resource block, followed by a single resource declaration (which can contain other declarations). For example, an app declaration could look like this:

    @app myApp {
      creator = "MyAp"; // creator id
      name = "App Name"; // display name
      dbname = "AppName-MyAp"; // name of .prc database
    }

A resource declaration contains a type specifying the resource type being declared. The above example declares an app resource - see the resource table below for all types. Following the type is a name, which can be treated as a global variable in source code. For the example above, a global variable of type UIApp named myApp is created automatically by the compiler. In functions that follow the declaration, you can use this variable to access app properties and methods:

    void func() {
      int colorDepth;
      // access myApp as a variable
      colorDepth = myApp.getdepth();
    }

Following the name is a block in braces which contains a list of properties (see tables below). The declaration above sets the creator property of the app to "MyAp". Each property is set using the assignment operator (property = value). Properties are separated with semicolons or commas.

This block my also contain other resource declarations. For example, a simple form is declared like this:

    @form myForm {
      id = 1000
      text = "My Form"
      x = 0, y = 0, w = 160, h = 160

      button myButton {
        id = 1001
        x = 60, y = 80, w = 40, h = 12
        text = "My Button"
      }
    }

As you can see, a resource of type "form" is declared named "myForm". Contained within the form is a button named "myButton". Notice that the child declaration does not begin is @, since this only appears on a top level declaration.

Most resources also have an id property. Each id must be unique within the application, and must be < 9000. The id property must be set on each resource that supports it.

Two controls have slightly different rules. First, the graffiti control has no name or id. This is because there can be at most one graffiti shift indicator per form, and they have no runtime properties:

    @form myForm {
      ...
      graffiti {
        x = 60, y = 80
      }
    }

Second, a gadget declaration must include the gadget type. For example, to declare a chart gadget such as the one discuss in Creating and Using Gadgets, use code like this. Note that you must declare the Chart type before declaring the resource that uses it.

    @form myForm {
      ...
      gadget Chart myChart {
        id = 1011
        x = 60, y = 80, w = 40, h = 40
      }
    }

The following resource types are root types and can be declared at the top-level: app, form, resstring, bitmap, and resource.

### Resizable Forms

Creating resizable forms is very easy. First declare your form with the resizable property set to true, then define the form's resize behavior by setting the hresize and vresize properties (generally use stretch for horizontal and vertical). Finally, set the resize behavior for each control on the form. For more details, see UIForm.

The following code declares a form which expands to the size of the screen. The two buttons on the form move as the form resizes to stay in the corners.

    @form myForm {
      id = 1000
      text = "My Form"
      x = 0, y = 0, w = 160, h = 160
      resizable = true, vresize = 2, hresize = 2

      button topLeftButton {
        id = 1001
        x = 60, y = 80, w = 40, h = 12
        hresize = 0, vresize = 0
        text = "My Button"
      }

      button myButton {
        id = 1001
        x = 60, y = 80, w = 40, h = 12
        hresize = 1, vresize = 1
        text = "My Button"
      }
    }

### Embedding Resources

In order to embed a resource such as a bitmap in your application, you must specify the source of the original bitmap(s). There are two ways to do this. You can either specify a series of BMP file (which only works on the desktop compiler):

    @bitmap bmpSplash {
      id = 4000;
      image1 = "splash1.bmp"; // b/w
      image8 = "splash8.bmp"; // 8-bit color
      imageh1 = "splashh1.bmp"; // b/w high
      imageh8 = "splashh8.bmp"; // 8-bit color high
    }

or you can import a resource that already exists in a PRC file:

    @bitmap bmpSplash {
      id = 4000;
      imageres = "MyResources,Tbmp,1000";
    }

The above declaration will import a resource of type 'Tbmp' and id '1000' from a resource database named "MyResources". When compiled on the desktop, the compiler will look for a file named "MyResources.prc". When compiled on the device, the compiler will use the resource database named "MyResources".

The resource string format `"<database>,<source type>,<source id>"` is used for all properties that import from a resource database, such as the smallres and largeres properties of an icon.

To embed a raw resource, such as a WAVE file, the same mechanism is used. The following block would import a WAVE resource from a Windows .wav file:

    @resource {
      type = "WAVE";
      id = 4002;
      file = "boink.wav";
    }

The following would import the same wave from an existing resource database:

    @resource {
      type = "WAVE";
      id = 4002;
      res = "MyResources,WAVE,1234";
    }

Finally, you can embed all the resources from a specified resource database using the following:

    @resource {
      res = "RawResources";
    }

### Resource Only Apps

To make it easier to compile applications on the device, it is possible to create a resource only .prc from which to import all your bitmaps and other resources. If you have both the desktop compiler and the Palm compiler and want to compile on both, it is a good idea to separate your code into two apps - one containing only resources, and one containing all the code. The resource app can be compiled on the desktop and copied to the device, where it can be used as the source for bitmaps and other resources when compiling the main application. Once compiled, only the main application is needed unless you want to compile again. See the Chess Clock sample included with PocketC Architect.

A resource only app is compiled as type 'data' rather than type 'appl', like other applications.

### Enumerated Properties

fontid | The following fonts are supported for most text-based controls: 0 = standard (height = 11) 1 = bold (height = 11) 2 = large (height = 14) 3 = symbol (height = 9) 4 = symbol 11 (height = 11) 5 = symbol 7 (height = 8) 6 = LED (height = 19) 7 = large bold (height = 15)
frame | The following frame types are supported for buttons and repeat buttons: 0 = none 1 = normal 2 = bold 3 = rectangle
hresize vresize | The following resize rules are supported for forms and controls: 0 = attach left or top 1 = attach right or bottom 2 = stretch

### Table of Resources

app (UIApp) | The application declaration. Each application must declare exactly one. An application can contain an optional icon, forms, bitmaps, resources, and resource strings.
creator | (4 char string) the creator id. Must be unique.
name | (string, max 32 chars) name as displayed in the app launcher
dbname | (string, max 32 chars) name of database (internal name of PRC file)
version | (string) optional version string
locked | (bool) specifies that the app cannot be beamed. Optional, default is false.
hidden | (bool) specifies that the app is not displayed in the app launcher. Optional, default is false.
resonly | (bool) specifies that this app contains only resource. Optional, default is false.
icon | The application's icon. The icon can be specified either as a series of BMP files (using e.g. small1), or as resources to import (e.g. smallres). If a resource is specified, the files will be ignored. An icon is optional, but if one is specified, small1 and large1 are required. When specifying smallres and largeres, the type of resource being imported will generally be 'tAIB' or 'Tbmp'. When importing a 'tAIB' (icon), the id of the large icon is generally 1000, and the small icon is generally 1001.
smallX | (string) file name of a BMP file for a small icon. X specifies the bit depth, and can be 1, 2, 4, 8, or 16. The bitmap must be 15x9 pixels.
smallhX | (string) file name of a BMP file for a high-density small icon. X specifies the bit depth, and can be 1, 2, 4, 8, or 16. The bitmap must be 30x18 pixels.
largeX | (string) file name of a BMP file for a large icon. X specifies the bit depth, and can be 1, 2, 4, 8, or 16. The bitmap must be 32x32 pixels.
largehX | (string) file name of a BMP file for a high-density large icon. X specifies the bit depth, and can be 1, 2, 4, 8, or 16. The bitmap must be 64x64 pixels.
smallres | (string) specifies the source of the small icon in "database,type,id" format.
largeres | (string) specifies the source of the large icon in "database,type,id" format.
form (UIForm) | A form declaration. A form may contain controls and menubars.
id | (int) unique id
x,y,w,h | (int) position and size. The form must fit within a 160x160 screen. See High Density Graphics for an explanation of how the OS handles higher resolution screens. Non-square screen are handled by the resize properties, as explained in the beginining of this topic.
text | (string) form title. Optional, if not specified the form will not have a title bar.
modal | (bool) specifies that the form is modal (such as a popup or dialog).
menuid | (int) id of form menu bar, ignored for modal forms. Optional.
helpid | (int) id of resstring displayed when a user clicks the "i" icon in a modal form title bar. Optional, ignored for non-modal forms.
defbuttonid | (int) id of default button for modal dialogs. The OS will simulate a click of this button if the app is being exited while the dialog is open. Only relevant if the application uses UIForm.dodialog to open the form.
resizable | (bool) specifies that the form and its controls will be moved/resized automatically. Optional, default is false.
hresize | (int) defines the horizontal resize rule. Ignored if the resizable property is false.
vresize | (int) defines the vertical resize rule. Ignored if the resizable property is false.
label (UILabel) | A label declaration.
id | (int) unique id
x,y | (int) position. The width and height are automatically calculated.
text | (string) text.
fontid | (int) font id. Optional, default is standard font.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
field (UIField) | A field declaration.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be 1 plus a multiple of the font height (e.g. 12, 23, 34 for standard font)
text | (string) initial text. Optional.
fontid | (int) font id. Optional, default is standard font.
editable | (bool) specifies that the field can be edited. Optional, default is true.
singleline | (bool) specifies that the field is a single line. Optional, default is true.
dynamicsize | (bool) specifies that the field has dynamic height. Optional, default is false.
numeric | (bool) specifies that the field accepts only numbers. Optional, default is false.
hasscroll | (bool) specifies that there is a scroll bar associated with this field. Optional, default is false.
autoshift | (bool) specifies that the field causes automatic graffiti state shifting. Optional, default is false.
underline | (bool) specifies that the field has an underline. Optional, default is true.
leftanchor | (bool) specifies that the field text is left aligned. Optional, default is true.
maxchars | (int) specifies the maximum number of chars in the field. Optional, default is unbounded.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
button (UIButton) | A standard button declaration.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be 1 plus the font height.
text | (string) text. Ignored if this is a graphic button.
fontid | (int) font id. Optional, default is standard font.
graphic | (bool) specifies that the button displays a graphic instead of text. The presence of a graphic button causes the application to require OS 3.5. Optional, default is false.
bitmapid | (int) bitmap id for a graphic button. Required for graphic button.
sbitmapid | (int) bitmap id for the selected state of a graphic button. Optional. If not specified for a graphic button, the selected state is drawn by inverting the normal state.
frame | (int) specifies the frame type. Optional, default is standard frame.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
pushbutton (UIPushButton) | A push button declaration. A push button is a button whose state is toggled when pressed. If a push button is a member of a group, selecting one push button deselects the rest.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be 1 plus the font height.
text | (string) text. Ignored if this is a graphic pushbutton.
fontid | (int) font id. Optional, default is standard font.
graphic | (bool) specifies that the button displays a graphic instead of text. The presence of a graphic button causes the application to require OS 3.5. Optional, default is false.
bitmapid | (int) bitmap id for a graphic button. Required for graphic button.
sbitmapid | (int) bitmap id for the selected state of a graphic button. Optional. If not specified for a graphic button, the selected state is drawn by inverting the normal state.
group | (int) group id. Optional, default is 0 (no group).
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
repeatbutton (UIRepeatButton) | A repeat button declaration. A repeat button is identical to a standard button except that it continues to raise onselect events while it is pressed.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be 1 plus the font height.
text | (string) text. Ignored if this is a graphic pushbutton.
fontid | (int) font id. Optional, default is standard font.
graphic | (bool) specifies that the button displays a graphic instead of text. Optional, default is false.
bitmapid | (int) bitmap id for a graphic button. Required for graphic button.
sbitmapid | (int) bitmap id for the selected state of a graphic button. Optional. If not specified for a graphic button, the selected state is drawn by inverting the normal state.
frame | (int) specifies the frame type. Optional, default is standard frame.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
checkbox (UICheckbox) | A checkbox declaration. If a checkbox is a member of a group, selecting one checkbox deselects the rest.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be the font height.
text | (string) text
fontid | (int) font id. Optional, default is standard font.
group | (int) group id. Optional, default is 0 (no group).
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
selector (UISelector) | A selector declaration. A selector is a text control that displays a value. When the selector is pressed, an editor should open to allow modification of the value. An example is a selector that displays a date; when pressed, a date selection dialog is opened.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be 1 plus the font height.
text | (string) text of current value.
fontid | (int) font id. Optional, default is standard font.
leftanchor | (bool) specifies that the control is left anchored. A selector is sized by the OS to the size of its contents. If leftanchor is true, the control's left edge is fixed. Optional, default is true.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
popup (UIPopup) | A popup declaration. A popup must have an associated list whose triggerid property is the id of the associated popup.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be the font height.
text | (string) text of current value.
fontid | (int) font id. Optional, default is standard font.
leftanchor | (bool) specifies that the control is left anchored. A popup is sized by the OS to the size of its contents. If leftanchor is true, the control's left edge is fixed. Optional, default is true.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
list (UIList) | A list declaration. If the triggerid property set, the list is only displayed when the associated popup is selected.
id | (int) unique id
x,y,w,h | (int) size and position. The height should be a multiple of the font height.
fontid | (int) font id. Optional, default is standard font.
triggerid | (int) id of the associated popup. Optional, default is a no associated popup.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
bitmap (UIFBitmap) | A bitmap control declaration. Displays a static bitmap.
id | (int) unique id
x,y | (int) position.
bitmapid | (int) id of the bitmap to display.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
graffiti | A graffiti shift indicator. There may only be one per form. This control has no name and no id.
x,y | (int) position.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
scroll (UIScroll) | A scroll bar declaration. Only vertical scroll bars are supported by the OS.
id | (int) unique id
x,y,w,h | (int) size and position. The width should be 7.
min | (int) minimum value. Optional, default is 0.
max | (int) maximum value. Optional, default is 99.
page | (int) page value. Optional, default is 20.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
slider (UISlider) | A slider declaration. Only horizontal sliders are supported by the OS. The presence of a slider on a form causes the application to require OS 3.5.
id | (int) unique id
x,y,w,h | (int) size and position. The height is generally 12.
graphic | (bool) specifies that custom bitmaps are used for the thumb and the background.
bitmapid | (int) bitmap id for thumb. Required for a graphic slider
sbitmapid | (int) bitmap id for background. Required for a graphic slider
min | (int) minimum value. Optional, default is 0.
max | (int) maximum value. Optional, default is 99.
page | (int) page value. Optional, default is 20.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
gadget (UIGadget) | A custom gadget declaration. Unlike other controls, a gadget declaration must include the name of a type which implements the gadget. See details above.
id | (int) unique id
x,y,w,h | (int) size and position.
hresize | (int) defines the horizontal resize rule. Ignored if parent form is not resizable.
vresize | (int) defines the vertical resize rule. Ignored if parent form is not resizable.
menubar | A menubar declaration. A menubar must be declared within a form declaration.
id | (int) unique id
menu | A menu declaration. This control has no name and no id, and must be declared within a menubar declaration.
text | (string) menu text.
menuitem (UIMenuItem) | A menu item declaration. A menu item must be declared within a menu declaration.
id | (int) unique id
sysid | (int) system menu id. If this menu should perform a system action (e.g. copy/paste), set this property to the system menu id. Optional, default is a non-system menu item.
text | (string) menu item text.
shortcut | (string) shortcut key. Optional.
resstring (UIString) | A resource string declaration.
id | (int) unique id
text | (string) text.
resource | A raw resource declaration. Specify either 1. file, type, and id (import a file as a resource - desktop only); 2. res, type, and id (import a single resource from a PRC); or 3. just res (import all resources from a PRC).
file | (string) name of file to import.
res | (string) specifies the source of the resource in "database" or "database,type,id" format.
type | (4 char string) type of resource
id | (int) resource id
bitmap (Bitmap) | A bitmap declaration. Specify either imageres, or a collection imageX and imagehX properties. When specifying imageres, the type of resource being imported will generally be "Tbmp".
id | (int) unique id
w,h | (int) size of standard density bitmap (high density bitmap must be twice as large).
imageX | (string) file name of a BMP file. X specifies the bit depth, and can be 1, 2, 4, 8, or 16.
imagehX | (string) file name of a BMP file. X specifies the bit depth, and can be 1, 2, 4, 8, or 16. Must be twice the size of imageX files.
imageres | (string) specifies the source of the bitmap in "database,type,id" format.