gMaxWidthButtons=max(
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/DoneButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/StartButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/RestartButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/UndoEditButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/ChangeButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/ChangeAllButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/IgnoreButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/IgnoreAllButton'),
	zstring_width(zstring: '$$$/Dialogs/SpellCheck/AddButton'));
gStatusLabelWidth=max(
	zstring_width(zstring: '$$$IDS_STATE_START'),
	zstring_width(zstring: '$$$IDS_STATE_COMPLETE'),
	zstring_width(zstring: '$$$IDS_STATE_NO_ERRORS'),
	zstring_width(zstring: '$$$IDS_STATE_CHECKING'));

gDictionaryPopupWidth = max_char_width() * 12;

gListBoxHeight = gEditTextHeight * 4;
gListBoxWidth = max_char_width() * 20;

gDictionary			= '$$$/Dialogs/SpellCheck/Dictionary';
gStatus				= '$$$/Dialogs/SpellCheck/Status';
gStartButton		= '$$$/Dialogs/SpellCheck/StartButton';
gIgnoreButton		= '$$$/Dialogs/SpellCheck/IgnoreButton';
gIgnoreAllButton	= '$$$/Dialogs/SpellCheck/IgnoreAllButton';
gAlternatives		= '$$$/Dialogs/SpellCheck/Alternatives';
gChangeButton		= '$$$/Dialogs/SpellCheck/ChangeButton';
gChangeAllButton	= '$$$/Dialogs/SpellCheck/ChangeAllButton';
gAddButton			= '$$$/Dialogs/SpellCheck/AddButton';
gDoneButton			= '$$$/Dialogs/SpellCheck/DoneButton';

dialog(name: '$$$/Dialogs/SpellCheck', target_id: 'Text')
{
	view(align_children: align_right)
	{
		static_text(item_id: 'stat', name: gStatus, width: gStatusLabelWidth, alignment: align_fill);
		view(align_children: align_top)
		{
			edit_text(item_id: 'Text', width: gListBoxWidth, height: gListBoxHeight, multiline: true);
			view(align_children: align_fill)
			{
				button(item_id: 'star', name: gStartButton, width: gMaxWidthButtons);
				button(item_id: 'iAll', name: gIgnoreAllButton, width: gMaxWidthButtons);
			}
		}
		static_text(item_id: 'sugg', name: gAlternatives, alignment: align_fill);
		view(align_children: align_top)
		{
			list_box(item_id: 'alst', width: gListBoxWidth, height: gListBoxHeight);
			view(align_children: align_fill)
			{
				button(item_id: 'chng', name: gChangeButton, width: gMaxWidthButtons);
				button(item_id: 'cAll', name: gChangeAllButton, width: gMaxWidthButtons);
			}
		}
		view(align_children: align_row)
		{
			static_text(item_id: 'dict', name: gDictionary);
			popup(item_id: 'dPop', width: gDictionaryPopupWidth);
			button(item_id: 'add ', name: gAddButton, width: gMaxWidthButtons);
		}
		gap();
		ok_cancel(	ok_name:		'$$$/Buttons/Done',
					cancel_name:	'$$$/Buttons/Cancel');
	}
}