// Update the display (especially on X, GTK)
wxYield();
- wxYield();
#ifdef __WXMAC__
MacUpdateImmediately();
wxASSERT_MSG( value <= m_maximum, wxT("invalid progress value") );
- if ( m_gauge )
+ if ( m_gauge && value < m_maximum )
{
m_gauge->SetValue(value + 1);
}
m_msg->SetLabel(newmsg);
wxYield();
- wxYield();
}
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
SetTimeLabel(remaining, m_remaining);
}
- if ( (value == m_maximum ) )
+ if ( value == m_maximum )
{
// so that we return TRUE below and that out [Cancel] handler knew what
// to do
m_btnAbort->SetLabel(_("Close"));
}
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
- else // enable the close button to give the user a way to close the dlg
+ else // enable the button to give the user a way to close the dlg
{
EnableCloseButton(TRUE);
}
m_msg->SetLabel(_("Done."));
}
- wxYield();
wxYield();
(void)ShowModal();
}
- else
+ else // auto hide
{
- Hide();
+ // reenable other windows before hiding this one because otherwise
+ // Windows wouldn't give the focus back to the window which had
+ // been previously focused because it would still be disabled
ReenableOtherWindows();
+
+ Hide();
}
}
else
{
// update the display
wxYield();
- wxYield();
}
#ifdef __WXMAC__
m_btnAbort->Enable();
}
+bool wxProgressDialog::Show( bool show )
+{
+ // reenable other windows before hiding this one because otherwise
+ // Windows wouldn't give the focus back to the window which had
+ // been previously focused because it would still be disabled
+ if(!show)
+ ReenableOtherWindows();
+
+ return wxDialog::Show(show);
+}
+
// ----------------------------------------------------------------------------
// event handlers
// ----------------------------------------------------------------------------