gListWidth = max_char_width() * 20;
gListHeight = gEditTextHeight * 4;
gValidNoteHeight = gStaticTextHeight * 2;

gKeyTextWidth = max( zstring_width(zstring: '$$$/Dialogs/FDFOpenImport/Sender/Name'),
					zstring_width(zstring: '$$$/Dialogs/FDFOpenImport/Sender/Email') );
gDialogWidth = max( 
				zstring_width(zstring: '$$$/Dialogs/FDFOpenImportList/Note') + 20, 
				zstring_width(zstring: '$$$/Dialogs/FDFOpenImportList/TrustCheckBox') + 60,
				450 );
gImportButtonWidth = max( zstring_width(zstring: '$$$IDS_FDFOpenImportButtonContacts'),
					zstring_width(zstring: 'IDS_FDFOpenImportButtonDirSettings') );

gTrustTextWidth = zstring_width(zstring: '$$$IDS_FDFOpenDialogTrust_Contacts') + 18;

dialog(name: '$$$/Dialogs/FDFOpen/TitleImportList', target_id: 'name' )
{
	view(align_children: align_left, alignment: align_fill)
	{
		static_text(item_id: 'note', name: '$$$/Dialogs/FDFOpenImport/Note', width: gDialogWidth );
		view( align_children: align_top, alignment: align_fill )
		{
			gap(width: 5);
			static_text(item_id: 'type', alignment: align_fill, font_id: 5 );
		}

		cluster(name: '$$$/Dialogs/FDFOpenImport/Sender/ClusterName', align_children: align_left, alignment: align_fill )
		{
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/FDFOpenImport/Sender/Name', width: gKeyTextWidth, alignment: align_right);
				static_text(item_id: 'or1T', alignment: align_fill);
			}
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/FDFOpenImport/Sender/Email', width: gKeyTextWidth, alignment: align_right);
				static_text(item_id: 'or2T', alignment: align_fill);
			}

			cluster(name: '$$$/Dialogs/FDFOpenImportList/Signature/ClusterName', align_children: align_row, alignment: align_fill )
			{
				picture(item_id: 'icon', width: 32, height: 32);
				static_text(item_id: 'or3T', alignment: align_fill, height: gValidNoteHeight );
				button(item_id: 'sigB', name: '$$$/Dialogs/SigPropButton');
			}
		}

		cluster(name: '$$$/Dialogs/FDFOpenImportList/Contents/ClusterName', align_children: align_left, alignment: align_fill )
		{
			static_text(item_id: 'not1', alignment: align_fill );

			list_box( item_id: 'list', readonly: true, dheight: gListHeight, alignment: align_fill );

			view(align_children: align_top, alignment: align_fill)
			{
				picture(item_id: 'warn', width: 16, height: 15);
				static_text(item_id: 'not3', alignment: align_fill);
			}

			view( align_children: align_top, alignment: align_fill )
			{
				gap(width: 10);
				check_box(item_id: 'trCB', width: gTrustTextWidth, alignment: align_fill);
			}
		}

	    view( align_children: align_top, alignment: align_right )
		{
			button(item_id: 'impB', width: gImportButtonWidth);
			button(item_id: 'canB', name: '$$$/Dialogs/CloseButton');
		}
	}
}