diff options
author | Chris Apers | 2004-12-20 16:59:43 +0000 |
---|---|---|
committer | Chris Apers | 2004-12-20 16:59:43 +0000 |
commit | 1184e19657ce740a22cf85c242d249580679f4ce (patch) | |
tree | d50298dd671238c9a19467eb1a095d9810baa6c9 /backends/PalmOS/Src | |
parent | 099f5de891917f433f5cdf4304bb68a9a7f479db (diff) | |
download | scummvm-rg350-1184e19657ce740a22cf85c242d249580679f4ce.tar.gz scummvm-rg350-1184e19657ce740a22cf85c242d249580679f4ce.tar.bz2 scummvm-rg350-1184e19657ce740a22cf85c242d249580679f4ce.zip |
Use a draw function instead of a preinit one
svn-id: r16166
Diffstat (limited to 'backends/PalmOS/Src')
-rw-r--r-- | backends/PalmOS/Src/forms/formtabs.cpp | 12 | ||||
-rw-r--r-- | backends/PalmOS/Src/forms/formtabs.h | 9 |
2 files changed, 12 insertions, 9 deletions
diff --git a/backends/PalmOS/Src/forms/formtabs.cpp b/backends/PalmOS/Src/forms/formtabs.cpp index d862c9a8bb..9c62f37542 100644 --- a/backends/PalmOS/Src/forms/formtabs.cpp +++ b/backends/PalmOS/Src/forms/formtabs.cpp @@ -26,7 +26,7 @@ void TabDeleteTabs(TabType *tabP) { delete tabP; } -Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscID, TabProc *preInit) { +Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscID, TabProc *drawFunc) { FormType *srcP; UInt16 cnt; void *objP, **dstP; @@ -38,10 +38,6 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI dstP = (void **)frmP; srcP = FrmInitForm(rscID); - if (preInit) { - preInit(srcP); - } - objNum = FrmGetNumberOfObjects(srcP); // save tab data @@ -52,6 +48,7 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI tabP->tabs[tabP->count].srcP = srcP; tabP->tabs[tabP->count].first = FrmGetObjectId(srcP, 0); tabP->tabs[tabP->count].last = FrmGetObjectId(srcP, objNum - 1); + tabP->tabs[tabP->count].drawFunc= drawFunc; tabP->count++; tabP->active = tabP->count; @@ -169,6 +166,8 @@ void TabSetActive(FormType *frmP, TabType *tabP, UInt16 num) { WinSetForeColor(UIColorGetTableEntryIndex(UIFormFill)); WinDrawLine(1, 14, 154,14); WinDrawLine(1, 15, 154,15); + RctSetRectangle(&r, 1, 30, 154, 100); + WinDrawRectangle(&r, 0); WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame)); WinDrawLine(1, 28, 154,28); @@ -199,6 +198,9 @@ void TabSetActive(FormType *frmP, TabType *tabP, UInt16 num) { } // show objects + if (dataP->drawFunc) + (dataP->drawFunc)(); + for (cnt = dataP->first; cnt <= dataP->last; cnt++) { if ((idx = FrmGetObjectIndex(frmP, cnt)) != frmInvalidObjectId) FrmShowObject(frmP, idx); diff --git a/backends/PalmOS/Src/forms/formtabs.h b/backends/PalmOS/Src/forms/formtabs.h index a3602f3d98..c92d13581a 100644 --- a/backends/PalmOS/Src/forms/formtabs.h +++ b/backends/PalmOS/Src/forms/formtabs.h @@ -1,10 +1,13 @@ #ifndef __FORMTABS_H__ #define __FORMTABS_H__ +typedef void (TabProc)(); + typedef struct { FormPtr srcP; UInt16 first; UInt16 last; + TabProc *drawFunc; } TabDataType, *TabDataPtr; typedef struct { @@ -13,11 +16,9 @@ typedef struct { TabDataPtr tabs; } TabType, *TabPtr; -typedef void (TabProc)(FormType *); - TabType *TabNewTabs (UInt16 cnt); void TabDeleteTabs (TabType *tabP); -Err TabAddContent (FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscID, TabProc *preInit = 0); +Err TabAddContent (FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscID, TabProc *drawFunc = 0); void TabSetActive (FormType *frmP, TabType *tabP, UInt16 num); -#endif
\ No newline at end of file +#endif |