\ VP-resources
\ Resource IDs
\ 
\ $Id: VP-resources.txt,v 1.4 2000/10/25 00:17:43 kris_johnson Exp $

\ Copyright 2000
\ Kristopher D. Johnson
\ 
\ See LICENSE-JacksOrBetter for the
\ conditions under which you may
\ use, redistribute, or modify this 
\ code, or create derived works.

needs ids
needs resources
docneeds VP-lib

.( VP-resources... )

\ Creator ID (registered with Palm)
: AppID   [id] VPkr ;

\ JacksOrBetterRsrc resource db
AppID (id) rsrc use-resources

\ Main form resource
2000 constant frmMain

\ Alert resources
2001 constant altConfirmNew
2002 constant altDebug
2003 constant altAbout
2004 constant altHelp
2005 constant altOSVersionError
2006 constant altStatistics
2007 constant altConfirmReset

\ Button indices for alerts
0 constant btnYes
1 constant btnNo
1 constant btnReset

\ Menu and Button IDs
3 constant cmdAbout
4 constant cmdDeal
5 constant cmdNew
6 constant cmdHelp
7 constant cmdExit
8 constant cmdStatistics

\ Label IDs
10 constant txtChips
11 constant txtTop
12 constant txtMiddle
13 constant txtBottom
14 constant txtClock

\ Five card buttons
100 constant MinHandButton
104 constant MaxHandButton

\ Return ID of the Nth card button
: HandButtonID ( n -- id )
  MinHandButton + ;

\ Return true if given number is
\ the ID of a card button
: HandButtonID? ( id -- f )
  MinHandButton MaxHandButton
  1+ within 
;

\ Return index (0-4) of given
\ card button
: HandButtonID>index ( id -- n )
  MinHandButton - ;

\ Five check boxes
200 constant MinHoldCheckID
204 constant MaxHoldCheckID

: HoldCheckIDBounds ( -- max+1 min )
  [ MaxHoldCheckID 1+ ] literal
  MinHoldCheckID
;

\ Return ID of the Nth card checkbox
: HoldCheckID ( n -- id )
  MinHoldCheckID + ;

\ Return true if given number is
\ the ID of a card checkbox
: HoldCheckID? ( id -- f )
  MinHoldCheckID MaxHoldCheckID
  1+ within
;

\ Return index (0-4) of given
\ card checkbox
: HoldCheckID>index ( id -- n )
  MinHoldCheckID - ;

