gNameWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Name'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/ToolTip'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/FieldType'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/ESRole'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/SignerEmail'));

gEditItemWidth = max_char_width() * 20;
gGroupNamePopupWidth = gEditItemWidth - 45;

gPopupWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Orientation'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Visibility'));

gOrientationWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Rotation/ZERO'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Rotation/NINTY'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Rotation/ONEEIGHTY'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Rotation/TWOSEVENTY'));

gVisibilityPopupWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/View/VISIBLE'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/View/HIDDEN'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/View/NOPRINT'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/View/NOVIEW'));

gRolePopupWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Sender'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer1'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer2'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer3'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer4'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer5'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Role/Signer6'));

gTypePopupWidth = max(
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Sig'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/SigBlock'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Initial'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Title'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Company'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Name'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Email'),
	zstring_width(zstring: '$$$/Dialogs/FieldProps/Type/Date'));

gName = '$$$/Dialogs/FieldProps/Name';
gToolTip = '$$$/Dialogs/FieldProps/ToolTip';
gGroupName = '$$$/Dialogs/FieldProps/Group';
gCommonProps = '$$$/Dialogs/FieldProps/CommonProps';
gReadOnly = '$$$/Dialogs/FieldProps/ReadOnly';
gRequired = '$$$/Dialogs/FieldProps/Required';
gVisibility = '$$$/Dialogs/FieldProps/Visibility';
gOrientation = '$$$/Dialogs/FieldProps/Orientation';
gDegrees = '$$$/Dialogs/FieldProps/Degrees';
gType = '$$$/Dialogs/FieldProps/FieldType';
gRole = '$$$/Dialogs/FieldProps/ESRole';
gSignerEmail = '$$$/Dialogs/FieldProps/SignerEmail';


dialog(name: '$$$/Dialogs/FieldProps', target_id: 'name')
{
	view(align_children: align_top, alignment: align_fill)
	{
		view(align_children: align_left, alignment: align_fill)
		{
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'snam', name: gName);
				}
				view(align_children: align_left)
				{
					edit_text(item_id: 'name', width: gEditItemWidth);
				}
			}
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'stti', name: gToolTip);
				}
				view(align_children: align_left)
				{
					edit_text(item_id: 'ttip', width: gEditItemWidth);
				}
			}
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'sgnt', name: gGroupName);
				}
				view(align_children: align_left)
				{
					edit_text(item_id: 'grpn', width: gGroupNamePopupWidth, PopupEdit: true);
				}
			}
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'sfty', name: gType);
				}
				view(align_children: align_fill, alignment: align_fill)
				{
					popup(item_id: 'fldt', width: gTypePopupWidth);
				}
			}
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'srol', name: gRole);
				}
				view(align_children: align_fill, alignment: align_fill)
				{
					popup(item_id: 'role', width: gRolePopupWidth);
				}
			}
			view(align_children: align_row, alignment: align_fill)
			{
				view(align_children: align_right, width: gNameWidth)
				{
					static_text(item_id: 'seml', name: gSignerEmail);
				}
				view(align_children: align_fill, alignment: align_fill)
				{
					edit_text(item_id: 'veml', width: gEditItemWidth);
				}
			}
			gap(width: gGap);

			cluster(item_id:'clcp', name: gCommonProps, align_children: align_row)
			{
				view(align_children: align_left)
				{
					view(align_children: align_row, alignment: align_fill)
					{
						view(align_children: align_right, width: gPopupWidth)
						{
							static_text(name: gVisibility);
						}
						view(align_children: align_fill, alignment: align_fill)
						{
							popup(item_id: 'vsbl', width: gVisibilityPopupWidth);
						}
					}
					view(align_children: align_row)
					{
						view(align_children: align_right, width: gPopupWidth)
						{
							static_text(name: gOrientation);
						}
						view(align_children: align_left)
						{
							popup(item_id: 'rota', width: gOrientationWidth);
						}
						view(align_children: align_left)
						{
							static_text(name: gDegrees);
						}
					}
				}
				gap(width: gGap);
				gap(width: gGap);
				view(alignment: align_right, align_children: align_left)
				{
					view(align_children: align_row)
					{
						check_box(item_id: 'read', name: gReadOnly);
					}
					view(align_children: align_row)
					{
						check_box(item_id: 'reqd', name: gRequired);
					}
				}
			}
		}
	}
}
