gPaneWidth	= 600;

gMaxStaticWidth	= max( zstring_width( zstring: '$$$/Dialogs/Multimedia/RenditionSettings/Name' ), 
					   zstring_width( zstring: '$$$/Dialogs/Multimedia/RenditionSettings/Volume' ), 
					   zstring_width( zstring: '$$$/Dialogs/Multimedia/RenditionSettings/Duration' ), 
					   zstring_width( zstring: '$$$/Dialogs/Multimedia/RenditionSettings/FitMode' )	);

gMaxPopupWidth	= max( zstring_width( zstring: '$$$IDS_DURATION_INFINITE' ), 
					   zstring_width( zstring: '$$$IDS_DURATION_INTRINSIC' ), 
					   zstring_width( zstring: '$$$IDS_DURATION_TIME' ) );

gSecondsWidth	= zstring_width( zstring: '$$$/Dialogs/Multimedia/RenditionSettings/Seconds' );
gListHeight		= 110;
gRowWidth		= gMaxStaticWidth + 266 + max_digit_width() * 4 + gSecondsWidth;
gMySpinWidth	= max_digit_width() * 5;

dialog( target_id: 'name', first_tab: 'st01' )
{
	view( align_children: align_left )
	{
		cluster( name: '$$$/Dialogs/Multimedia/RenditionSettings/PlaybackSettings', align_children: align_left, alignment: align_fill, dwidth: gPaneWidth )
		{
			view( align_children: align_row )
			{
				view( align_children: align_right, width: gMaxStaticWidth )
				{
					static_text( item_id: 'st01', name: '$$$/Dialogs/Multimedia/RenditionSettings/Duration', next_tab: 'dur ' );
				}

				view( align_children: align_left )
				{
					popup( item_id: 'dur ', width: gMaxPopupWidth, next_tab: 'secs' );
				}

				static_text( item_id: 'secs', name: '$$$/Dialogs/Multimedia/RenditionSettings/Seconds', alignment: align_right, next_tab: 'time' );
				edit_text( item_id: 'time', SpinEdit: true, numeric: true, width: gMySpinWidth, alignment: align_left, next_tab: 'st02' );
			}

			view( align_children: align_row )
			{
				view( align_children: align_right, width: gMaxStaticWidth )
				{
					static_text( item_id: 'st02', name: '$$$/Dialogs/Multimedia/RenditionSettings/Volume', next_tab: 'volm' );
				}

				edit_text( item_id: 'volm', SpinEdit: true, numeric: true, width: gMySpinWidth, alignment: align_left, next_tab: 'st03' );
				static_text( item_id: 'st03', name: '$$$/Dialogs/Multimedia/RenditionSettings/Percent', alignment: align_left, next_tab: 'ctrl' );
			}
			view( align_children: align_row )
			{
				gap(width: gMaxStaticWidth);
				check_box( item_id: 'ctrl', name: '$$$/Dialogs/Multimedia/RenditionSettings/ShowControls', next_tab: 'rpt ' );
			}
			view( align_children: align_row )
			{
				gap(width: gMaxStaticWidth);
				check_box( item_id: 'rpt ', name: '$$$/Dialogs/Multimedia/RenditionSettings/Loop', next_tab: 'inf ' );
			}

			view( align_children: align_row )
			{
				gap( width: gMaxStaticWidth + gGap + gGap );
				view( align_children: align_left )
				{
					group()
					{
						radio( item_id: 'inf ', group_id: 'rgrp', name: '$$$/Dialogs/Multimedia/RenditionSettings/Infinite', next_tab: 'loop' );

						view( align_children: align_row )
						{
							radio( item_id: 'loop', group_id: 'rgrp', name: '$$$/Dialogs/Multimedia/RenditionSettings/LoopCount', next_tab: 'lnum' );
							edit_text( item_id: 'lnum', SpinEdit: true, numeric: true, width: gMySpinWidth, alignment: align_left, next_tab: 'plst' );
						}
					}
				}
			}
		}

		cluster( name: '$$$/Dialogs/Multimedia/RenditionSettings/PlayerList', align_children: align_left, alignment: align_fill, dwidth: gPaneWidth )
		{
			mclv( item_id: 'plst', alignment: align_fill, height: gListHeight, width: gRowWidth, next_tab: 'add ' );
			
			view( alignment: align_right, align_children: align_row )
			{
				button( item_id: 'add ', name: '$$$/Dialogs/Multimedia/RenditionSettings/Add', next_tab: 'edit' );
				button( item_id: 'edit', name: '$$$/Dialogs/Multimedia/RenditionSettings/Edit', next_tab: 'remv' );
				button( item_id: 'remv', name: '$$$/Dialogs/Multimedia/RenditionSettings/Remove' );
			}
		}
	}
}
