gMaxNameWidth = max_char_width() * 25;

gMaxTextWidth = max( 
	zstring_width(zstring: '$$$/Dialogs/CADMConfigureTSS/Server'),
	zstring_width(zstring: '$$$/Dialogs/CADMConfigureTSS/User'),
	zstring_width(zstring: '$$$/Dialogs/CADMConfigureTSS/Password'));

dialog(name: '$$$/Dialogs/CADMConfigureTSS/Title')
{
	view(align_children: align_left, alignment: align_fill)
	{
		view(align_children: align_row, alignment: align_fill)
		{
			static_text(name: '$$$/Dialogs/CADMConfigureTSS/Name');
			edit_text(item_id: 'name', width: gMaxNameWidth);
		}
		
		cluster(name: '$$$/Dialogs/CADMConfigureTSS/Settings')
		{
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(name: '$$$/Dialogs/CADMConfigureTSS/Server', width: gMaxTextWidth, alignment: align_right);
				edit_text(item_id: 'srvr', alignment: align_fill);
			}
			
			gap(height: gGap);
			
			check_box(item_id: 'auth', name: '$$$/Dialogs/CADMConfigureTSS/AuthReqd' );
			
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(item_id: 'usrT', name: '$$$/Dialogs/CADMConfigureTSS/User', width: gMaxTextWidth, alignment: align_right);
				edit_text(item_id: 'user', alignment: align_fill);
			}
			
			view(align_children: align_row, alignment: align_fill)
			{
				static_text(item_id: 'pwdT', name: '$$$/Dialogs/CADMConfigureTSS/Password', width: gMaxTextWidth, alignment: align_right);
				edit_text(item_id: 'pass', password: true, alignment: align_fill);
			}
			
			view(align_children: align_top, alignment: align_fill)
			{
				picture(item_id: 'icon', width: 16, height: 16);
				static_text(item_id: 'note', alignment: align_fill);
			}
		}
		
		ok_cancel();
	}
}
