gValidNoteWidth = max_char_width() * 22;
gValidNoteHeight = gStaticTextHeight * 9;

gMaxButtonWidth = 25 + max(
	zstring_width(zstring: '$$$/Dialogs/SigProperties/ShowCertificateButton'),
	zstring_width(zstring: '$$$/Dialogs/SigProperties/ImportCertificateButton'));

gPropertyLabelWidth = max(
	zstring_width(zstring: '$$$/Dialogs/SigProperties/SigInfo/Name'),
	zstring_width(zstring: '$$$/Dialogs/SigProperties/SigInfo/Date'),
	zstring_width(zstring: '$$$/Dialogs/SigProperties/SigInfo/ContactInfo'),
	zstring_width(zstring: '$$$/Dialogs/SigProperties/SigInfo/Reason'),
	zstring_width(zstring: '$$$/Dialogs/SigProperties/SigInfo/Location'));

dialog(name: '$$$/Dialogs/SigProperties', target_id: 'name' )
{
    group()
	{
		cluster(name: '$$$/Dialogs/SigProperties/ValidInfo/ClusterName', align_children: align_distribute, alignment: align_fill )
		{
			picture(item_id: 'icon', width: 32, height: 32);
			static_text(item_id: 'ValT', width: gValidNoteWidth, height: gValidNoteHeight );
			button(item_id: 'ValB', name: '$$$/Dialogs/SigProperties/SigInfo/ValidateButton');
		}
		cluster(name: '$$$/Dialogs/SigProperties/SigInfo/ClusterName', alignment: align_fill, align_children: align_left)
		{
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/Name', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'name', readonly: true, alignment: align_fill);
				button(item_id: 'cert', name: '$$$/Dialogs/SigProperties/ShowCertificateButton', width: gMaxButtonWidth);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/Date', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'date', readonly: true, alignment: align_fill);
				button(item_id: 'impo', name: '$$$/Dialogs/SigProperties/ImportCertificateButton', width: gMaxButtonWidth);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/Reason', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'reas', readonly: true, alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/Location', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'loca', readonly: true, alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/ContactInfo', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'cont', readonly: true, alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/MDP', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'dete', readonly: true, alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/SigProperties/SigInfo/Method', width: gPropertyLabelWidth, alignment: align_right);
				edit_text(item_id: 'filt', readonly: true, alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				picture(item_id: 'ico2', width: 16, height: 15);
				static_text(item_id: 'not2', name: '$$$/Dialogs/SigProperties/InfoNote' );
			}

		}
		cluster(item_id: 'RevC', name: '$$$/Dialogs/SigProperties/Revision/ClusterName', align_children: align_row, alignment: align_fill )
		{
			static_text(item_id: 'RevT', name: '$$$/Dialogs/SigProperties/Revision/RevisionText', alignment: align_fill, height: gStaticTextHeight * 2 );
			button(item_id: 'RevB', name: '$$$/Dialogs/SigProperties/Revision/RevisionButton');
		}

 		view(align_children: align_right, alignment: align_fill)
		{
			view(align_children: align_top)
			{
				button(item_id: 'LegB', name: '$$$/Dialogs/LegalNoticeButton');
				button(item_id: 'Okay', name: '$$$/Dialogs/CloseButton');
			}
		}
	}
}