Documentation  |   Table of Contents   |  < Previous   |  Next >   |  Index

10    Modifying the UI Color List

User Interface

Exploring Palm OS®

The UI color list contains the colors used by the various user interface elements. Each UI color is represented by a symbolic color constant. See Table 10.1 for a list of colors used.

Each bit depth has its own list of UI colors, allowing for a different color scheme in monochrome, grayscale, and color modes. This is important because even with a default monochrome look and feel, highlighted field text is black-on-yellow in color and white-on-black in other modes.

To obtain the color list, the system first tries to load it from the synchronized preferences database using the value sysResIDPrefUIColorTableBase plus the current screen depth. The use of a preference allows for the possibility that individual users could customize the look using a third party "personality" or "themes" editor. If the preference is not defined, it loads the default color table from the system color table resource, using the current screen depth to look up the appropriate table.

Using a list allows easy variation of the colors of UI elements to either personalize the overall color scheme of a given Palm Powered device or to adjust it within an application. Defining these as color classes ensures that the user interface elements are consistent with each other.

Table 10.1  UI elements and colors 

UI Object

Symbolic Colors Used

Forms

UIFormFrame, UIFormFill

Modal dialogs

UIDialogFrame, UIDialogFill

Alert dialogs

UIAlertFrame, UIAlertFill

Buttons (push button, repeating button, check boxes, and selector triggers)

UIObjectFrame, UIObjectFill, UIObjectForeground, UIObjectSelectedFill, UIObjectSelectedForeground

Fields

UIFieldBackground, UIFieldText, UIFieldTextLines, UIFieldTextHighlightBackground, UIFieldTextHighlightForeground

Menus

UIMenuFrame, UIMenuFill, UIMenuForeground, UIMenuSelectedFill, UIMenuSelectedForeground

Tables

Uses UIFieldBackground for the background, other colors controlled by the UI element in the table cell.

Lists and pop-up triggers

UIObjectFrame, UIObjectFill, UIObjectForeground, UIObjectSelectedFill, UIObjectSelectedForeground

Labels

Labels on a control and noneditable fields use UIObjectForeground, text written to a form using WinDrawChars() or WinPaintChars() uses the current text setting in the Window Manager draw state, text written to a form using GcDrawTextAt() uses the current color in the graphics context render state.

Scroll bars

UIObjectFill, UIObjectForeground, UIObjectSelectedFill, UIObjectSelectedForeground

Insertion point

UIFieldCaret

Front-end processor (currently only used on Japanese systems)

UIFieldFepRawText, UIFieldFepRawBackground, UIFieldFepConvertedText, UIFieldFepConvertedBackground, UIFieldFepUnderline

Should your application need to change the colors used by the UI color list, it can do so with UIColorSetTableEntry(). If you need to retrieve a color used, it can do so with UIColorGetTableEntryIndex() or UIColorGetTableEntryRGB().

If you change the UI color list, your changes are in effect only while your application is active. The UI color list is reset as soon as control switches to another application. When control switches back to your application, you'll have to call UIColorSetTableEntry() again.

Summary of UI Color Functions ^TOP^