# -*- 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.example.GUIDemo"


# Icons used for MultiModeButton

bitmap ID_A_UP_ICON "{base}A_up.png"
bitmap ID_A_RIGHT_ICON "{base}A_right.png"
bitmap ID_A_LEFT_ICON "{base}A_left.png"
bitmap ID_A_DOWN_ICON "{base}A_down.png"

# Sample image files

bitmap ID_HANS "{base}hans.png"
bitmap ID_DOG "{base}Dog.gif"	// animated gif

# Consistent window size for each dialog.

constant kWindowWidth 215
constant kWindowHeight 100


#---------------------------------------------------------------------
# This resource file is only included by the main resource file,
# GUIDemo.rsrc.  This secondary file allows the very large list of 
# resources and UI elements to be broken out into logical chunks.
# This file includes examples of every screen widget that can be
# created. It is composed of a long series of DialogWindows that
# include a single UI widget in the main area.
#
# 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.
#
# Every option available for the demonstrated views is shown here in
# the resource file, but may be commented out to make the UI less
# confusing.  
#
# Each of these Widgets and Views are created using the className 
# parameter, to change the runtime class to an overridden variant.
# This is unnecessary in general, and is used here only to allow for
# the Left/Right Shoulder buttons, to step through the items in a
# simple fashion.  
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# Standard Widget Options
# These options are available for every widget demonstrated here.  Not
# all are in use at a given time, because some are mutually exclusive.
# In general, the best bet is to leave things at their defaults and not
# use the options, unless there is a specific reason to change them.
#
# For full details, please see the resource documentation at:
#   http://developer.danger.com/docs/rsrc/
#---------------------------------------------------------------------
## <widget-options> 
# event = <event id>
# eventData = <integer> NEW for 1.1e
# eventWhat = <integer> NEW for 2.0
# className = <quoted string>
# title = <quoted string>		# in general, only shows up in 2.3
# id = <widget id>
# focusOrder = <integer>
# font = <font>
# initialValue = <integer>
# initialFocus
# disabled
# invisible
# hasBorder | doesNotHaveBorder
# acceptsFocus | doesNotAcceptFocus NEW for 2.0
# transparent
# backgroundColor = <color>
#  
# width = <integer>
# widthPct = <integer>
# fillToLeft = <integer>
# fillToRight = <integer>
# height = <integer>
# heightPct = <integer>
# fillToTop = <integer>
# fillToBottom = <integer>
# matchWidth = <widget id>
# matchHeight = <widget id>
#  
# top = <integer>
# bottom = <integer>
# left = <integer>
# right = <integer>
# centerHorizontally
# centerVertically
# center
# positionAbove = <widget id> : <integer>
# positionBelow = <widget id> : <integer>
# positionToLeft = <widget id> : <integer>
# positionToRight = <widget id> : <integer>
# alignTop = <widget id>
# alignBottom = <widget id>
# alignLeft = <widget id>
# alignRight = <widget id>
# alignVertical = <widget id>
# alignHorizontal = <widget id>
# alignWithParentTop = <integer>
# alignWithParentBottom = <integer>
# alignWithParentLeft = <integer>
# alignWithParentRight = <integer>

#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Buttons & Boxes menu
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# Button demonstration dialog.  
#---------------------------------------------------------------------

dialog ID_BUTTON
	title = "danger.ui.Button"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault
		
	button			## <widget-options> See complete list in file header.
		alignWithParentTop = 15
		alignWithParentLeft = 10
		event = EVENT_HIDE
					## <button-options>
					# [title = <quoted string> | okButton | cancelButton |
					#		doneButton | discardButton]
		title = "Got a Big Button"
					# shortcut = <shortcut>]
					# position = buttonTop1 | buttonTop2 |
					#		buttonBottom1 | buttonBottom2 | buttonBottom3]
					# icon = <bitmap resource id>]
					# focusedIcon = <bitmap resource id>] [NEW for 2.0]
					# disabledIcon = <bitmap resource id>] [NEW for 2.0]
					# iconTitle = <bitmap resource id>] [NEW for 2.0]
					# focusedIconTitle = <bitmap resource id>] [NEW for 2.0]
					# disabledIconTitle = <bitmap resource id>] [NEW for 2.0]
					# iconAlignLeft | iconAlignRight | iconAlignTop | iconAlignBottom] [NEW for 1.1e]
					# bitmapTitlePadding = <integer>] [NEW for 2.0]
					# horizontalPadding = <integer>] [NEW for 2.0]
endDialog

#---------------------------------------------------------------------
# Dialog to display the CheckBox resource.
#---------------------------------------------------------------------

dialog ID_CHECK_BOX
	title = "danger.ui.CheckBox"
	className = "LRDialogWindow"	// In general, override is unnecessary.
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault
		
	checkBox		## <widget-options> See complete list in file header.
		title = "Sample happy Check Box,\nshowing multi-line ability."
		alignWithParentTop = 15
		alignWithParentLeft = 10
					## <checkbox-options>
		multiLine
endDialog

#---------------------------------------------------------------------
# Dialog to display a CheckBoxGroup.
#---------------------------------------------------------------------

dialog ID_CHECK_BOX_GROUP
	title = "danger.ui.CheckBoxGroup"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault
	
	checkBoxGroup	## <widget-options> See complete list in file header.
		alignWithParentTop = 0
		alignWithParentLeft = 5
		fillToRight = 5
		title = "Group Title"
					## <checkBoxGroup-options>
					# [verticalSpacing = <integer>]
		multiLine			

		checkBox	## <widget-options> See complete list in file header.
			title = "Double happy Check Box, showing multi-line ability."

		checkBox
			title = "Perfectly fine option."
			checked
					## <checkbox-options>
	endCheckBoxGroup
endDialog

#---------------------------------------------------------------------
# MultiMode button dialog.
#---------------------------------------------------------------------

dialog ID_MULTI_MODE_BUTTON
	title = "danger.ui.MultiModeButton"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault
		
	multiModeButton	## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
		id = ID_MULTI_VIEW
					## <button-options>
					# [title = <quoted string> | okButton | cancelButton |
					#		doneButton | discardButton]
					# shortcut = <shortcut>]
					# position = buttonTop1 | buttonTop2 |
					#		buttonBottom1 | buttonBottom2 | buttonBottom3]
					# icon = <bitmap resource id>]
		focusedIcon = ID_A_DOWN_ICON		// necessary to avoid crash
					# disabledIcon = <bitmap resource id>] [NEW for 2.0]
					# iconTitle = <bitmap resource id>] [NEW for 2.0]
					# focusedIconTitle = <bitmap resource id>] [NEW for 2.0]
					# disabledIconTitle = <bitmap resource id>] [NEW for 2.0]
					# iconAlignLeft | iconAlignRight | iconAlignTop | iconAlignBottom] [NEW for 1.1e]
					# bitmapTitlePadding = <integer>] [NEW for 2.0]
					# horizontalPadding = <integer>] [NEW for 2.0]
					
		mode		## <mode-options>
					# id = <id>]
			icon = ID_A_UP_ICON
					# focusedIcon = <icon>]
					# disabledIcon = <icon>]
					# title = <quoted string>]
					# iconTitle = <icon>]
					# focusedIconTitle = <icon>]
					# disabledIconTitle = <icon>]
		mode
			icon = ID_A_RIGHT_ICON
		mode
			icon = ID_A_DOWN_ICON
		mode
			icon = ID_A_LEFT_ICON
	endMultiModeButton
endDialog

#---------------------------------------------------------------------
# Dialog to display the RadioButton example
#---------------------------------------------------------------------

dialog ID_RADIO_BUTTON
	title = "danger.ui.RadioButton"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	radioButton		## <widget-options> See complete list in file header.
		title = "A solo Radio button.  \nClips to the edge of the window."
		alignWithParentTop = 15
		alignWithParentLeft = 10
					## <checkbox-options>
					# [multiLine]
// Notably, the clipping does not work properly under 2.0.  Either use
// the multiLine option, or carefully lay out the text.  \n has no effect
// in 2.0 unless using multiLine.  Under 2.3, it shows ToolTip use.
endDialog

#---------------------------------------------------------------------
# Dialog to display a Radio Button Group.
#---------------------------------------------------------------------

dialog ID_RADIO_GROUP
	title = "danger.ui.RadioGroup"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault
	
	radioButtonGroup ## <widget-options> See complete list in file header.
		alignWithParentTop = 0
		alignWithParentLeft = 5
		fillToRight = 5
		title = "Group Title"
					## <radioButtonGroup-options>
					# [verticalSpacing = <integer>]
					# [multiLine]

		radioButton	## <widget-options> See complete list in file header.
			title = "Logical happy option"
		radioButton
			title = "Helpful handy option"
		radioButton
			title = "Perfectly fine option"
	endRadioButtonGroup
endDialog

#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Containers
#---------------------------------------------------------------------

dialog ID_CONTAINER
	title = "danger.ui.Container"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	container		## <widget-options> See complete list in file header.
		alignWithParentTop = 5
		alignWithParentLeft = 10
		fillToRight = 10
		height = 40
		backgroundColor = 0x00ff3300	# just to make it visible.
	endContainer
endDialog

dialog ID_GROUP_BOX
	title = "danger.ui.GroupBox"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	groupBox		## <widget-options> See complete list in file header.
		title = "Grouper"
		alignWithParentTop = 5
		alignWithParentLeft = 10
		width = 90
		height = 40
					## <groupBox-options>
					# [onOffControl = <widget id>]
					# [onOffControlTopPosition | onOffControlLeftPosition]
	endGroupBox

	groupBox		## <widget-options> See complete list in file header.
		#title = "Group Box (container)"
		alignWithParentTop = 6			// avoid 2.0 drawing bug when matches.
		alignWithParentRight = 10
		width = 90
		height = 40
		
		onOffControl = _OFF
		onOffControlTopPosition
		
		checkBox
			title = "Offer"
			id = _OFF
	endGroupBox

endDialog

dialog ID_ROUND_RECT_CONTAINER
	title = "danger.ui.RoundRectContainer"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	roundRectContainer ## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
		fillToRight = 10
		height = 40
					## <roundRectContainer-options>
					# [frameColor = <color>]
					# [fillColor = <color>]
					# [framePenSize = <integer>]
					# [frameArcSize = <integer>]
	endRoundRectContainer
endDialog

dialog ID_SCROLL_VIEW
	title = "danger.ui.ScrollView"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	scrollView		## <widget-options> See complete list in file header.
		alignWithParentTop = 6
		alignWithParentLeft = 10
		fillToRight = 10
		height = 43
		backgroundColor = 0x00ffcc99	# just to make it visible.
		id = ID_SCROLLER
		initialFocus
		
		// Adding a shape merely to give scrollView something to scroll,
		// otherwise it doesn't activate.
		shape
			alignWithParentTop = 5
			alignWithParentLeft = 5
			width = 200
			height = 200
					##  <shape-options>
					# [type = line, oval, rect, or roundRect] (required)
					# [frameColor = <color>]
					# [fillColor = <color>]
					# [lineType = horizontal, vertical, topLeftDiagonal, or topRightDiagonal]
					# [arc = <integer>]
			type = oval
			fillColor = 0x0033ff33
	endScrollView
endDialog

#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Menus
#---------------------------------------------------------------------

# PopupMenu is the same as that for Misc Controls.  It is in two
# places to make it easier to find. 

#---------------------------------------------------------------------
# Menu demonstration dialog
#---------------------------------------------------------------------

menu ID_DEMO_MENU	##  <menu-options>
	title = "Menu with Title"
					# [checkedIcon = <bitmap resource id>]
					# [markedIcon = <bitmap resource id>]
	showTitle
					# [dontSetDefaultSelectionToFirst]
					# [dontAutoHideIfIdle]
					# [ellipsize]
	centerInParentWindow
					
	menuItem		##  <menuItem-options>
		shortcut = doneButton
					# [shortcutLabel = <quoted string>] [NEW for 2.0]		
		title = "Done"
		event = EVENT_HIDE
					# [eventData = <integer>] [NEW for 1.1e]
					# [eventWhat = <integer>] [NEW for 2.0]
					# [subMenu = <menu resource id>]
					# [icon = <bitmap resource id> or one of the special icon constants below] [MODIFIED for 2.0]
					# [id = <identifier>]
					# [checked]
					# [disabled]
					# [marked]
	divider
	menuItem
		title = "Previous"
		shortcut = leftShoulderButton
		event = EVENT_PREVIOUS
	menuItem
		title = "Next"
		shortcut = rightShoulderButton
		event = EVENT_NEXT
	divider
	menuItem	
		title = "Shockingly checked item"
		checked
	divider
	
	textEditMenu	# adds the standard cut/copy/paste menu
endMenu

screen ID_MENU
	title = ID_RESOURCE_BASED
	subTitle = "danger.ui.Menu"
	actionMenu = ID_DEMO_MENU
	className = "LRScreenWindow"

	staticText
		text = "Use Menu to demonstrate..."
		alignWithParentLeft = 15
		alignWithParentTop = 20

	editText
		initialText = "Text field to demonstrate Edit Text Menu"
		alignWithParentLeft = 15
		alignWithParentTop = 40
		fillToRight = 15
		initialFocus
endScreen


#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Misc Controls 
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# ActiveListView demonstration dialog
#---------------------------------------------------------------------
// The resource side for an ActiveListView is not particularly useful,
// because so much is required at runtime to implement the desired
// functionality.  This allows for location and sizing, but not much more.

dialog ID_ACTIVE_LIST_VIEW
	title = "danger.ui.ActiveListView"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	activeListView	## <widget-options> See complete list in file header.
		alignWithParentLeft = 10
		alignWithParentTop = 10
		fillToRight = 10
		height = 38
		initialFocus
		id = ID_ACTIVE_VIEW
					## <activeListView-options>
		itemHeight = 12			// not optional, defaults to 1 pixel high.
					# [doesNotHaveScrollBar]
endDialog

#---------------------------------------------------------------------
# ListView demonstration dialog
#---------------------------------------------------------------------

dialog ID_LIST_VIEW
	title = "danger.ui.ListView"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	listView 		## <widget-options> See complete list in file header.
		alignWithParentLeft = 10
		alignWithParentTop = 10
		fillToRight = 10
		height = 40			// 2.0 height bug in dialogs, required.
		initialFocus
					## <listView-options>
					# [hasScrollBar]

		listItem
			title = "Once upon a time..."
			event = EVENT_HIDE
		listItem
			title = "In the beginning, there..."
			event = EVENT_HIDE
		listItem
			title = "It was a dark and stormy..."
			event = EVENT_HIDE
		listItem
			title = "When in the course of..."
			event = EVENT_HIDE
		listItem
			title = "It was the best of times..."
			event = EVENT_HIDE
	endListView				
endDialog

#---------------------------------------------------------------------
# LinkView demonstration dialog
#---------------------------------------------------------------------

dialog ID_LINK_VIEW
	title = "danger.ui.LinkView"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	linkView		## <widget-options> See complete list in file header.
		id = ID_LINKIN_PARK
		alignWithParentLeft = 10
		fillToRight = 10				// required to avoid startup crash
		alignWithParentTop = 10
		initialFocus
endDialog

#---------------------------------------------------------------------
# PopupMenu demonstration dialog
#---------------------------------------------------------------------

dialog ID_POPUP_MENU
	title = "danger.ui.PopupMenu"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	popupMenu		## <widget-options> See complete list in file header.
		alignWithParentLeft = 10
		alignWithParentTop = 10
		initialFocus
		 			## <popupMenu-options>
		menu = ID_SCREENS_MENU
endDialog

#---------------------------------------------------------------------
# ScrollBar demonstration dialog
#---------------------------------------------------------------------

dialog ID_SCROLL_BAR
	title = "danger.ui.Scrollbar"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	scrollBar		## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
		height = 40
		id = ID_SCROLLY
		 			## <scrollBar-options>
					# [floating]
endDialog

#---------------------------------------------------------------------
# Slider demonstration dialog
#---------------------------------------------------------------------

dialog ID_SLIDER
	title = "danger.ui.Slider"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	slider			## <widget-options> See complete list in file header.
		alignWithParentLeft = 10
		alignWithParentTop = 15
		initialFocus
		title = "Slider City"
					## <slider-options>
		minValue = 2
		maxValue = 10
		description = "2 to 10 Slider"
endDialog

#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Misc Views 
#---------------------------------------------------------------------

// It is notable that animations do not show while in the simulator
// because animations require device native code.

dialog ID_ANIMATED_BITMAP_VIEW
	title = "danger.ui.AnimatedBitmapView"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	animatedBitmapView ## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
		id = ID_DOG_VIEW
					## <animatedBitmapView-options>
					# [bitmap = <bitmap resource id>]
					# [bitmapFromArray = <bitmap array resource id> : <index>]
					# [preDecode]
					# [conserveMem]
					# [loop]
		bitmap = ID_DOG
		loop
endDialog

dialog ID_BATTERY_STATUS_VIEW
	title = "danger.ui.BatteryStatusView"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	batteryStatusView ## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
endDialog

dialog ID_ICON_LABEL
	title = "danger.ui.IconLabel"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	iconLabel		## <widget-options> See complete list in file header.
		alignWithParentTop = 5
		alignWithParentLeft = 10
		fillToRight = 10
		height = 45
		title = "Labeled Icon"
					## <iconLabel-options>
					# [icon = <bitmap resource id>]
					# [buttonTitle = <quoted string>]
					# [iconAlignCenter | iconAlignTop | iconAlignBottom]
		icon = ID_A_UP_ICON
		buttonTitle = "Click"
		iconAlignCenter
endDialog

dialog ID_IMAGE_VIEW
	title = "danger.ui.ImageView"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	image			## <widget-options> See complete list in file header.
		id = ID_IMAGINING
		alignWithParentTop = 5
		alignWithParentLeft = 5
					## <image-options>
					# [bitmap = <bitmap resource id> | stopIcon | noteIcon | cautionIcon | trashIcon]
		bitmap = ID_HANS			
	
	image
		alignWithParentTop = 5
		alignWithParentRight = 5
		bitmap = cautionIcon
endDialog

dialog ID_RADIO_STATUS_VIEW
	title = "danger.ui.RadioStatusView"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	radioStatusView	## <widget-options> See complete list in file header.
		alignWithParentTop = 10
		alignWithParentLeft = 10
endDialog

dialog ID_PROGRESS_BAR
	title = "danger.ui.ProgressBar"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	progressBar		## <widget-options> See complete list in file header.	
		alignWithParentTop = 10
		alignWithParentLeft = 10
		width = 120
					## <progressBar-options>
		 			# [minValue = <integer>]
		 			# [maxValue = <integer>]
					# [initalValue = -1] for throbbing style
		minValue = 3
		maxValue = 12
		initialValue = 5
		
	progressBar		## <widget-options> See complete list in file header.	
		alignWithParentTop = 35
		alignWithParentLeft = 10
		width = 120
		id = ID_THROBBER
					## <progressBar-options>
					# [minValue = <integer>]
					# [maxValue = <integer>]
		initialValue = -1
endDialog

dialog ID_SHAPE
	title = "danger.ui.geometry.*"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	shape			## <widget-options> See complete list in file header.
		alignWithParentTop = 5
		alignWithParentLeft = 5
		width = 40
		height = 40
		id = _LINE
					##  <shape-options>
					# [type = line, oval, rect, or roundRect] (required)
					# [frameColor = <color>]
					# [fillColor = <color>]
					# [lineType = horizontal, vertical, topLeftDiagonal, or topRightDiagonal]
					# [arc = <integer>]
		type = line
		lineType = topLeftDiagonal

	shape
		positionToRight = _LINE : 10
		alignTop = _LINE
		width = 40
		height = 40
		hasBorder
		id = _OVAL
		type = oval
		fillColor = 0x0033ff33		// must be set, otherwise no drawing.

	shape
		positionToRight = _OVAL : 10
		alignTop = _OVAL
		width = 40
		height = 40
		id = _RECT
		type = rect
		frameColor = 0x00ff6600
		fillColor = 0x0033ff33		// must be set, otherwise no drawing.

	shape
		positionToRight = _RECT : 10
		alignTop = _RECT
		width = 40
		height = 40
		id = _ROUNDRECT
		type = roundRect
		frameColor = 0x00ff6600		// must be set, otherwise no drawing.
		arc = 7
endDialog

dialog ID_VIEW
	title = "danger.ui.View"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	view			## <widget-options> See complete list in file header.
		title = "no frills"
		alignWithParentTop = 10
		alignWithParentLeft = 10
		fillToRight = 10
		height = 35
// fillToBottom does not respect the lower band in dialogs, under 2.0.
// Use a fixed height, or use getTitleBarHeight to compensate.
		backgroundColor = 0x00ff3300	# just to make it visible.
endDialog


#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Pickers menu
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# Dialog to display the DatePicker resource.
#---------------------------------------------------------------------

dialog ID_DATE_PICKER
	title = "danger.ui.DatePicker"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	datePicker		## <widget-options> See complete list in file header.
		title = "sample DatePicker"
		alignWithParentTop = 10
		alignWithParentLeft = 10
		initialFocus
endDialog

#---------------------------------------------------------------------
# Dialog for the DateTimeEditor picker.
#---------------------------------------------------------------------

dialog ID_DATE_EDITOR
	title = "danger.ui.DateTimeEditor"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	staticText
		id = _SHORTDATE
		text = "shortDateFormat:"
		alignWithParentTop = 10
		alignWithParentLeft = 10
		
	dateEditor		## <widget-options> See complete list in file header.
		alignVertical = _SHORTDATE
		positionToRight = _SHORTDATE : 3
					## <dateEditor-options>
		shortDateFormat # [ | mediumDateFormat | longDateFormat | longTimeFormat]
	
	staticText
		id = _LONGTIME
		text = "longTimeFormat:"
		alignWithParentTop = 30
		alignWithParentLeft = 10
			
	dateEditor
		initialFocus
		alignVertical = _LONGTIME
		positionToRight = _LONGTIME : 3
		longTimeFormat
endDialog

#---------------------------------------------------------------------
# Dialog for the NumberEditor picker.
#---------------------------------------------------------------------

dialog ID_NUMBER_EDITOR
	title = "danger.ui.NumberEditor"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight

	// This is the Done button, and demonstrates how to have it send
	// a specific App event to fetch the user choice.
	button
		title = doneButton
		position = buttonBottom1
		shortcut = backButton
		event = EVENT_NUMBER_EDITOR_RESULT
		id = ID_NUMBER_EDITOR_DONE

	numberEditor 	## <widget-options> See complete list in file header.
		id = ID_NUMBER_VIEW
		alignWithParentTop = 15
		alignWithParentLeft = 10
		initialFocus
					## <numberEditor-options>
		dontWrap
		minValue = 7
		maxValue = 42
// Min and Max must be set, otherwise the picker doesn't draw correctly 
// to start.  Wrapping is whether it will pin at each end or not.
endDialog

#---------------------------------------------------------------------
# Dialog for the RingTone picker.
#---------------------------------------------------------------------

dialog ID_RING_TONE_PICKER
	title = "danger.ui.RingTonePicker"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	
	// This is the Done button, and demonstrates how to have it send
	// a specific App event to fetch the user choice.
	button
		title = doneButton
		position = buttonBottom1
		shortcut = backButton
		event = EVENT_RING_TONE_RESULT
		id = ID_RING_TONE_DONE

	ringTonePicker	## <widget-options> See complete list in file header.
		id = ID_TONE_VIEW
		alignWithParentTop = 15
		alignWithParentLeft = 10
		initialFocus
		widthPct = 60			// otherwise it wraps off edge of screen
					## <ringTonePicker-options>
					# [noneString = <quoted-string>]
					# [allowCustomize]
endDialog

#---------------------------------------------------------------------
# Dialog for the Icon picker.
#---------------------------------------------------------------------

dialog ID_ICON_PICKER
	title = "danger.ui.IconPicker"
	className = "LRDialogWindow"
	width = kWindowWidth	height = kWindowHeight
	doneEvent = EVENT_DONE	doneIsDefault

	iconPicker		## <widget-options> See complete list in file header.
		alignWithParentTop = 15
		alignWithParentLeft = 10
		initialFocus
		id = ID_ICON_PICKER_VIEW
					## <iconPicker-options>
					# [maxColumns = <integer>]
		iconCellSize = 32			// must match icon sizes specified
									// or nothing is included in picker.
		icon = ID_A_UP_ICON
		icon = ID_A_LEFT_ICON
		icon = ID_A_RIGHT_ICON
		icon = ID_A_DOWN_ICON
	endIconPicker
endDialog


#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Screens & Dialogs menu
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# Sample Alert Window
#---------------------------------------------------------------------

alert ID_ALERT_WINDOW	
					## <alert-options>
	title = "danger.ui.AlertWindow"
	text = "Look out!  appAlertStyle"
					#  [icon = <bitmap resource id> | stopIcon | noteIcon | cautionIcon]
					#  [autoDismissMilliseconds = <integer>]
					#  [autoDismissEvent = <event id>]
	appAlertStyle	#  [systemDialog | systemErrorStyle | appAlertStyle] [MODIFIED for 2.0]
					#  [verticalLayout]
					#  [forceNoIcon]
					#  [forceNoButtons]
					#  [font = <font>]
	className = "LRAlertWindow"
endAlert

#---------------------------------------------------------------------
# Sample Dialog Window, using extra options.
#---------------------------------------------------------------------

dialog ID_DIALOG_WINDOW
					## <dialog-options>
	title = "danger.ui.DialogWindow"
// Notably, the systemErrorStyle should be called systemErrorDialog.
// And when either system dialogs are used, a sleep message must be added
// at runtime.
	systemErrorDialog # [systemDialog | systemErrorStyle | appAlertStyle] [MODIFIED for 2.0]
	showCancel
	doneEvent = EVENT_DONE	doneIsDefault
					# [doneIsDefault]
					# [font = <font>]
	className = "LRDialogWindow"
	width = kWindowWidth	
	height = kWindowHeight
					# [leftBorder = <integer>]
					# [rightBorder = <integer>]
					# [topBorder = <integer>]
					# [bottomBorder = <integer>]
					# [top = <integer>]
					# [left = <integer>]	
	centerUnderTitleBar # [centerHorizontally | centerVertically | center | centerUnderTitleBar]
	
	staticTextBox
		alignWithParentLeft = 10
		alignWithParentTop = 5
		fillToRight = 10
		text = "A fancy dialog. (System Error Dialog: blocks Jump, has sleep message), with extra buttons."
		doesNotHaveBorder
		
	button
		position = buttonBottom2
		title = "Bark"
endDialog

#---------------------------------------------------------------------
# Screen Window sample, showing subtitle and icon.
# Uses the Menu to escape.
#---------------------------------------------------------------------

screen ID_SCREEN_WINDOW
					## <screen-options>
	title = ID_RESOURCE_BASED
	subTitle = "danger.ui.ScreenWindow"
	icon = ID_SMALL_ICON
	actionMenu = ID_SCREENS_MENU
					#  [fullScreen]
					#  [font = <font>]
					#  [titleFont = <font>]
					#  [subTitleFont = <font>]
					#  [className = <quoted string>]

	editText
		initialText = "Standard ScreenWindow with this disabled EditText.\n\n" +
			"Use Menu to exit."	
		alignWithParentLeft = 15
		alignWithParentTop = 20
		fillToRight = 15
		fillToBottom = 20
		readOnly
		doesNotHaveBorder
endScreen

#---------------------------------------------------------------------
# Sample TextInputAlert, used mostly for Password dialogs.
#---------------------------------------------------------------------

textInputAlert ID_TEXT_INPUT_ALERT	
					## <text-input-alert-options>
	title = "danger.ui.TextInputAlertWindow"
	text = "This specialized Alert includes TextFields and Buttons."
	icon = cautionIcon			#  [icon = <bitmap resource id> | stopIcon | noteIcon | cautionIcon]
					#  [autoDismissMilliseconds = <integer>]
					#  [autoDismissEvent = <event id>]
					#  [systemDialog | systemErrorStyle | appAlertStyle] [MODIFIED for 2.0]
					#  [verticalLayout]
					#  [forceNoIcon]
					#  [forceNoButtons]
					#  [font = <font>]
	className = "LRTextInputAlertWindow"

	button 			## <button-options>
		position = buttonBottom1 # | buttonTop2 | buttonBottom1 | buttonBottom2 | buttonBottom3
		event = EVENT_PASSWORD_TEXT
		title = "Go Ahead" # | okButton | cancelButton | doneButton | discardButton
		shortcut = backButton 
					# [icon = <bitmap resource id>]
					# [id = <identifier>]
		defaultButton
					# [dontHideOnButtonEvent]
					# [transparent]
 
	textField		## <textField-options>
		position = top # position = top | middle | bottom
		title = "Password:"
					#  [initialText = <quoted string>]
		maxLength = 10
		id = ID_PASSWORD_FIELD
					#  [disabled]
		passwordField
  					## <editText-options>
					#  [advanceFocusOnReturn]
					#  [autoCap]
					#  [autoText]
					#  [initialText = <quoted string>]
					#  [enabledTextColor = <color>]
					#  [disabledTextColor = <color>]
		dontAcceptKeyRepeats
					#  [justifyLeft | justifyRight | justifyCenter]
					#  [readOnly]
					#  [initiallySelectAll]
					#  [maxLength = <integer>]
					#  [numericOnly]
					#  [passwordField]
					#  [alphaOnly]
					#  [ignoreNewlines]
					#  [emailAddress]
					#  [autoResize]
					#  [allCaps]
endTextInputAlert

#---------------------------------------------------------------------
# This alert is self dismissing after 2.3 seconds.  It shows the password
# text that was set during the TextInputAlertWindow.  It is created via
# the EVENT_PASSWORD_TEXT.
#---------------------------------------------------------------------

alert ID_SHOW_PASSWORD_ALERT
	title = "Password from TextInputAlertWindow:"
	text = "password"
	autoDismissMilliseconds = 2300
endAlert


#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Text items from menu
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# StaticText demonstration dialog
#---------------------------------------------------------------------

dialog ID_STATIC_TEXT
	title = "danger.ui.StaticText"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
		
	staticText		## <widget-options> See complete list in file header.
		alignWithParentLeft = 10
		alignWithParentTop = 10
					## <staticText-options>
		text = "Wow! Some static text in the dialog."
		justifyLeft	# | justifyRight | justifyCenter
					# textColor = <color>
					# textOutlineColor = <color>
endDialog

#---------------------------------------------------------------------
# EditText demonstration dialog
#---------------------------------------------------------------------

dialog ID_EDIT_TEXT
	title = "danger.ui.EditText"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault

	editText		## <widget-options> See complete list in file header.
		fillToRight = 10
		alignWithParentTop = 5
		alignWithParentLeft = 10
		title = "Mr. Edit Text"				# title only shows in 2.3
		height = 40
		initialFocus
					## <editText-options>
					#  [advanceFocusOnReturn]
		autoCap
		autoText
		initialText = "Typing, ticka, ticka...\n" +
			"Brnka, brnka, multiple lines."
					#  [enabledTextColor = <color>]
					#  [disabledTextColor = <color>]
					#  [dontAcceptKeyRepeats]
					#  [justifyLeft | justifyRight | justifyCenter]
					#  [readOnly]
					#  [initiallySelectAll]
					#  [maxLength = <integer>]
					#  [numericOnly]
					#  [passwordField]
					#  [alphaOnly]
					#  [ignoreNewlines]
					#  [emailAddress]
					#  [autoResize]
					#  [allCaps]
endDialog

#---------------------------------------------------------------------
# StaticTextBox demonstration dialog
#---------------------------------------------------------------------

dialog ID_STATIC_TEXT_BOX
	title = "danger.ui.StaticTextBox"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault
	
	staticTextBox	## <widget-options> See complete list in file header.
		fillToRight = 10
		height = 30
		alignWithParentTop = 15
		alignWithParentLeft = 10
		title = "Stat"					# Title only shows in 2.3 
					## <staticTextBox-options>
		text = "Land of the StaticTextBox"
		justifyLeft	#  [justifyLeft | justifyRight | justifyCenter]
					#  [textColor = <color>] [NEW for 1.1e]
					#  [textOutlineColor = <color>] [NEW for 1.1e]
					#  [lineSpacing = <integer>] [NEW for 1.1e]
endDialog

#---------------------------------------------------------------------
# TextField demonstration dialog
#---------------------------------------------------------------------

dialog ID_TEXT_FIELD
	title = "danger.ui.TextField"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault

	textField		## <widget-options> See complete list in file header.
		fillToRight = 10
		alignWithParentTop = 15
		alignWithParentLeft = 10
		initialFocus
		title = "Hmm... Text Field"		# title only shows in 2.3
					## <editText-options>
					#  [advanceFocusOnReturn]
		autoCap
		autoText
		initialText = "Single line, yummy TextField."
					#  [enabledTextColor = <color>]
					#  [disabledTextColor = <color>]
					#  [dontAcceptKeyRepeats]
		justifyLeft	#  [justifyLeft | justifyRight | justifyCenter]
					#  [readOnly]
		initiallySelectAll
					#  [maxLength = <integer>]
					#  [numericOnly]
					#  [passwordField]
					#  [alphaOnly]
					#  [ignoreNewlines]
					#  [emailAddress]
					#  [autoResize]
					#  [allCaps]
endDialog

#---------------------------------------------------------------------
# PasswordTextField demonstration dialog
#---------------------------------------------------------------------
# The key difference here is the choice of passwordField keyword,
# which will create the PasswordTextField instead of a TextField at
# runtime.

dialog ID_PASSWORD_TEXT_FIELD
	title = "danger.ui.PasswordTextField"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"

	// This is the Done button, and demonstrates how to have it send
	// a specific App event to fetch the user choice.
	button
		title = doneButton
		position = buttonBottom1
		shortcut = backButton
		event = EVENT_PASSWORD_TEXT_RESULT
		id = ID_PASSWORD_TEXT_DONE

	textField		## <widget-options> See complete list in file header.
		id = ID_PASSWORD_VIEW
		fillToRight = 10
		alignWithParentTop = 15
		alignWithParentLeft = 10
		initialFocus
		title = "Password?"		# title only shows in 2.3
					## <editText-options>
		advanceFocusOnReturn
					#  [autoCap]
					#  [autoText]
					#  [initialText = <quoted-string>
					#  [enabledTextColor = <color>]
					#  [disabledTextColor = <color>]
					#  [dontAcceptKeyRepeats]
		justifyLeft	#  [justifyLeft | justifyRight | justifyCenter]
					#  [readOnly]
					#  [initiallySelectAll]
					#  [maxLength = <integer>]
					#  [numericOnly]
		passwordField
					#  [alphaOnly]
					#  [ignoreNewlines]
					#  [emailAddress]
					#  [autoResize]
					#  [allCaps]
endDialog

#---------------------------------------------------------------------
# TypeAheadTextField demonstration dialog
#---------------------------------------------------------------------

dialog ID_TYPE_AHEAD_TEXT_FIELD
	title = "danger.ui.TypeAheadTextField"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault

	typeAheadTextField	## <widget-options> See complete list in file header.
		id = ID_TYPE_AHEAD_VIEW
		fillToRight = 10
		alignWithParentLeft = 10
		alignWithParentTop = 15
		title = "Sure, TypeAhead"
		initialFocus
					## <editText-options>
		advanceFocusOnReturn
		autoCap
		autoText
		initialText = "Type an 'a'..."
					#  [enabledTextColor = <color>]
					#  [disabledTextColor = <color>]
					#  [dontAcceptKeyRepeats]
		justifyLeft	#  [justifyLeft | justifyRight | justifyCenter]
					#  [readOnly]
		initiallySelectAll
					# doesn't work under 2.0 if initial focus
					#  [maxLength = <integer>]
					#  [numericOnly]
					#  [passwordField]
					#  [alphaOnly]
					#  [ignoreNewlines]
					#  [emailAddress]
					#  [autoResize]
					#  [allCaps]
endDialog

#---------------------------------------------------------------------
# LabeledGrid demonstration dialog
#---------------------------------------------------------------------

dialog ID_LABELED_GRID
	title = "danger.ui.LabeledGrid"
	width = kWindowWidth	height = kWindowHeight
	className = "LRDialogWindow"
	doneEvent = EVENT_DONE	doneIsDefault

	labeledGrid		## <widget-options> See complete list in file header.
		initialFocus
		alignWithParentLeft = 10
		alignWithParentTop = 5
		fillToRight = 10
		title = "LabeledGrid"
					## <labeledGrid-options>
					#  [horizontalGap = <integer>]
					#  [verticalGap = <integer>]
					#  [fixedWidthLeftColumn]
					#  [fixedWidthRightColumn]
		row			## <row-flags> + <widget-options>
					#  [dontResizeLeftView]
			dontResizeRightView
					#  [alignTop | alignBottom | alignEditTextSingleLine]
					#  [id = <id>]
			
			staticText
				text = "Bark:"
			textField
				initialText = "Hickory"
# There is a third view that can be added to the grid view, and any
# view is valid.  
# 			shape
#				fillColor = 0x00FF0000 
#				type = oval
#				width = 5
#				height = 5
		endRow

		row			## <row-flags> + <widget-options>
					#  [dontResizeLeftView]
			dontResizeRightView
					#  [alignTop | alignBottom | alignEditTextSingleLine]
					#  [id = <id>]
			
			staticText
				text = "Coffee:"
			textField
				initialText = "Chicory"
#			shape
#				fillColor = 0x0000FFFF 
#				type = rect
#				width = 5
#				height = 5
		endRow
	endLabeledGrid
endDialog

