gMaxCharWidth = 13;
gProgressBarWidth = 250;

gMaxLabelWidth = max(zstring_width(zstring: '$$$/Dialogs/SearchFind/StatusC'), 
					zstring_width(zstring: '$$$/Dialogs/SearchFind/SearchingC'), 
					zstring_width(zstring: '$$$/Dialogs/SearchFind/FileCountC'), 
					zstring_width(zstring: '$$$/Dialogs/SearchFind/PageC'), 
					zstring_width(zstring: '$$$/Dialogs/SearchFind/ProgressC'));

gMaxItemWidth = max(zstring_width(zstring: '$$$IDS_EMBEDDING_JOB_BEING_PROCESSED'), 
					zstring_width(zstring: '$$$IDS_SCANNING_DOCUMENTS'), 
					zstring_width(zstring: '$$$IDS_INDEXING'), 
					zstring_width(zstring: '$$$IDS_EMBEDDING_INDEX'), 
					zstring_width(zstring: '$$$IDS_SAVING_DOCUMENT'),
					zstring_width(zstring: '$$$IDS_POST_PROCESSING'),
					zstring_width(zstring: '$$$IDS_EMBEDDING_COMPLETED'),
					zstring_width(zstring: '$$$IDS_UPDATING_COMPLETED'),
					zstring_width(zstring: '$$$IDS_CANCELLING'));
					
gProgressBarWidth = max(250, gMaxLabelWidth + gMaxItemWidth);
					
dialog(name: '$$$/Dialogs/SearchFind/EmbedIndex', first_tab: 'M010')
{
	buttonWidth = (gMaxCharWidth) + max(
		zstring_width(zstring: '$$$/Dialogs/SearchFind/xEmbed'),
		zstring_width(zstring: '$$$/Dialogs/SearchFind/xRemove'),
		zstring_width(zstring: '$$$/Dialogs/SearchFind/xUpdate'));

	gMessageBoxWidth = gProgressBarWidth + buttonWidth + gMaxCharWidth*5;

	view(align_children: align_center)
	{
		static_text(item_id: 'M022', name: '$$$/Dialogs/SearchFind/StatusIndex', width: gMessageBoxWidth, alignment: align_left);
		view(align_children: align_top )
		{
			cluster(align_children: align_left)
			{
				view(align_children: align_row)
				{
					static_text(name: '$$$/Dialogs/SearchFind/StatusC', width: gMaxLabelWidth, alignment: align_right); 
					static_text(item_id: 'M001', name: '$$$/Dialogs/SearchFind/Ready', width: gMaxItemWidth);
				}

				view(align_children: align_row)
				{
					static_text(name: '$$$/Dialogs/SearchFind/ProgressC', width: gMaxLabelWidth, alignment: align_right); 
					static_text(item_id: 'M006', width: gMaxCharWidth*4);
				}
			
				view(align_children: align_row, alignment: align_fill)
				{
					progress_bar(item_id: 'M011', width: gProgressBarWidth, alignment:align_center );
				}
				
			}

			view(align_children:align_center)
			{
				gap(height:5);
				button(item_id: 'M010', name: '$$$/Dialogs/SearchFind/xEmbed', width: buttonWidth, next_tab: 'M012');
				button(item_id: 'M012', name: '$$$/Dialogs/SearchFind/xRemove', width: buttonWidth, next_tab: 'M014');
				button(item_id: 'M014', name: '$$$/Dialogs/SearchFind/xUpdate', width: buttonWidth, next_tab: 'M020');
			}
		}
	
		view(align_children: align_row)
		{	
			button(item_id: 'M007', name: '$$$/Dialogs/SearchFind/Stop', alignment: align_right);
			button(item_id: 'M020', name: '$$$/Dialogs/SearchFind/xClose');
		}
	}	
}
