API Guide Home
(Online version only)

PmSysGadgetLib.h File Reference


Detailed Description

System Library that exports status-related APIs.

Version:
1.0
This library is based on status gadgets APIs from HsExtensions and was broken apart from HsExtensions so the APIs could be ported to other platforms.

Definition in file PmSysGadgetLib.h.

Include dependency graph for PmSysGadgetLib.h:

Go to the source code of this file.

Functions


Function Documentation

void PmSysGadgetBbutHitBigButton ( UInt16  refNum,
FormType *  frmP,
UInt16  gadgetIndex 
)

Like CtlHitControl, but for big buttons.

Notes: Due to the fact that PalmOS lacks accessors for gadgets directly, this function (and any others that refer to a big button's gadget) takes a form pointer and an index instead of a FormGadgetType*.

Parameters:
frmP,: IN: The form containing the big button's gadget.
gadgetIndex,: IN: The index of the big button's gadget.
Return values:
None. 

Err PmSysGadgetBbutInstallFromResource ( UInt16  refNum,
FormType *  frmP 
)

Installs big buttons on the given form based on a 'bBut' resource with the same ID. A 'bBut' resource is basically just an array of HsBigButtonMappingType.

Once installed, the gadget will get events from PalmOS and will sent a 'gadgetMisc' event with the selector bbutGadgetMiscSelectSelector when selected.

IMPORTANT: The form must not be visible when you install the buttons, since we don't draw them (it turns out to be impossible to check whether the gadget is visible without peeking into its data structure, which we can only do from the event handler).

Parameters:
refNum,: IN: Library reference number
frmP,: IN: The form to install the big buttons on.
Return values:
Err Error code.

void PmSysGadgetBbutInstallNewButton ( UInt16  refNum,
FormType *  frmP,
UInt16  gadgetID,
const Char textP,
FontID  font,
UInt8  flags 
)

Set big button on a form.

Parameters:
refNum,: IN: Library reference number
frmP,: IN: The form to set the big button's gadget on.
gadgetID,: IN: The ID of the big button's gadget.
textP,: IN: Pointer to string to set on the gadget.
font,: IN: Font ID to be used for the text.
flags,: IN: Flags associated to the gadget.
Return values:
None. 

void PmSysGadgetBbutSetBitmap ( UInt16  refNum,
FormType *  frmP,
UInt16  gadgetID,
const BitmapPtr  bitmapP 
)

Set bitmap image on a big button gadget.

Parameters:
refNum,: IN: Library reference number
frmP,: IN: The form containing the big button's gadget.
gadgetID,: IN: The ID of the big button's gadget.
bitmapP,: IN: Pointer to the bitmap to set on the gadget.
Return values:
None. 

void PmSysGadgetBbutSetLabel ( UInt16  refNum,
FormType *  frmP,
UInt16  gadgetID,
const Char newLabel 
)

Set label on a big button gadget.

Parameters:
refNum,: IN: Library reference number
frmP,: IN: The form containing the big button's gadget.
gadgetID,: IN: The ID of the big button's gadget.
newLabel,: IN: Pointer to label string to set on the gadget.
Return values:
None. 

Err PmSysGadgetLibClose ( UInt16  refNum  ) 

Standard library close routine.

Parameters:
refNum,: IN: Library reference number
Return values:
Err Error Code

Err PmSysGadgetLibOpen ( UInt16  refNum  ) 

Standard library open routine.

Parameters:
refNum,: IN: Library reference number
Return values:
Err Error Code

void PmSysGadgetStatusGadgetsUpdate ( UInt16  refNum  ) 

Explicitly update all status gadgets on the current form.

Parameters:
refNum,: IN: Library reference number
Return values:
Nothing 

Err PmSysGadgetStatusGadgetTypeSet ( UInt16  refNum,
void *  frmP,
UInt16  gadgetID,
UInt16type   
)

Tell the system that a gadget on the form is a certain type of status gadget so that the system can properly draw and update it.

Tell the system that a gadget on the form is a certain type of status gadget so that the system can properly draw and update it. A form can only have one gadget for each status type. If more than one gadget is set to a certain type, only the last one set will be recorded. This function can also be used to erase and release a gadget whose type has already been set. To do this, type should be set to 0.

Parameters:
refNum,: IN: Library reference number
frmP,: IN: Form to draw gadget on
gadgetID,: IN: Gadget resource ID
type,: IN: Gadget type (battery, signal, bluetooth, etc)
Return values:
Err Error code


Top Palm Developer Network
© 2004-2008, Palm, Inc. All rights reserved.
Generated on Fri Jun 13 10:08:02 2008 for Palm API Guide