fix for losing focus under Windows after showing the progress dialog
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16900 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -268,7 +268,11 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
|
|||||||
|
|
||||||
// Update the display (especially on X, GTK)
|
// Update the display (especially on X, GTK)
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// FIXME: shouldn't be needed
|
||||||
|
#ifdef __WXX11__
|
||||||
wxYield();
|
wxYield();
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
MacUpdateImmediately();
|
MacUpdateImmediately();
|
||||||
@@ -333,7 +337,11 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
m_msg->SetLabel(newmsg);
|
m_msg->SetLabel(newmsg);
|
||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// FIXME: shouldn't be needed
|
||||||
|
#ifdef __WXX11__
|
||||||
wxYield();
|
wxYield();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
|
if ( (m_elapsed || m_remaining || m_estimated) && (value != 0) )
|
||||||
@@ -347,7 +355,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
SetTimeLabel(remaining, m_remaining);
|
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
|
// so that we return TRUE below and that out [Cancel] handler knew what
|
||||||
// to do
|
// to do
|
||||||
@@ -360,7 +368,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
m_btnAbort->SetLabel(_("Close"));
|
m_btnAbort->SetLabel(_("Close"));
|
||||||
}
|
}
|
||||||
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
#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);
|
EnableCloseButton(TRUE);
|
||||||
}
|
}
|
||||||
@@ -373,21 +381,33 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// FIXME: shouldn't be needed
|
||||||
|
#ifdef __WXX11__
|
||||||
wxYield();
|
wxYield();
|
||||||
|
#endif
|
||||||
|
|
||||||
(void)ShowModal();
|
(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();
|
ReenableOtherWindows();
|
||||||
|
|
||||||
|
Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// update the display
|
// update the display
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// FIXME: shouldn't be needed
|
||||||
|
#ifdef __WXX11__
|
||||||
wxYield();
|
wxYield();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
Reference in New Issue
Block a user