public void ShowLoadingBar( int numGroupsInit, int numGroupsLoad, Real initProportion )
{
if ( LoadBar != null )
{
HideLoadingBar();
return;
}
LoadBar = new ProgressBar( mName + "/LoadingBar", "Loading...", 400, 308 );
OverlayElement e = LoadBar.OverlayElement;
mDialogShade.AddChild( e );
e.VerticalAlignment = VerticalAlignment.Center;
e.Left = ( -( e.Width / 2 ) );
e.Top = ( -( e.Height / 2 ) );
ResourceGroupManager.Instance.AddResourceGroupListener( this );
CursorWasVisible = IsCursorVisible;
HideCursor();
mDialogShade.Show();
// calculate the proportion of job required to init/load one group
if ( numGroupsInit == 0 && numGroupsLoad != 0 )
{
groupInitProportion = 0;
groupLoadProportion = 1;
}
else if ( numGroupsLoad == 0 && numGroupsInit != 0 )
{
groupLoadProportion = 0;
if ( numGroupsInit != 0 )
groupInitProportion = 1;
}
else if ( numGroupsInit == 0 && numGroupsLoad == 0 )
{
groupInitProportion = 0;
groupLoadProportion = 0;
}
else
{
groupInitProportion = initProportion / numGroupsInit;
groupLoadProportion = ( 1 - initProportion ) / numGroupsLoad;
}
}