gTypeWidth=max(
	zstring_width(zstring: '$$$IDS_FORMAT_GENERAL_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_NUMBER_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_PERCENT_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_DATE_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_TIME_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_SECURE_MASKED_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_SPECIAL_NAME'),
	zstring_width(zstring: '$$$IDS_FORMAT_CUSTOM_NAME'));

gDescriptionWidth=max(
	zstring_width(zstring: '$$$IDS_FORMAT_GENERAL_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_NUMBER_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_PERCENT_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_DATE_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_TIME_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_SECURE_MASKED_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_SPECIAL_DESC'),
	zstring_width(zstring: '$$$IDS_FORMAT_CUSTOM_DESC'));

gOneColWidth = max(
	zstring_width(zstring: '$$$/Dialogs/PropsFormat/DecimalPlaces'),
	zstring_width(zstring: '$$$/Dialogs/PropsFormat/SeparatorStyle'),
	zstring_width(zstring: '$$$/Dialogs/PropsFormat/CurrencySymbol'),
	zstring_width(zstring: '$$$/Dialogs/PropsFormat/CurrencySymbolLocation'),
	zstring_width(zstring: '$$$/Dialogs/PropsFormat/NegativeNumberStyle'),
	zstring_width(zstring: '$$$IDS_FORMAT_EXAMPLE')
	);

gCategory		= '$$$IDS_FORMAT_CATEGORY';
gCurrentExample = '$$$IDS_FORMAT_EXAMPLE';

gFormatWidth		= 224;
gClusterHeight		= 168;
gDescHeight			= gEditTextHeight * ( gDescriptionWidth / gFormatWidth);
gCategoryWidth		= zstring_width(zstring: gCategory);
gCurrentExampleWidth= zstring_width(zstring: gCurrentExample);

gSpecifyNumberOptions = '$$$/Dialogs/PropsFormat/SpecifyNumberOptions';
gSpecifyPercentOptions = '$$$/Dialogs/PropsFormat/SpecifyPercentOptions';
gChooseDateFormat = '$$$/Dialogs/PropsFormat/ChooseDateFormat';
gChooseTimeFormat = '$$$/Dialogs/PropsFormat/ChooseTimeFormat';
gChooseSpecialFormat = '$$$/Dialogs/PropsFormat/ChooseSpecialFormat';

gPopupWidth = max_char_width() * 9;
gNumberPanelWidth = gOneColWidth + gPopupWidth;

gJavaEditWidth = max_char_width() * 22;
gEditButtonWidth = zstring_width(zstring: '$$$/Dialogs/FieldProps/Edit');
gCustomPanelWidth = gJavaEditWidth + gEditButtonWidth;

gClusterWidth = max( gCustomPanelWidth, gNumberPanelWidth);
gHintWidth = gClusterWidth - 32;
gHintHeight = gEditTextHeight*3;

dialog(name: '$$$/Dialogs/FieldProps', target_id: 'type', first_tab: 'type')
{
	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: gCategoryWidth)
				{			
					static_text(item_id: 'dsc1', name: gCategory, width: gCategoryWidth);
				}
				popup(item_id: 'type', width: gTypeWidth, next_tab: 'c0p1');
			}
			cluster(item_id: 'clu0', align_children: align_left, width: gClusterWidth)
			{
				view(align_children: align_offscreen)
				{
					view(align_children: align_left)
					{
						gap(height: gEditTextHeight/4);
						view(align_children: align_row, alignment: align_fill)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'c0s1', name: '$$$/Dialogs/PropsFormat/DecimalPlaces');
							}
							popup(item_id: 'c0p1', width: max_char_width() * 2, next_tab: 'c0p2');
						}
						view(align_children: align_row, alignment: align_fill)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'c0s2', name: '$$$/Dialogs/PropsFormat/SeparatorStyle');
							}
							popup(item_id: 'c0p2', width: gPopupWidth, next_tab: 'c0p3');
						}
						view(align_children: align_row, alignment: align_fill)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'c0s3', name: '$$$/Dialogs/PropsFormat/CurrencySymbol');
							}
							popup(item_id: 'c0p3', width: gPopupWidth, next_tab: 'c0p4');
						}
						view(align_children: align_row, alignment: align_fill)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'c0s4', name: '$$$/Dialogs/PropsFormat/CurrencySymbolLocation');
							}
							popup(item_id: 'c0p4', width: gPopupWidth, next_tab: 'c0b1');
						}
						view(align_children: align_top)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'c0c1', name: '$$$/Dialogs/PropsFormat/NegativeNumberStyle');
							}
							view(align_children: align_left)
							{
								check_box(item_id: 'c0b1', name: '$$$/Dialogs/PropsFormat/Parentheses', next_tab: 'c0b2');
								check_box(item_id: 'c0b2', name: '$$$/Dialogs/PropsFormat/RedText', next_tab: 'c1l1');
							}
						}
					}
					view(align_children: align_row, alignment: align_fill)
					{
						gap(height: gEditTextHeight/4);
						view(align_children: align_left)
						{
							list_box(item_id: 'c1l1', width: max_char_width() * 17, height: gEditTextHeight * 5, next_tab: 'c1e1');
							edit_text(item_id: 'c1e1', width: max_char_width() * 17, next_tab: 'c2e1');
						}
					}
					view(align_children: align_left)
					{
						gap(height: gEditTextHeight/4);
						static_text(item_id: 'c2s1', name: '$$$/Dialogs/PropsFormat/CustomFormatScript');
						view(align_children: align_top)
						{
							edit_text(item_id: 'c2e1', readonly: true, multiline: true, height: gEditTextHeight * 3, width: gJavaEditWidth, next_tab: 'c2b1');
							button(item_id: 'c2b1', name:'$$$/Dialogs/FieldProps/Edit', width: gEditButtonWidth, next_tab: 'c2e2');
						}
						static_text(item_id: 'c2s2', name: '$$$/Dialogs/PropsFormat/CustomKeystrokeScript');
						view(align_children: align_top)
						{
							edit_text(item_id: 'c2e2', readonly: true, multiline: true, height: gEditTextHeight * 3, width: gJavaEditWidth, next_tab: 'c2b2');
							button(item_id: 'c2b2', name:'$$$/Dialogs/FieldProps/Edit2', width: gEditButtonWidth, next_tab: 'type');
						}
					}
					view(align_children: align_left)
					{
						view(align_children: align_row)
						{
							static_text(item_id: 'c3s1', name: '$$$/Dialogs/PropsFormat/MaskUsing1');
							edit_text(item_id: 'c3e1', width: 2 * max_char_width(), next_tab: 'c3e2');
							static_text(item_id: 'c3s2', name: '$$$/Dialogs/PropsFormat/MaskUsing2');
						}
						static_text(item_id: 'c3s3', name: '$$$/Dialogs/PropsFormat/MaskAllExcept');
						view(align_children: align_row)
						{
							gap();
							static_text(item_id: 'c3s4', name: '$$$/Dialogs/PropsFormat/UnmaskFirst1');
							edit_text(item_id: 'c3e2', width: max_char_width() * 2, next_tab: 'c3e3');
							static_text(item_id: 'c3s5', name: '$$$/Dialogs/PropsFormat/UnmaskFirst2');
						}
						view(align_children: align_row)
						{
							gap();
							static_text(item_id: 'c3s6', name: '$$$/Dialogs/PropsFormat/UnmaskLast1');
							edit_text(item_id: 'c3e3', width: max_char_width() * 2, next_tab: 'type');
							static_text(item_id: 'c3s7', name: '$$$/Dialogs/PropsFormat/UnmaskLast2');
						}
					}
				}
				view( align_children: align_offscreen)
				{
					view(align_children: align_left)
					{
						gap(height: gGap);
						view(align_children: align_row, alignment: align_fill)
						{
							view(align_children: align_right, width: gOneColWidth)
							{
								static_text(item_id: 'stet', name: '$$$IDS_FORMAT_EXAMPLE');						
							}
							picture(item_id: 'stex', width: max_char_width() * 10, height: gEditTextHeight);
						}
					}
				}
			}
			cluster(align_children:align_left, width: gClusterWidth)
			{
				gap(height: gEditTextHeight/2);
				view(align_children:align_top)
				{	
					picture(item_id: 'bulb', width: 32, height: 32);
					static_text(item_id: 'dsc3', mutliline:true, width: gClusterWidth, height: gHintHeight);
				}
			}
		}
	}
}
