|
API Guide Home (Online version only) |
![]() |
00001 /****************************************************************************** 00002 * Copyright (c) 2004 palmOne, Inc. or its subsidiaries. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /** 00006 * 00007 * @ingroup SystemDef 00008 * 00009 */ 00010 00011 /** 00012 * @file HsExtUtilBigButton.h 00013 * @version 3.0 00014 * @date 12/18/2001 00015 * 00016 * Description: 00017 * This file contains routines for managing 'big' buttons, 00018 * which are thumbable buttons with a bitmap and some text 00019 * (common in applications designed to be used for telephony) 00020 * 00021 * 00022 * History: 00023 * 2001-12-18 dia Creaded by Doug Anderson 00024 * 2002-01-22 dia Supports \r or \n as line endings now. 00025 * Note that '\r\n' is not supported (it's 00026 * treated as two separate line endings) 00027 * 00028 */ 00029 00030 00031 #ifndef _HS_EXT_UTIL_BIG_BUTTON_H 00032 #define _HS_EXT_UTIL_BIG_BUTTON_H 00033 00034 00035 // Here's a sample usage: 00036 // HEX "bBut" rscBigYesNoDialogFormID 00037 // hsBigButtonMappingVersion0.w // version 00038 // 00039 // hsBigButtonFlagNone // flags 00040 // hsBigButtonFontStd // font 00041 // rscBigYesNoDialogYesButtonID.w // gadgetID 00042 // hsBigButtonGreenCheckBitmapID.w // bitmapID 00043 // hsBigButtonYesStringID.w // stringID 00044 // 00045 // hsBigButtonFlagNone // flags 00046 // hsBigButtonFontStd // font 00047 // rscBigYesNoDialogNoButtonID.w // gadgetID 00048 // hsBigButtonRedXBitmapID.w // bitmapID 00049 // hsBigButtonNoStringID.w // stringID 00050 00051 00052 /*************************************************************** 00053 * Function: HsUtilBbutInstallFromResource 00054 * 00055 * Summary: 00056 * Installs big buttons on the given form based on a 'bBut' 00057 * resource with the same ID. A 'bBut' resource is basically 00058 * just an array of HsBigButtonMappingType. 00059 * 00060 * Once installed, the gadget will get events from PalmOS and 00061 * will sent a 'gadgetMisc' event with the selector 00062 * bbutGadgetMiscSelectSelector when selected. 00063 * 00064 * IMPORTANT: 00065 * + The form must not be visible when you install the buttons, 00066 * since we don't draw them (it turns out to be impossible to 00067 * check whether the gadget is visible without peeking 00068 * into its data structure, which we can only do from the 00069 * event handler). 00070 * 00071 * Parameters: 00072 * frmP IN The form to install the big buttons on. 00073 * 00074 * Returns: 00075 * nothing 00076 * 00077 * Called By: 00078 * user 00079 * 00080 * History: 00081 * 2001-12-17 dia Created based on PhoneApp's CustomButton 00082 * 2001-12-19 dia Renamed, adding 'FromResource' just in 00083 * case we add more install functions (and 00084 * because I changed the resource slightly) 00085 * 00086 ****************************************************************/ 00087 00088 00089 /** 00090 * @brief 00091 * 00092 * @param frmP: IN: 00093 * @retval Error code. 00094 **/ 00095 Err 00096 HsUtilBbutInstallFromResource (FormType* frmP) 00097 SYS_SEL_TRAP (sysTrapHsSelector, hsSelUtilBbutInstallFromResource); 00098 00099 /** 00100 * @brief 00101 * 00102 * @param frmP: IN: 00103 * @param gadgetID: IN: 00104 * @param textP: IN: 00105 * @param font: IN: 00106 * @param flags: IN: 00107 * @retval Error code. 00108 **/ 00109 void 00110 HsUtilBbutInstallNewButton (FormType* frmP, UInt16 gadgetID, const Char* textP, FontID font, UInt8 flags) 00111 SYS_SEL_TRAP (sysTrapHsSelector, hsSelUtilBbutInstallNewButton); 00112 /** 00113 * @brief 00114 * 00115 * @param frmP: IN: 00116 * @param gadgetID: IN: 00117 * @param newLabel: IN: 00118 * @retval Error code. 00119 **/ 00120 void 00121 HsUtilBbutSetLabel (FormType* frmP, UInt16 gadgetID, const Char* newLabel) 00122 SYS_SEL_TRAP (sysTrapHsSelector, hsSelUtilBbutSetLabel); 00123 00124 00125 /** 00126 * @brief 00127 * 00128 * @param frmP: IN: 00129 * @param gadgetID: IN: 00130 * @param bitmapP: IN: 00131 * @retval Error code. 00132 **/ 00133 void 00134 HsUtilBbutSetBitmap (FormType* frmP, UInt16 gadgetID, const BitmapPtr bitmapP) 00135 SYS_SEL_TRAP (sysTrapHsSelector, hsSelUtilBbutSetBitmap); 00136 00137 /*************************************************************** 00138 * Function: HsUtilBbutHitBigButton 00139 * 00140 * Summary: 00141 * Like CtlHitControl, but for big buttons. 00142 * 00143 * Notes: 00144 * + Due to the fact that PalmOS lacks accessors for 00145 * gadgets directly, this function (and any others that 00146 * refer to a big button's gadget) takes a form pointer 00147 * and an index instead of a FormGadgetType*. 00148 * 00149 * Parameters: 00150 * frmP IN The form containing the big button's 00151 * gadget. 00152 * gadgetIndex IN The index of the big button's gadget. 00153 * 00154 * Returns: 00155 * nothing 00156 * 00157 * Called By: 00158 * user 00159 * 00160 * History: 00161 * 2001-12-19 dia Created. 00162 * 00163 ****************************************************************/ 00164 00165 /** 00166 * @brief 00167 * 00168 * @param frmP: IN: 00169 * @param gadgetIndex: IN: 00170 * @retval Error code. 00171 **/ 00172 void 00173 HsUtilBbutHitBigButton (FormType* frmP, UInt16 gadgetIndex) 00174 SYS_SEL_TRAP (sysTrapHsSelector, hsSelUtilBbutHitBigButton); 00175 00176 00177 00178 00179 #endif // _HS_EXT_UTIL_BIG_BUTTON_H
| Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:53 2008 for Palm API Guide |