diff options
author | Chris Apers | 2003-11-03 16:01:14 +0000 |
---|---|---|
committer | Chris Apers | 2003-11-03 16:01:14 +0000 |
commit | 14c2ae7e360bc091f3188a63e455ee85d4082f80 (patch) | |
tree | 3f220f2ae174afe1ac9ba05ac4c2653784677d6a /backends/PalmOS/Src/forms/formUtil.cpp | |
parent | be080cce0edcccae930ea96b3d0105adfb759c25 (diff) | |
download | scummvm-rg350-14c2ae7e360bc091f3188a63e455ee85d4082f80.tar.gz scummvm-rg350-14c2ae7e360bc091f3188a63e455ee85d4082f80.tar.bz2 scummvm-rg350-14c2ae7e360bc091f3188a63e455ee85d4082f80.zip |
One form in one source file
svn-id: r11095
Diffstat (limited to 'backends/PalmOS/Src/forms/formUtil.cpp')
-rw-r--r-- | backends/PalmOS/Src/forms/formUtil.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/backends/PalmOS/Src/forms/formUtil.cpp b/backends/PalmOS/Src/forms/formUtil.cpp new file mode 100644 index 0000000000..6d1d55e6e2 --- /dev/null +++ b/backends/PalmOS/Src/forms/formUtil.cpp @@ -0,0 +1,60 @@ +#include <PalmOS.h> +#include <TxtGlue.h> + +#include "forms.h" + +Char **itemsText = NULL; +void *itemsList = NULL; +Char itemsType = ITEM_TYPE_UNKNOWN; + +void FrmReturnToMain(UInt16 updateCode) { + // if there is a form loaded, prevent crash on OS5 + if (FrmGetFirstForm()) { + FrmUpdateForm(MainForm, updateCode); + FrmReturnToForm(MainForm); + } +} + +void FldTrimText(FieldPtr fldP) { + MemHandle tmpH; + Char *tmpP; + + tmpH = FldGetTextHandle(fldP); + FldSetTextHandle(fldP, NULL); + tmpP = (Char *)MemHandleLock(tmpH); + TxtGlueStripSpaces(tmpP, true, true); + MemHandleUnlock(tmpH); + FldSetTextHandle(fldP, tmpH); +} + +/*********************************************************************** + * + * FUNCTION: GetObjectPtr + * + * DESCRIPTION: This routine returns a pointer to an object in the current + * form. + * + * PARAMETERS: formId - id of the form to display + * + * RETURNED: void * + * + * REVISION HISTORY: + * + * + ***********************************************************************/ +void * GetObjectPtr(UInt16 objectID) { + FormPtr frmP; + + frmP = FrmGetActiveForm(); + return FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, objectID)); +} + +void FrmList(EventPtr eventP, UInt16 objectID) { + ListType *listP; + UInt16 listItem; + + listP = (ListType *)GetObjectPtr(objectID); + listItem = LstPopupList(listP); + CtlSetLabel(eventP->data.ctlSelect.pControl, LstGetSelectionText(listP, LstGetSelection(listP))); +} + |