# -*- 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
# GUI.  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.
#
# This file does not include all of the resources for the application.
# There are several include files that specify all of the specific UI
# elements being demonstrated.
#---------------------------------------------------------------------


package "com.example.GUIDemo"

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

include "GUIDemoStrings.rsrc"
include "GUIDemoWidgets.rsrc"

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

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

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

#---------------------------------------------------------------------
# GUIDemo Large Icon  (32x32)
#---------------------------------------------------------------------
bitmap ID_LARGE_ICON "{base}GUIDemo32.png"

#---------------------------------------------------------------------
# GUIDemo Small Icon (16x16)
#---------------------------------------------------------------------
bitmap ID_SMALL_ICON "{base}GUIDemo16.png"


bitmap ID_2_3_ICON 		"{base}2.3_Icon.png"
sequence ID_MUSIC		"{localeDir}/assets/sounds/rocksDemo.mid"

#---------------------------------------------------------------------
# Menu list for program structure.
#
# This menu is used to create the program structure, to determine which
# folder in the main ListView each of the widgets, screens, and dialogs 
# appear. The hierarchy of the FolderView is the same as a Menu, with one
# level of nesting.
#
# This menu is read at runtime to fill in the ListView.  When an item
# is chosen from the FolderView, the Event is sent back to the owning
# ScreenWindow, which then displays the chosen element.
#
# All of these submenus are sorted at runtime.
#---------------------------------------------------------------------

menu _ID_MENU_CONTAINERS
	menuItem
		title = "Container"
		event = EVENT_CONTAINER
	menuItem
		title = "GroupBox"
		event = EVENT_GROUP_BOX
	menuItem
		title = "ScrollView"
		event = EVENT_SCROLL_VIEW
	menuItem
		title = "RoundRectContainer"
		event = EVENT_ROUND_RECT_CONTAINER
endMenu

menu _ID_MENU_BUTTONSANDBOXES
	menuItem
		title = "RadioButton"
		event = EVENT_RADIO_BUTTON
	menuItem
		title = "CheckBox"
		event = EVENT_CHECK_BOX
	menuItem
		title = "Button"
		event = EVENT_BUTTON
	menuItem
		title = "RadioButtonGroup"
		event = EVENT_RADIO_BUTTON_GROUP
	menuItem
		title = "CheckBoxGroup"
		event = EVENT_CHECK_BOX_GROUP
	menuItem
		title = "MultiModeButton"
		event = EVENT_MULTI_MODE_BUTTON
endMenu

menu _ID_MENU_PICKERS
	menuItem
		title = "DatePicker"
		event = EVENT_DATE_PICKER
	menuItem
		title = "DateEditor"
		event = EVENT_DATE_EDITOR
	menuItem
		title = "NumberEditor"
		event = EVENT_NUMBER_EDITOR
	menuItem
		title = "RingTonePicker"
		event = EVENT_RING_TONE_PICKER
	menuItem
		title = "IconPicker"
		event = EVENT_ICON_PICKER
endMenu

menu _ID_MENU_TEXT
	menuItem
		title = "StaticText"
		event = EVENT_STATIC_TEXT
	menuItem
		title = "EditText"
		event = EVENT_EDIT_TEXT
	menuItem
		title = "StaticTextBox"
		event = EVENT_STATIC_TEXT_BOX
	menuItem
		title = "TextField"
		event = EVENT_TEXT_FIELD
	menuItem
		title = "TypeAheadTextField"
		event = EVENT_TYPE_AHEAD_TEXT_FIELD
	menuItem
		title = "LabeledGrid"
		event = EVENT_LABELED_GRID
# PassWord item is not found in the DRE widget chooser directly.
# It creates a PasswordTextField by creating an EditTextField
# with the password keyword attached.  At runtime it will build
# the correct class.
	menuItem
		title = "PasswordTextField"
		event = EVENT_PASSWORD_TEXT_FIELD
endMenu

menu _ID_MENU_MISCVIEWS
	menuItem
		title = "AnimatedBitmapView"
		icon = ID_2_3_ICON
		event = EVENT_ANIMATED_BITMAP_VIEW
	menuItem
		title = "Image"
		event = EVENT_IMAGE
	menuItem
		title = "ProgressBar"
		event = EVENT_PROGRESS_BAR
	menuItem
		title = "IconLabel"
		event = EVENT_ICON_LABEL
	menuItem
		title = "Shape"
		event = EVENT_SHAPE
	menuItem
		title = "View"
		event = EVENT_VIEW
	menuItem
		title = "RadioStatusView"
		event = EVENT_RADIO_STATUS_VIEW
	menuItem
		title = "BatteryStatusView"
		event = EVENT_BATTERY_STATUS_VIEW
endMenu

menu _ID_MENU_MISCCONTROLS
	menuItem
		title = "PopupMenu"
		event = EVENT_POPUP_MENU
	menuItem
		title = "Slider"
		event = EVENT_SLIDER
	menuItem
		title = "LinkView"
		event = EVENT_LINK_VIEW
	menuItem
		title = "ListView"
		event = EVENT_LIST_VIEW
	menuItem
		title = "ActiveListView"
		event = EVENT_ACTIVE_LIST_VIEW
	menuItem
		title = "ScrollBar"
		event = EVENT_SCROLL_BAR
endMenu


menu _ID_MENU_SCREENSANDDIALOGS
	menuItem
		title = "DialogWindow"
		event = EVENT_DIALOG_WINDOW
	menuItem
		title = "AlertWindow"
		event = EVENT_ALERT_WINDOW
	menuItem
		title = "TextInputAlertWindow"
		event = EVENT_TEXT_INPUT_ALERT
	menuItem
		title = "ScreenWindow"
		event = EVENT_SCREEN_WINDOW
endMenu

menu _ID_MENU_MENUS
	menuItem
		title = "Menu"
		event = EVENT_MENU
	menuItem
		title = "PopupMenu"
		event = EVENT_POPUP_MENU
endMenu

#---------------------------------------------------------------------
# Main Menu for the Resource based screen.  These items are all
# built from the resource file.
#
# If edited, this menu should be kept sorted here, as it is not sorted 
# at runtime to avoid moving the Show Programmatic switching item at the 
# top.  The sub-menus for each folder *are* automatically sorted 
# alphabetically at runtime.
#---------------------------------------------------------------------

menu ID_RESOURCE_MENU
	menuItem
		title = "Show Programmatic items"
		event = EVENT_SHOW_PROGRAMMATIC
	divider
	
	menuItem
		title = "Buttons & Boxes"
		subMenu = _ID_MENU_BUTTONSANDBOXES
	menuItem
		title = "Containers"
		subMenu = _ID_MENU_CONTAINERS
	menuItem
		title = "Menus"
		subMenu = _ID_MENU_MENUS
	menuItem
		title = "Misc Controls"
		subMenu = _ID_MENU_MISCCONTROLS
	menuItem
		title = "Misc Views"
		subMenu = _ID_MENU_MISCVIEWS
	menuItem
		title = "Pickers"
		subMenu = _ID_MENU_PICKERS
	menuItem
		title = "Screens & Dialogs"
		subMenu = _ID_MENU_SCREENSANDDIALOGS
	menuItem
		title = "Text"
		subMenu = _ID_MENU_TEXT

	divider
	menuItem
		title = "Previous"
		event = EVENT_PREVIOUS
		shortcut = leftShoulderButton
	menuItem
		title = "Next"
		event = EVENT_NEXT
		shortcut = rightShoulderButton
endMenu

#---------------------------------------------------------------------
# Menus for the Programmatic based screen.  These items are all
# built directly at runtime, and have no resource definitions.
#
# These submenus are sorted at runtime.
#---------------------------------------------------------------------

menu _ID_PROGMENU_CONTROLS
	menuItem
		title = "ListSelectMenu"
		event = EVENT_LIST_SELECT_MENU
	menuItem
		title = "RingTonePickerMenu"
		event = EVENT_RING_TONE_PICKER_MENU
	menuItem
		title = "Table"
		event = EVENT_TABLE
endMenu

menu _ID_PROGMENU_DIALOGS
	menuItem
		title = "AddToContactsHelper"
		event = EVENT_ADD_TO_CONTACTS_HELPER
	menuItem
		title = "AudioPreviewWindow"
		event = EVENT_AUDIO_PREVIEW_WINDOW
	menuItem
		title = "AudioRecordWindow"
		event = EVENT_AUDIO_RECORD_WINDOW
	menuItem
		title = "DateDialog"
		event = EVENT_DATE_DIALOG
	menuItem
		title = "ProgressWindow"
		event = EVENT_PROGRESS_WINDOW
	menuItem
		title = "ToolTipWindow"
		icon = ID_2_3_ICON
		event = EVENT_TOOL_TIP_WINDOW
endMenu

menu _ID_PROGMENU_TEXT
	menuItem
		title = "ScrollingTextBox"
		icon = ID_2_3_ICON
		event = EVENT_SCROLLING_TEXT_BOX
	menuItem
		title = "LinkTextBox"
		icon = ID_2_3_ICON
		event = EVENT_LINK_TEXT_BOX
	menuItem
		title = "LogTextBox"
		event = EVENT_LOG_TEXT_BOX
		icon = ID_2_3_ICON
	menuItem
		title = "SelectTextBox"
		icon = ID_2_3_ICON
		event = EVENT_SELECT_TEXT_BOX
	menuItem
		title = "MutableTextBox"
		icon = ID_2_3_ICON
		event = EVENT_MUTABLE_TEXT_BOX
	menuItem
		title = "NumberField"
		event = EVENT_NUMBER_FIELD
	menuItem
		title = "PhoneNumberTextField"
		event = EVENT_PHONE_NUMBER_TEXT_FIELD
		icon = ID_2_3_ICON
endMenu

menu _ID_PROGMENU_VIEWS
	menuItem
		title = "Triangle"
		event = EVENT_TRIANGLE
	menuItem
		title = "MonthView"
		event = EVENT_MONTH_VIEW
	menuItem
		title = "ClockView"
		event = EVENT_CLOCK_VIEW
	menuItem
		title = "PendingStatusView"
		event = EVENT_PENDING_STATUS_VIEW
	menuItem
		title = "FolderView"
		event = EVENT_FOLDER_VIEW
	menuItem
		title = "MultiFolderView"
		icon = ID_2_3_ICON
		event = EVENT_MULTI_FOLDER_VIEW
	menuItem
		title = "ListContainer"
		event = EVENT_LIST_CONTAINER
endMenu

menu _ID_PROGMENU_WINDOWS
	menuItem
		title = "MenuWindow"
		event = EVENT_MENU_WINDOW
# Not presently a functional class, waiting for bug fixes.
#	menuItem
#		title = "FolderEditor"
#		event = EVENT_FOLDER_EDITOR
	menuItem
		title = "ImageWindow"
		event = EVENT_IMAGE_WINDOW
	menuItem
		title = "PhotoPicker"
		event = EVENT_PHOTO_PICKER
endMenu

#---------------------------------------------------------------------
# This is the main menu for the Programmatic screen. 
#
# If edited, this menu should be kept sorted here, as it is not sorted 
# at runtime to avoid moving the Show Resource switching item at the 
# top.  The sub-menus for each folder *are* automatically sorted 
# alphabetically at runtime.
#---------------------------------------------------------------------

menu ID_PROG_MENU
	menuItem
		title = "Show Resource Based items"
		event = EVENT_SHOW_RESOURCEBASED
	divider

	menuItem
		title = "Controls"
		subMenu = _ID_PROGMENU_CONTROLS
	menuItem
		title = "Dialogs"
		subMenu = _ID_PROGMENU_DIALOGS
	menuItem
		title = "Text"
		subMenu = _ID_PROGMENU_TEXT
	menuItem
		title = "Views"
		subMenu = _ID_PROGMENU_VIEWS
	menuItem
		title = "Windows"
		subMenu = _ID_PROGMENU_WINDOWS

	divider
	menuItem
		title = "Previous"
		event = EVENT_PREVIOUS
		shortcut = leftShoulderButton
	menuItem
		title = "Next"
		event = EVENT_NEXT
		shortcut = rightShoulderButton
endMenu

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

	title = ID_RESOURCE_BASED
	className = "ResourceWindow"
	actionMenu = ID_RESOURCE_MENU
		
	staticText
		text = "Resource based Screens and Widgets"
		id = _ID_NAMETEXT
		justifyLeft
		alignWithParentLeft = 5
		alignWithParentTop = 0
		font = "BortItalic9"

	shape
		fillToRight = 0
		height = 1
		lineType = horizontal
		positionBelow = _ID_NAMETEXT : 0
		type = line
		alignWithParentLeft = 0
		frameColor = 0x00ff3300

	# This view is just a starting location for the runtime created FolderView,
	# so that the dimensions can be resource based.
	view
		id = ID_FOLDER_VIEW
		alignWithParentLeft = 0
		fillToRight = 0
		fillToBottom = 0
		positionBelow = _ID_NAMETEXT : 1

endScreen

#---------------------------------------------------------------------
# MainScreen
# Main UI screen, with scrolling list view.
# This version is for the Program based UI elements, that only exist
# at runtime, not in resources.
#---------------------------------------------------------------------
screen ID_PROGRAMBASED_SCREEN

	title = ID_PROGRAMMATIC
	className = "ProgramWindow"
	actionMenu = ID_PROG_MENU
		
	staticText
		text = "Programmatically built Screens and Widgets"
		id = _ID_NAMETEXT
		justifyLeft
		alignWithParentLeft = 5
		alignWithParentTop = 0
		font = "BortItalic9"

	shape
		fillToRight = 0
		height = 1
		lineType = horizontal
		positionBelow = _ID_NAMETEXT : 0
		type = line
		alignWithParentLeft = 0
		frameColor = 0x00ff3300


	# This view is just a starting location for the runtime created FolderView,
	# so that the dimensions can be resource based.
	view
		id = ID_FOLDER_VIEW
		alignWithParentLeft = 0
		fillToRight = 0
		fillToBottom = 0
		positionBelow = _ID_NAMETEXT : 1
		
endScreen

#---------------------------------------------------------------------
# Nice self-dismissing alert for choosing 2.3 variants under OS 2.0.
# Seems nicer than having them disabled.
# It creates a LRAlertWindow so it can be skipped past with L/R too.
#---------------------------------------------------------------------

alert ID_UNAVAILABLE
	className = "LRAlertWindow"
	title = "Unimplemented"
	text = "Not available in this version of the OS."
	forceNoButtons
	autoDismissMilliseconds = 2000
endAlert

