GPS4Palm

Source Code Documentation


DebugForm.c

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * $RCSfile: DebugForm_8c-source.html,v $
00004  *
00005  * GPS4Palm Debug Form
00006  *
00007  * This program is Copyright (C) 03/2003 Matthias Prinke
00008  * <matthias.prinke@surfeu.de> and covered by GNU's GPL.
00009  * In particular, this program is free software and comes WITHOUT
00010  * ANY WARRANTY.
00011  *
00012  * $Author: mp $
00013  *
00014  * $Date: 2007-10-08 20:40:32 $
00015  *
00016  * $Revision: 1.7.2.1 $
00017  *
00018  * $Log: DebugForm_8c-source.html,v $
00018  * Revision 1.7.2.1  2007-10-08 20:40:32  mp
00018  * updated for gps4palm V0.9.5 beta
00018  *
00019  * Revision 1.3  2004-11-24 21:06:58  mp
00020  * moved static function declarations from header to implementation file
00021  *
00022  * Revision 1.2  2004/11/23 17:54:23  mp
00023  * removed unused variable
00024  *
00025  * Revision 1.1  2003/10/15 19:14:26  mp
00026  * initial version
00027  *
00028  *
00029  *
00030  ****************************************************************************/
00031 #include <PalmOS.h>
00032 #include "ResourceDefines.h"
00033 #include "Serial.h"
00034 #include "DebugForm.h"
00035 #include "GPS.h"
00036 
00037 static void DebugFormInit(void);
00038 
00039 static 
00040 void DebugFormInit(void)
00041 {  
00042   gFormOpened = true;
00043 }
00044 
00045 
00046 Boolean DebugFormHandleEvent(EventPtr event)
00047 {
00048         Boolean         handled;
00049         Boolean         updatedDisplay;
00050 
00051         handled = false;
00052         switch (event->eType)
00053         {
00054         case menuEvent:
00055           switch (event->data.menu.itemID) {
00056       
00057             case PositionMenu:
00058               FrmGotoForm(GPSMainForm);
00059               handled = true;
00060               break;
00061 
00062             case SkyviewMenu:
00063               FrmGotoForm(SkyviewForm);
00064               handled = true;
00065               break;
00066 
00067             case NavigationMenu:
00068               FrmGotoForm(NavigationForm);
00069               handled = true;
00070               break;
00071 
00072             case MapMenu:
00073               FrmGotoForm(MapForm);
00074               handled = true;
00075               break;
00076 
00077           }
00078           break;
00079           
00080         case nilEvent:
00081                 handled = true;
00082                 DoReceiveFlush(gPortID, 1);     // throw away anything in the  
00083                                                 // buffer-- we want fresh data
00084                 
00085                 // we loop until an event occurs, or until
00086                 // we update the display
00087                 do {    
00088                   // TBD
00089                   updatedDisplay = ReadFromGPS();
00090                 } while (!updatedDisplay && !EvtSysEventAvail(false));
00091                 break;
00092         
00093         case frmOpenEvent:
00094                 DebugFormInit();
00095                 FrmDrawForm(FrmGetActiveForm());
00096 
00097                 handled = true;
00098                 break;
00099                 
00100         }
00101         return(handled);
00102 } // DebugFormHandleEvent()

Created: Mon, 08 Oct 2007 22:33:16 +0200
Copyright ©2004 M. Prinke