# -*- coding: utf-8 -*-
#
# Copyright 2001-2003, Danger, Inc.  All Rights Reserved.
# This file is subject to the Danger, Inc. Sample Code License,
# which is provided in the file SAMPLE_CODE_LICENSE.
# Copies are also available from http://developer.danger.com/

package "com.danger.chessclock"
interface "{source}com/danger/chessclock/Resources.java"
events "{source}com/danger/chessclock/Events.java"

string ID_APP_NAME		"Chess Clock"
string ID_APP_CLASS		"com.danger.chessclock.ChessClock"

bitmap ID_SMALL_ICON		"{base}ID_SmallIcon.png"
bitmap ID_LARGE_ICON		"{base}ID_LargeIcon.png"
bitmap ID_SPLASH_SCREEN		"{base}ID_SplashScreen.png"

string ID_LOCALE		"en_US"

@ IF {os_version} == {1.1}
@ ELSE
splashScreen ID_SPLASH_SCREEN_RESOURCE
	image
		bitmap = ID_SPLASH_SCREEN
		alignWithParentLeft = 0
		alignWithParentTop = 0

	staticTextBox
		text = ID_APP_NAME
		alignWithParentLeft = 2
		alignWithParentTop = 0
		fillToRight = 2
		transparent
		doesNotHaveBorder
endSplashScreen
@ ENDIF

bitmap BITMAP_0		"{base}number-0.png"
bitmap BITMAP_1		"{base}number-1.png"
bitmap BITMAP_2		"{base}number-2.png"
bitmap BITMAP_3		"{base}number-3.png"
bitmap BITMAP_4		"{base}number-4.png"
bitmap BITMAP_5		"{base}number-5.png"
bitmap BITMAP_6		"{base}number-6.png"
bitmap BITMAP_7		"{base}number-7.png"
bitmap BITMAP_8		"{base}number-8.png"
bitmap BITMAP_9		"{base}number-9.png"
bitmap BITMAP_COLON		"{base}colon.png"
bitmap BITMAP_DASH		"{base}dash.png"

alert HINTS_WINDOW 
	title = "Chess Clock Hints"
	text = "The \"Configure\" dialog sets things up. \"Reset\" resets " +
		"everything to the selected configuration. \"Pause\" pauses " +
		"the currently running timer, and the two \"Switch\" menu " +
		"items start the indicated timer. The \"Jump/Back Switch\" " +
		"menu item makes the JUMP and BACK keys also switch timers " +
		"(instead of their usual functions)."
endAlert

menu MAIN_MENU

	menuItem
		title = "Hints…"
		event = CMD_HINTS
	menuItem
		title = "Configure"
		event = CMD_CONFIGURE
	menuItem
		title = "Jump/Back Switch"
		event = CMD_JUMP_BACK_SWITCH
		id = MI_JUMP_BACK_SWITCH
	divider
	menuItem
		shortcut = 'R'
		title = "Reset"
		event = CMD_RESET
	menuItem
		shortcut = ' '
		title = "Pause"
		event = CMD_PAUSE
		id = MI_PAUSE
	menuItem
		shortcut = '@'
		title = "Switch 1->2"
		event = CMD_SWITCH_1TO2
		id = MI_SWITCH_1TO2
	menuItem
		shortcut = '.'
		title = "Switch 2->1"
		event = CMD_SWITCH_2TO1
		id = MI_SWITCH_2TO1

endMenu

screen CLOCK_SCREEN
	title = "Chess Clock"
	actionMenu = MAIN_MENU
	className = "com.danger.chessclock.ClockWindow"

	staticText
		text = "Timer One"
		justifyCenter
		alignWithParentTop = 0
		alignWithParentLeft = 0
		fillToRight = 0
		font = "BortBold12"
		id = LABEL_1

	image
		bitmap = BITMAP_DASH
		alignWithParentLeft = 14
		id = NEG_1
		positionBelow = LABEL_1 : 5

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = HOURA_1
		positionToRight = NEG_1 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = HOURB_1
		positionToRight = HOURA_1 : 1

	image
		bitmap = BITMAP_COLON
		alignVertical = NEG_1
		id = COLONA_1
		positionToRight = HOURB_1 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = MINA_1
		positionToRight = COLONA_1 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = MINB_1
		positionToRight = MINA_1 : 1

	image
		bitmap = BITMAP_COLON
		alignVertical = NEG_1
		id = COLONB_1
		positionToRight = MINB_1 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = SECA_1
		positionToRight = COLONB_1 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_1
		id = SECB_1
		positionToRight = SECA_1 : 1

	staticText
		text = "Timer Two"
		justifyCenter
		alignWithParentLeft = 0
		fillToRight = 0
		font = "BortBold12"
		id = LABEL_2
		positionBelow = NEG_1 : 17

	image
		bitmap = BITMAP_DASH
		alignWithParentLeft = 14
		id = NEG_2
		positionBelow = LABEL_2 : 5

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = HOURA_2
		positionToRight = NEG_2 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = HOURB_2
		positionToRight = HOURA_2 : 1

	image
		bitmap = BITMAP_COLON
		alignVertical = NEG_2
		id = COLONA_2
		positionToRight = HOURB_2 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = MINA_2
		positionToRight = COLONA_2 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = MINB_2
		positionToRight = MINA_2 : 1

	image
		bitmap = BITMAP_COLON
		alignVertical = NEG_2
		id = COLONB_2
		positionToRight = MINB_2 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = SECA_2
		positionToRight = COLONB_2 : 1

	image
		bitmap = BITMAP_0
		alignVertical = NEG_2
		id = SECB_2
		positionToRight = SECA_2 : 1

endScreen
dialog CONFIGURE_DIALOG
	title = "Configure"
	widthPct = 100
	doneEvent = CONFIGURE_DONE
	doneIsDefault

	staticText
		text = "Initial time 1"
		justifyLeft
		alignWithParentTop = 0
		alignWithParentLeft = 0
		font = boldSysFont
		id = LABEL_TIME1

	numberEditor
		minValue = 0
		maxValue = 99
		alignVertical = LABEL_TIME1
		id = EDIT_HOURS1
		initialValue = 0
		positionToRight = LABEL_TIME1 : 2
		initialFocus

	staticText
		text = "hrs"
		justifyLeft
		alignWithParentTop = 0
		font = boldSysFont
		id = LABEL_HOURS1
		title = ""
		positionToRight = EDIT_HOURS1 : 2

	numberEditor
		minValue = 0
		maxValue = 59
		alignVertical = LABEL_TIME1
		id = EDIT_MINUTES1
		initialValue = 0
		positionToRight = LABEL_HOURS1 : 2

	staticText
		text = "mins"
		justifyLeft
		alignWithParentTop = 0
		font = boldSysFont
		id = LABEL_MINUTES1
		title = ""
		positionToRight = EDIT_MINUTES1 : 2

	numberEditor
		minValue = 0
		maxValue = 59
		alignVertical = LABEL_MINUTES1
		id = EDIT_SECONDS1
		initialValue = 0
		title = ""
		positionToRight = LABEL_MINUTES1 : 2

	staticText
		text = "secs"
		justifyLeft
		alignWithParentTop = 0
		font = boldSysFont
		positionToRight = EDIT_SECONDS1 : 2

	staticText
		text = "Initial time 2"
		justifyLeft
		alignWithParentLeft = 0
		font = boldSysFont
		id = LABEL_TIME2
		positionBelow = LABEL_TIME1 : 8

	numberEditor
		minValue = 0
		maxValue = 99
		alignVertical = LABEL_TIME2
		id = EDIT_HOURS2
		initialValue = 0
		positionToRight = LABEL_TIME2 : 2

	staticText
		text = "hrs"
		justifyLeft
		alignVertical = LABEL_TIME2
		font = boldSysFont
		id = LABEL_HOURS2
		title = ""
		positionToRight = EDIT_HOURS2 : 2

	numberEditor
		minValue = 0
		maxValue = 59
		alignVertical = LABEL_TIME2
		id = EDIT_MINUTES2
		initialValue = 0
		positionToRight = LABEL_HOURS2 : 2

	staticText
		text = "mins"
		justifyLeft
		alignVertical = LABEL_TIME2
		font = boldSysFont
		id = LABEL_MINUTES2
		title = ""
		positionToRight = EDIT_MINUTES2 : 2

	numberEditor
		minValue = 0
		maxValue = 59
		alignVertical = LABEL_TIME2
		id = EDIT_SECONDS2
		initialValue = 0
		title = ""
		positionToRight = LABEL_MINUTES2 : 2

	staticText
		text = "secs"
		justifyLeft
		alignVertical = LABEL_TIME2
		font = boldSysFont
		positionToRight = EDIT_SECONDS2 : 2

	checkBox
		alignWithParentLeft = 0
		id = CHECK_NEGATIVE
		title = "Time can become negative"
		positionBelow = LABEL_TIME2 : 8

	staticText
		text = "Expiration Tone"
		justifyLeft
		alignWithParentLeft = 0
		font = boldSysFont
		id = LABEL_EXPIRED
		positionBelow = CHECK_NEGATIVE : 8

	ringTonePicker
		alignVertical = LABEL_EXPIRED
		fillToRight = 0
		id = RING_TONE
		positionToRight = LABEL_EXPIRED : 2

endDialog
