gDocWarningsOptionsWidth = max( zstring_width(zstring:'$$$IDS_PREFS_Never'),
								zstring_width(zstring:'$$$IDS_PREFS_Always'),
								zstring_width(zstring:'$$$IDS_PREFS_OnlyWhenCertifying')) + 10;

gTopPopupTextWidth = max (	zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/DefaultSigningMethod'),
							zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/DefaultSigningFormat'));

gPopupWidth = min(13 * max_char_width(), 170);

gPromptWidth = max( zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/DefaultSigningMethod'),
					zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/DefaultSigningFormat'));

gButtonWidth = max( zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/NewAppearanceButton'),
					zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/EditAppearanceButton'),
					zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/CopyAppearanceButton'),
					zstring_width(zstring:'$$$/Dialogs/DigSigCreationPrefs/CopyAppearanceButton'));

gIndentWidth = 1 * max_char_width();

dialog(name: '$$$/Dialogs/DigSigCreationPrefs/DialogTitle')
{
	view(alignment: align_fill, align_children: align_left)
	{
		cluster(name: '$$$/Dialogs/DigSigCreationPrefs/Creation', alignment: align_fill, align_children: align_left, margin_height: 24 )
		{
			view(align_children: align_left)
			{	
				view(align_children: align_row, alignment: align_fill)
				{
					static_text(width: gTopPopupTextWidth, alignment: align_left, name: '$$$/Dialogs/DigSigCreationPrefs/DefaultSigningMethod');	
					popup(item_id: 'DSMD', width: gPopupWidth);
				}
				view(align_children: align_row, alignment: align_fill)
				{
					static_text(width: gTopPopupTextWidth, alignment: align_left, name: '$$$/Dialogs/DigSigCreationPrefs/DefaultSigningFormat' );	
					popup(item_id: 'frmt', width: gPopupWidth);
				}
				static_text(name:'$$$/Dialogs/DigSigCreationPrefs/WhenSigning', alignment: align_fill );
				view( align_children: align_row )
				{
					gap( width: gIndentWidth );
					view( align_children: align_left)
					{
						check_box(item_id:'reas', name:'$$$/Dialogs/DigSigCreationPrefs/AllowReason', alignment: align_fill );		
						check_box(item_id:'othr', name:'$$$/Dialogs/DigSigCreationPrefs/OtherInfo', alignment: align_fill );
						check_box(item_id:'erci', name:'$$$/Dialogs/DigSigCreationPrefs/EmbedRevCheckInfo', alignment: align_fill );
						check_box(item_id:'pmod', name:'$$$/Dialogs/DigSigCreationPrefs/SigPreviewMode', alignment: align_fill );
					}
				}
				view(align_children: align_row, alignment: align_fill) 
				{
					static_text( width: gPromptWidth, alignment: align_left, name:'$$$/Dialogs/DigSigCreationPrefs/ShowWarnings' );
					popup(item_id:'dwSW', width: gDocWarningsOptionsWidth, alignment: align_right );		
				}		
				view(align_children: align_row, alignment: align_fill) 
				{
					static_text( width: gPromptWidth, alignment: align_left, name:'$$$/Dialogs/DigSigCreationPrefs/RequireReview' );
					popup(item_id:'dwRR', width: gDocWarningsOptionsWidth, alignment: align_right );		
				}
				view(align_children: align_row, alignment: align_fill)
				{
				   check_box(item_id:'nwui', name:'$$$/Dialogs/DigSigCreationPrefs/EnableNewUI', alignment: align_fill );
				}
                view(align_children: align_row, alignment: align_fill)
                {
                    check_box(item_id:'ectk', name:'$$$/Dialogs/DigSigCreationPrefs/EnableCTK', alignment: align_fill );
                }
			}
		}

		cluster(name: '$$$/Dialogs/DigSigCreationPrefs/SigAppearance', alignment: align_fill, align_children: align_left, margin_height: 24 )
		{
			view( alignment: align_fill, align_children: align_row )
			{
				list_box( item_id: 'clst', alignment: align_left, width: 300, height: 150 );
				view( alignment: align_right )
				{
					button( item_id: 'newb', width: gButtonWidth, name: '$$$/Dialogs/DigSigCreationPrefs/NewAppearanceButton' );
					button( item_id: 'edit', width: gButtonWidth, name: '$$$/Dialogs/DigSigCreationPrefs/EditAppearanceButton' );
					button( item_id: 'copb', width: gButtonWidth, name: '$$$/Dialogs/DigSigCreationPrefs/CopyAppearanceButton' );
					button( item_id: 'delb', width: gButtonWidth, name: '$$$/Dialogs/DigSigCreationPrefs/DeleteAppearanceButton' );
				}
			}
		}

		ok_cancel_help();
	}
}
