# -*- 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/


#---------------------------------------------------------------------
# This resource file is incomplete for a standard Danger Application,
# because this sample program's purpose is to demonstrate how to use the
# DataStore.  To see all of the assets and resources necessary for
# a regular application, please see the HelloWorld/Template application.
#
# In particular, this sample specifically excludes SplashScreen resources
# both Large and Small application Icons, and the associated bitmaps.
# It will run correctly, but will not be as pretty as a shipping app.
#
# Please use the HelloWorld application as a Template application which
# contains everything necessary to be a proper app.
#
# There are a number of resource IDs defined here, which are not used
# by the application code itself.  To simplify the generated Resources.java
# file, the unused ones are preceded with an underbar, so that they 
# will only be used in this file.  e.g. CNTRL_ID_HIGHSCORE becomes
# _CNTRL_ID_HIGHSCORE to avoid exporting to Resources.java.
#---------------------------------------------------------------------


package "com.example.DataStoreDemo"

interface "{source}/com/example/DataStoreDemo/Resources.java"
events "{source}/com/example/DataStoreDemo/Commands.java"

#---------------------------------------------------------------------
# Class ID
#---------------------------------------------------------------------
string ID_APP_CLASS "com.example.DataStoreDemo.DataStoreDemo"

#---------------------------------------------------------------------
# helloworld Application Name
#---------------------------------------------------------------------
string ID_APP_NAME "DataStoreDemo"

#---------------------------------------------------------------------
# App I18N Locale String
#---------------------------------------------------------------------
string ID_LOCALE    "en_US"

#---------------------------------------------------------------------
# Submenu of the Main Window menu, used for Sort menu.
#---------------------------------------------------------------------
menu _ID_MENU_SORT_SUBMENU

	menuItem
		title = "Score"
		event = EVENT_SORT_SCORE
		id = ID_MENU_SORT_SCORE

	menuItem
		title = "Name"
		event = EVENT_SORT_NAME
		id = ID_MENU_SORT_NAME

	menuItem
		title = "Level"
		event = EVENT_SORT_LEVEL
		id = ID_MENU_SORT_LEVEL

	menuItem
		title = "Date"
		event = EVENT_SORT_DATE
		id = ID_MENU_SORT_DATE
endMenu

#---------------------------------------------------------------------
# DataStoreDemo MainWindow menu
#---------------------------------------------------------------------
menu _ID_MENU_DATASTORE_DEMO

	menuItem
		title = "Sort"
		subMenu = _ID_MENU_SORT_SUBMENU
		id = ID_MENU_SORT

	divider
	
	menuItem 
		title = "New Score"
		event = EVENT_NEW_SCORE
		shortcut = 'n'
endMenu

#---------------------------------------------------------------------
# Delete All Alert
# To reset the DB back to a zero state. For debugging purposes.
#---------------------------------------------------------------------
alert ID_DELETE_ALL_ALERT

	title = "Delete All Settings?"
	text = "Permanently discard all saved settings?"
	icon = trashIcon
	appAlertStyle

	button
		position = buttonBottom1
		title = cancelButton
		shortcut = doneButton		// under 1.1 it's an X, otherwise it's Check.
		defaultButton

	button
		position = buttonBottom2
		title = "Delete All"
		id = _ID_DELETE_ALL_OK
		eventListener = application
		event = EVENT_DELETE_ALL_OK
endAlert

#---------------------------------------------------------------------
# MainScreen
# Main UI screen, with scrolling list view.
#---------------------------------------------------------------------
screen ID_MAIN_SCREEN

	title = "High Scores"
	className = "MainWindow"
	actionMenu = _ID_MENU_DATASTORE_DEMO
		
	staticText
		text = "Name"
		font = boldSysFont
		id = _ID_NAMETEXT
		justifyLeft
		alignWithParentLeft = 5
		alignWithParentTop = 0

	staticText
		text = "Score"
		font = boldSysFont
		id = _ID_SCORETEXT
		justifyLeft
		positionToRight = _ID_NAMETEXT : 65
		alignTop = _ID_NAMETEXT

	staticText
		text = "Level"
		font = boldSysFont
		positionToRight = _ID_SCORETEXT : 20
		alignTop = _ID_SCORETEXT
		id = _ID_LEVELTEXT
		justifyLeft
		
	staticText
		text = "Date"
		font = boldSysFont
		positionToRight = _ID_LEVELTEXT : 25
		alignTop = _ID_SCORETEXT
		id = _ID_DATETEXT
		
	scrollView
		alignWithParentLeft = 5
		fillToRight = 0
		fillToBottom = 0
		id = ID_SCROLL_VIEW
		positionBelow = _ID_SCORETEXT : 0
	endScrollView

endScreen

#---------------------------------------------------------------------
# Winner names array, strictly for debugging and display purposes.  
# When creating a new HighScore, one is chosen randomly from this 
# list.
#---------------------------------------------------------------------

stringArray ID_WINNER_NAMES
	"Arf Wignack"
	"Zz Zimmerman"
	"Peter James"
	"Gary Johnston"
	"Hans Blix"
endStringArray

