//
//	Form definitions for the GPS waypoint editor, using PilRC
//
//	Paul Nash
//	paul@frcs.alt.za

//
//	$Header: /usr/home/pilot/gypsy-1.6/RCS/gps.rcp,v 1.47 1999/08/30 06:37:27 paul Exp $
//
//	$Log: gps.rcp,v $
//	Revision 1.47  1999/08/30 06:37:27  paul
//	changed version to 1.6
//
//	Revision 1.46  1999/06/13 17:26:13  paul
//	Changed lat & long edit to use N/S E/W list (button) input, rather
//	than text.  This allows the ':' separator to use ' ' or '-'.
//
//	Revision 1.45  1999/06/12 17:30:52  paul
//	Removed "track to GPS" from menu; confirm clear track log
//
//	Revision 1.44  1999/06/12 17:09:50  paul
//	Updated version info
//
//	Revision 1.43  1999/06/12 14:38:39  paul
//	changed track log to allow cumulative logging.  Not tested yet
//
//	Revision 1.42  1999/05/12 08:48:05  paul
//	Ready for release as Gypsy 1.4.  Major changes include:
//	*  Rudimentary track/route buffer to transfer data between GPS
//	   and PC (a'la gps2p2pc)
//	*  Protocol fix for DLE escaping bug
//	*  Code changes from <andre@drfmc.ceng.cea.fr> to be able to
//	   compile a PalmOS2 version
//	*  Garmin protocol tries a bit harder to recover from comms
//	   errors (but is still *very* dumb)
//
//


#include "gps.h"


//	Form listing off all known waypoints

FORM ID gpsWptListFrm AT (2 2 156 156)
USABLE
NOFRAME
MENUID menuList
BEGIN
	TITLE "Gypsy 1.6"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	TABLE wptTable AT (1 30 160 111) ROWS 10 COLUMNS 4 COLUMNWIDTHS 10 20 40 90

	BUTTON "Edit" ID gpsOkBtn AT (1 142 AUTO AUTO)
	BUTTON "New" ID gpsNewBtn AT (38 142 AUTO AUTO)
	BUTTON "Delete" ID gpsKillBtn AT (77 142 AUTO AUTO)
	BUTTON "Sort" ID gpsSortBtn AT (125 142 AUTO AUTO)
END


//	Edit a specific waypoint

FORM ID gpsWptEditFrm AT (2 2 156 156)
USABLE
NOFRAME
MENUID menuEdit
BEGIN
	TITLE "Edit Waypoint"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	FIELD  editName AT (60 40 40 15) EDITABLE SINGLELINE UNDERLINED MAXCHARS 6
	FIELD  editDescr AT (20 60 120 35) EDITABLE MULTIPLELINES UNDERLINED MAXCHARS 40
	FIELD  editLatitude AT (10 110 50 15) EDITABLE SINGLELINE UNDERLINED MAXCHARS 12
	FIELD  editLongitude AT (80 110 50 15) EDITABLE SINGLELINE UNDERLINED MAXCHARS 12

	LIST "N" "S" ID listNS AT (63 105 9 1) VISIBLEITEMS 2
	LIST "E" "W" ID listEW AT (133 105 9 1) VISIBLEITEMS 2
	
	BUTTON "Ok" ID gpsOkBtn AT (4 140 AUTO AUTO)
	BUTTON "Here" ID gpsHereBtn AT (33 140 AUTO AUTO)
	BUTTON "Delete" ID gpsKillBtn AT (69 140 AUTO AUTO)
	BUTTON "Cancel" ID gpsNokBtn AT (114 140 AUTO AUTO)
END


//	GPS transfer progress box

FORM ID garminHostFrm AT (5 5 150 150)
USABLE
FRAME
MODAL
BEGIN
	TITLE "Garmin host mode"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	FIELD hostAction AT (20 40 120 85) NONEDITABLE MULTIPLELINES 

	BUTTON "Cancel" ID gpsNokBtn AT (57 130 AUTO AUTO)
END


//	Open a different database

FORM ID gpsFileOpenFrm AT (2 2 156 156)
USABLE
FRAME
MODAL
BEGIN
	TITLE "Select database"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	TABLE fileTable AT (10 30 140 111) ROWS 10 COLUMNS 3 COLUMNWIDTHS 100 25 5
	BUTTON "Open" ID gpsOkBtn AT (5 142 AUTO AUTO)
	BUTTON "New" ID gpsNewBtn AT (61 142 AUTO AUTO)
	BUTTON "Cancel" ID gpsNokBtn AT (112 142 AUTO AUTO)
END


//	Merge a database

FORM ID gpsFileMergeFrm AT (2 2 156 156)
USABLE
FRAME
MODAL
BEGIN
	TITLE "Merge databases"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	TABLE fileTable AT (10 30 140 111) ROWS 10 COLUMNS 3 COLUMNWIDTHS 100 25 5
	BUTTON "Merge" ID gpsOkBtn AT (25 142 AUTO AUTO)
	BUTTON "Cancel" ID gpsNokBtn AT (92 142 AUTO AUTO)
END


//	Various utilities

FORM ID gpsFileUtilFrm AT (2 2 156 156)
USABLE
FRAME
MODAL
BEGIN
	TITLE "Waypoint database utilities"
	LABEL "Current DB:" ID dbNameLbl AT (1 15) FONT 1
	FIELD dbName AT (60 15 160 12) NONEDITABLE SINGLELINE FONT 1

	TABLE fileTable AT (10 30 140 111) ROWS 10 COLUMNS 3 COLUMNWIDTHS 100 25 5
	BUTTON "Open" ID gpsOkBtn AT (2 142 AUTO AUTO)
	BUTTON "New" ID gpsNewBtn AT (42 142 AUTO AUTO)
	BUTTON "Delete" ID gpsKillBtn AT (77 142 AUTO AUTO)
	BUTTON "Done" ID gpsNokBtn AT (121 142 AUTO AUTO)
END


//	Create new waypoint file

FORM ID gpsFileNewFrm AT (10 90 140 50)
USABLE
FRAME
MODAL
BEGIN
	TITLE "New database"
	FIELD  newFile AT (10 15 120 15) EDITABLE SINGLELINE UNDERLINED MAXCHARS 30
	BUTTON "Create" ID gpsOkBtn AT (10 30 AUTO AUTO)
	BUTTON "Cancel" ID gpsNokBtn AT (90 30 AUTO AUTO)
	GRAFFITISTATEINDICATOR AT (130 40)
END


// menus for list view

MENU ID menuList
BEGIN
      PULLDOWN "File"
      BEGIN
	MENUITEM "About" menuAbout
	MENUITEM "Current DB" menuDB
	MENUITEM SEPARATOR
	MENUITEM "New DB" menuNew "N"
      	MENUITEM "Open DB" menuOpen "O"
	MENUITEM "DB Utils" menuFileUtil
	MENUITEM "Merge DB" menuMerge 
      END
      PULLDOWN "Waypt"
      BEGIN
	MENUITEM "Flag all" menuFlag "S"
	MENUITEM "Unflag all" menuUnflag
	MENUITEM "Flag changed" menuFlagChanged
	MENUITEM "Toggle flags" menuToggleFlag
	MENUITEM "Clear changes" menuClearChanged
      	MENUITEM SEPARATOR
	MENUITEM "Sort" menuSort
      	MENUITEM SEPARATOR
	MENUITEM "Delete all" menuClrAll
	MENUITEM "Delete flagged" menuClrFlagged
	MENUITEM "Delete unflagged" menuClrUnflagged
      END
      PULLDOWN "Xfer"
      BEGIN
	MENUITEM "Fetch from GPS" menuFetch
	MENUITEM "Send ALL to GPS" menuSendAll
	MENUITEM "Send CHANGED ..." menuSendChanged
	MENUITEM "Send FLAGGED ..." menuSendFlagged
	MENUITEM SEPARATOR
	MENUITEM "Host mode" menuGarminHost
	MENUITEM SEPARATOR
        MENUITEM "Track from GPS" menuXferTrackIn
	MENUITEM "Clear track log" menuClearTrackLog
	MENUITEM SEPARATOR
        MENUITEM "Routes from GPS" menuXferRouteIn
        MENUITEM "Routes to GPS" menuXferRouteOut
      END
END

//	removed from "menuList" for now.
//      	MENUITEM SEPARATOR
//      PULLDOWN "Edit"
//      BEGIN
//      	MENUITEM "Copy Special" menuCopySpecial "C"
//	MENUITEM "Select All" menuSelectAll "A"
//	MENUITEM "Delete" menuDelete "D"
//      	MENUITEM SEPARATOR
//        MENUITEM "Track to GPS" menuXferTrackOut
//      END

//	... and menus for edit

MENU ID menuEdit
BEGIN
      PULLDOWN "File"
      BEGIN
	MENUITEM "About" menuAbout
	 MENUITEM "Current DB" menuDB
      END
      PULLDOWN "Edit"
      BEGIN
      	MENUITEM "Undo" menuUndo "U"
      	MENUITEM "Cut" menuCut "X"
      	MENUITEM "Copy" menuCopy "C"
      	MENUITEM "Paste" menuPaste "P"
      	MENUITEM SEPARATOR
	MENUITEM "Select All" menuSelectAll "A"
	MENUITEM "Delete" menuDelete "D"
      	MENUITEM SEPARATOR
      	MENUITEM "Keyboard" menuKbd "K"
      END
END

//	removed from "menuEdit" for now.
//      	MENUITEM "Paste Special" menuPasteSpecial
//      	MENUITEM "Copy Special" menuCopySpecial

//	default for most unimplemented events

ALERT gpsAlert1
INFORMATION
BEGIN
	TITLE "Whoops!"
	MESSAGE "I haven't implemented that yet"
	BUTTONS "Bummer"
END


//	... and errors

ALERT gpsError
BEGIN
	TITLE "Oh, Shit!"
	MESSAGE "This wasn't supposed to happen"
	BUTTONS "Bugger"
END


//	the about box, gets RCSID into "^1"

ALERT gpsAboutAlert
BEGIN
	TITLE "About ..."
	MESSAGE "Gypsy v 1.6\n"\
		"   by Paul Nash\n"\
		"   paul@frcs.alt.za\n\n"\
        	"^1"\
		"^2"
	BUTTONS "Way cool!"
END


//	what database am I editing?

ALERT whoAmI
BEGIN
	TITLE "Active database"
	MESSAGE "Current active database is \"^1\""
	BUTTONS "OK"
END


//	serial errors (very non-specific)

ALERT serialAlert
BEGIN
	TITLE "Serial error"
	MESSAGE "Communications error\n"\
		"^1"
	BUTTONS "Sigh"
END

ALERT gpsSerialAlert
BEGIN
	TITLE "Serial error"
	MESSAGE "Cannot open serial port\n"\
		"   edit mode only"
	BUTTONS "Sigh"
END


//	Warning before deleting database

ALERT fileDeleteAlert
BEGIN
	TITLE "Delete file?"
	MESSAGE "Really delete database \"^1\"?"
	BUTTONS "Delete" "Cancel"
END


//	Warning if no active database

ALERT noActiveDB
BEGIN
	TITLE "No active database"
	MESSAGE "You must select or create a database"
	BUTTONS "OK"
END


//	Generic debugging alert

ALERT gpsBreak1
BEGIN
	TITLE "Debug break 1"
	MESSAGE "vars \"^1\" \"^2\" \"^3\""
	BUTTONS "Proceed"
END


//	other stuff

ICON "gps.bmp"

VERSION 1 "1.6"
