gMaxWidth=max(
	zstring_width(zstring: '$$$/Dialogs/ReadingPrefs/Pitch'),
	zstring_width(zstring: '$$$/Dialogs/ReadingPrefs/WordRate'));

gReadOrderWidth = max(
	zstring_width(zstring: '$$$/Prefs/Access/ReadOrder/Inferred'),
	zstring_width(zstring: '$$$/Prefs/Access/ReadOrder/TBLR'),
	zstring_width(zstring: '$$$/Prefs/Access/ReadOrder/Wordy'));

gReadModeWidth = max(
	zstring_width(zstring: '$$$/Prefs/Access/ReadMode/Page'),
	zstring_width(zstring: '$$$/Prefs/Access/ReadMode/Doc'),
	zstring_width(zstring: '$$$/Prefs/Access/ReadMode/Auto'),
	zstring_width(zstring: '$$$/Prefs/Access/ReadMode/NoRead'));

dialog(name: '$$$/Dialogs/ReadingPrefs/Speech', margin_height: 0, margin_width: 0)
{
	view(align_children: align_left, dwidth: gPrefsPanelWidth)
	{

		cluster(item_id: 'Clus', name: '$$$/Prefs/Access/ReadMode/Title', alignment: align_fill)
		{
			view(align_children: align_left)
			{
				view(align_children: align_row)
				{
					static_text(item_id: 'MLbl', name: '$$$/Prefs/Access/ReadMode/Mode');
					popup(item_id: 'Mode', width: gReadModeWidth);
				}
				view(align_children: align_row)
				{
					gap(width: 4);
  					static_text(item_id: 'Labl', name: '$$$/Prefs/Access/ReadMode/LargeDoc');
  					edit_text(item_id: 'NumP', width: max_char_width()* 4, numeric: true);
				}
				view(align_children: align_row)
				{
					check_box(item_id: 'Alrt', name:'$$$/Prefs/Access/AskToTag');
					gap(width: 25);
					check_box(item_id: 'DocA', name:'$$$/Prefs/Access/UnixEnableDocAccess');
				}
			}
		}

		cluster(item_id: 'Read', name: '$$$/Prefs/Access/ReadOrder/Title')
		{
			view(align_children: align_left)
			{
				view(align_children: align_row)
				{
					static_text(name: '$$$/Prefs/Access/ReadOrder/Order');
					popup(item_id: 'Orde', width: gReadOrderWidth);
				}
				check_box(item_id: 'Ride', name:'$$$/Prefs/Access/ReadOrder/Override');
			}
		}
		
		cluster(name: '$$$/Dialogs/ReadingPrefs/Speech', dwidth: gPrefsPanelWidth, align_children: align_left)
		{
			view(align_children: align_row)
			{
				static_text(name: '$$$/Dialogs/ReadingPrefs/Volume');
				popup(item_id: 'volu', width: max_char_width() * 2);
			}
			check_box(item_id: 'DefV', name: '$$$/Dialogs/ReadingPrefs/DefaultVoice');
			view(align_children: align_row)
			{
				gap(width: 4);
				static_text(item_id: 'dlbl', name: '$$$/Dialogs/ReadingPrefs/Driver');
				popup(item_id: 'drvr', width: max_char_width() * 10);
				gap(width: 4);
				static_text(item_id: 'vlbl', name: '$$$/Dialogs/ReadingPrefs/Voice');
				popup(item_id: 'voic', width: max_char_width() * 10);
			}
			check_box(item_id: 'DefA', name: '$$$/Dialogs/ReadingPrefs/DefaultAttributes');
			view(align_children: align_row)
			{
				gap(width: 4);
				view(align_children: align_right, width : gMaxWidth)
				{
					static_text(item_id: 'plbl', name: '$$$/Dialogs/ReadingPrefs/Pitch');
				}
				popup(item_id: 'pitc', width: max_char_width() * 2);
			}
			view(align_children: align_row)
			{
				gap(width: 4);
				view(align_children: align_right, width : gMaxWidth)
				{
					static_text(item_id: 'rlbl', name: '$$$/Dialogs/ReadingPrefs/WordRate');
				}
				edit_text(item_id: 'rate', width: max_char_width() * 4, numeric: true);
			}
			check_box(item_id: 'fmsp', name: '$$$/Dialogs/ReadingPrefs/FormSpeech');
		}		
	}
}
