gEMRButtonWidth=max(
	zstring_width(zstring: '$$$/Dialogs/EmailReview/To'),
	zstring_width(zstring: '$$$/Dialogs/EmailReview/Cc'),
	zstring_width(zstring: '$$$/Dialogs/EmailReview/Bcc'));

gEMRLeftItemWidth=max(
	gEMRButtonWidth + 44,
	zstring_width(zstring: '$$$/Dialogs/EmailReview/Subject'),
	zstring_width(zstring: '$$$/Dialogs/EmailReview/Attachment'));

gEMRSubjectGap = gEMRLeftItemWidth - zstring_width(zstring: '$$$/Dialogs/EmailReview/Subject');
gEMRAttachGap = gEMRLeftItemWidth - zstring_width(zstring: '$$$/Dialogs/EmailReview/Attachment');

gEMRInstructionalWidth = max_digit_width() * 60;
gEMRStringLabelWidth = gEMRInstructionalWidth - gEMRLeftItemWidth;
gEMRAttachmentLabelWidth = zstring_width(zstring: '$$$/Dialogs/EmailReview/Attachment');
gEMRLabelItemWidth = gEMRAttachmentLabelWidth;

dialog(item_id: 'wtst', name: '$$$/Dialogs/EmailReview')
{
	view(align_children: align_left)
	{
		static_text(item_id:'txt1', name: '$$$/Dialogs/EmailReview/Txt1', height: gStaticTextHeight * 2, width: gEMRInstructionalWidth);
		static_text(item_id:'txt2', name: '$$$/Dialogs/EmailReview/Txt2', height: gStaticTextHeight * 5, width: gEMRInstructionalWidth);

		view(align_children: align_row, alignment: align_fill)
		{
			button(item_id: 'tobu', width: gEMRButtonWidth, name: '$$$/Dialogs/EmailReview/To');
			edit_text(item_id: 'toet', alignment: align_fill);
		}
		view(align_children: align_row, alignment: align_fill)
		{
			button(item_id: 'ccbu', width: gEMRButtonWidth, name: '$$$/Dialogs/EmailReview/Cc');
			edit_text(item_id: 'ccet', alignment: align_fill);
		}
		view(align_children: align_row, alignment: align_fill)
		{
			button(item_id: 'bccb', width: gEMRButtonWidth, name: '$$$/Dialogs/EmailReview/Bcc');
			edit_text(item_id: 'bcce', alignment: align_fill);
		}
		view(align_children: align_row, alignment: align_fill)
		{
			gap(width: gEMRSubjectGap);
			static_text(name: '$$$/Dialogs/EmailReview/Subject');
			edit_text(item_id: 'sube', alignment: align_fill);
		}
		view(align_children: align_top, alignment: align_fill)
		{
			gap(width: gEMRAttachGap);
			static_text(item_id:'atl ', name: '$$$/Dialogs/EmailReview/Attachment', width: gEMRLeftItemWidth, alignment: align_right );
			static_text(item_id:'atst', width: gEMRStringLabelWidth, height: gStaticTextHeight * 2);
		}
		view(alignment: align_left)
		{
			static_text(item_id: 'msgl', width: max_char_width() * 32);
		}
		view(align_children: align_center)
		{
			edit_text( item_id: 'boet', width: max_char_width() * 32, height: gEditTextHeight*5, alignment: align_fill, multiline: true);
		}
		view(alignment: align_left)
		{
			check_box(item_id: 'rall', name: '$$$/Dialogs/EmailReview/ReplyToAll');
		}
		ok_cancel_help(ok_name: '$$$/Dialogs/EmailReview/Send');
	}
}
