gMaxWidth=max(
	zstring_width(zstring: '$$$/Dialogs/JSPrefs/Font'),
	zstring_width(zstring: '$$$/Dialogs/JSPrefs/FontSize'));

dialog(name: '$$$/Dialogs/JSPrefs', margin_height: 0, margin_width: 0)
{
	view(align_children: align_left, dheight: gPrefsPanelHeight, dwidth: gPrefsPanelWidth)
	{
		cluster(item_id: 'clu1', name: '$$$/Dialogs/JSPrefs/General', dwidth: gPrefsPanelWidth, align_children: align_left)
		{
			check_box(item_id: 'enab', name: '$$$/Dialogs/JSPrefs/Enable');
		}
		cluster(name: '$$$/Dialogs/JSPrefs/Security', dwidth: gPrefsPanelWidth, align_children: align_left)
		{
			check_box(item_id: 'enbm', name: '$$$/Dialogs/JSPrefs/MenuItems');
			check_box(item_id: 'enbg', name: '$$$/Dialogs/JSPrefs/Security/EnableGlobalSec');
		}
		cluster(name: '$$$/Dialogs/JSPrefs/Debugger', dwidth: gPrefsPanelWidth, align_children: align_left)
		{
			check_box(item_id: 'open', name: '$$$/Dialogs/JSPrefs/Open', next_tab: 'rad1');
		}
		cluster(item_id: 'clu2', name: '$$$/Dialogs/JSPrefs/Editor', dwidth: gPrefsPanelWidth, align_children: align_left)
		{
			radio(item_id: 'rad1', group_id: 'rgrp', name: '$$$/Dialogs/JSPrefs/Native');
			view(align_children: align_row)
			{
				gap();
				view(align_children: align_right, width : gMaxWidth)
				{
					static_text(name: '$$$/Dialogs/JSPrefs/Font');
				}
				view(align_children: align_left)
				{
					popup(item_id: 'font', width: max_char_width() * 18);
				}
			}
			view(align_children: align_row)
			{
				gap();
				view(align_children: align_right, width : gMaxWidth)
				{
					static_text(name: '$$$/Dialogs/JSPrefs/FontSize');
				}
				view(align_children: align_left)
				{
					edit_text(item_id: 'fsiz', width: max_char_width() * 3, PopupEdit: true, numeric: true);
				}
			}
			radio(item_id: 'rad2', group_id: 'rgrp', name: '$$$/Dialogs/JSPrefs/External');
			view(align_children: align_row)
			{
				gap(width: 8);
				edit_text(item_id: 'edit', width: max_char_width() * 25);
				button(item_id: 'bttn', width: 5, name: '$$$/Dialogs/JSPrefs/Path');
			}
		}
	}
}
