[Trainsched-commit] trainsched trainsched.c, 1.25.2.2, 1.25.2.3 trainsched.h, 1.11.2.1, 1.11.2.2 tr
Brought to you by:
philm
|
From: Steve M. <sma...@us...> - 2009-05-11 19:53:40
|
Update of /cvsroot/trainsched/trainsched In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15245 Modified Files: Tag: PDB_VER2 trainsched.c trainsched.h trainsched.rcp Log Message: Fix overwrite issue on Form Title when timetable name changed. Use String resources for Popup Selections when no value selected. Index: trainsched.h =================================================================== RCS file: /cvsroot/trainsched/trainsched/trainsched.h,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** trainsched.h 2 May 2009 16:21:08 -0000 1.11.2.1 --- trainsched.h 11 May 2009 19:53:30 -0000 1.11.2.2 *************** *** 75,78 **** --- 75,83 ---- #define NOT_IMPL 1304 + /* String Resources */ + #define fromPopup 9901 + #define toPopup 9902 + #define dayPopup 9903 + /* Constants */ #define SHOWMAX 10 Index: trainsched.c =================================================================== RCS file: /cvsroot/trainsched/trainsched/trainsched.c,v retrieving revision 1.25.2.2 retrieving revision 1.25.2.3 diff -C2 -d -r1.25.2.2 -r1.25.2.3 *** trainsched.c 4 May 2009 17:28:36 -0000 1.25.2.2 --- trainsched.c 11 May 2009 19:53:30 -0000 1.25.2.3 *************** *** 18,21 **** --- 18,22 ---- */ #include <PalmOS.h> + #include <TxtGlue.h> #include "trainsched.h" *************** *** 56,59 **** --- 57,63 ---- UInt8 Day = NOSELECTION; UInt32 RomVersion; + static char FromPopup[16]={0}; + static char ToPopup[16]={0}; + static char DayPopup[16]={0}; Boolean bUse3Cols = false; /* Whether to use Annotation column. */ *************** *** 439,442 **** --- 443,448 ---- void LoadMainForm(FormPtr pForm) { + MemHandle resH; + char *resP; ListPtr popupDays,popupToStations,popupFromStations; *************** *** 456,462 **** } else { // No current selection, so display prompt. CtlSetLabel(FrmGetObjectPtr(pForm, FrmGetObjectIndex( pForm, resFromTrigger )), ! "Depart"); } --- 462,477 ---- } else { // No current selection, so display prompt. + resH = DmGetResource(strRsc, fromPopup); + if (resH) { + resP = MemHandleLock(resH); + if (resP) { + StrCopy(FromPopup, resP); + MemHandleUnlock(resH); + } + DmReleaseResource(resH); + } CtlSetLabel(FrmGetObjectPtr(pForm, FrmGetObjectIndex( pForm, resFromTrigger )), ! FromPopup); } *************** *** 469,475 **** } else { // No current selection, so display prompt. CtlSetLabel(FrmGetObjectPtr( pForm, FrmGetObjectIndex( pForm, resToTrigger )), ! "Arrive"); } --- 484,499 ---- } else { // No current selection, so display prompt. + resH = DmGetResource(strRsc, toPopup); + if (resH) { + resP = MemHandleLock(resH); + if (resP) { + StrCopy(ToPopup, resP); + MemHandleUnlock(resH); + } + DmReleaseResource(resH); + } CtlSetLabel(FrmGetObjectPtr( pForm, FrmGetObjectIndex( pForm, resToTrigger )), ! ToPopup); } *************** *** 485,491 **** } else { // No current selection, so display prompt. CtlSetLabel(FrmGetObjectPtr( pForm, FrmGetObjectIndex(pForm, resDayTrigger)), ! "Day"); } } --- 509,524 ---- } else { // No current selection, so display prompt. + resH = DmGetResource(strRsc, dayPopup); + if (resH) { + resP = MemHandleLock(resH); + if (resP) { + StrCopy(DayPopup, resP); + MemHandleUnlock(resH); + } + DmReleaseResource(resH); + } CtlSetLabel(FrmGetObjectPtr( pForm, FrmGetObjectIndex(pForm, resDayTrigger)), ! DayPopup); } } *************** *** 796,799 **** --- 829,833 ---- void SetFormLabel(FormPtr pForm) { + RectangleType clearTC, curBounds; UInt32 seconds=0; DateTimePtr dateTimeP; *************** *** 801,807 **** --- 835,850 ---- char *asctime; + // Clear the previous form name. MemSet(FormTitle, 32, 0); if (pForm==NULL) return; + // Clear the previous displayed title (PalmOS doesn't seem to do this properly). + WinPushDrawState(); + WinGetBounds(FrmGetWindowHandle(pForm), &curBounds); + RctSetRectangle(&clearTC, 0, 0, curBounds.extent.x, 13); + WinSetForeColor(UIColorGetTableEntryIndex(UIFormFrame)); + WinDrawRectangle(&clearTC, 0); + WinPopDrawState(); + seconds = TimGetSeconds(); dateTimeP = MemPtrNew(sizeof(DateTimeType)); Index: trainsched.rcp =================================================================== RCS file: /cvsroot/trainsched/trainsched/trainsched.rcp,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -C2 -d -r1.15.2.1 -r1.15.2.2 *** trainsched.rcp 2 May 2009 16:21:08 -0000 1.15.2.1 --- trainsched.rcp 11 May 2009 19:53:30 -0000 1.15.2.2 *************** *** 30,33 **** --- 30,38 ---- BITMAP aboutBitmap "trainsched.bmp" COMPRESS + /* Strings */ + STRING ID fromPopup "From" + STRING ID toPopup "To" + STRING ID dayPopup "Day" + /* Main Form */ FORM ID resFormMain AT ( 0 0 160 160 ) |