BEGIN_EVENT_TABLE(wxProgressDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, wxProgressDialog::OnCancel)
BEGIN_EVENT_TABLE(wxProgressDialog, wxDialog)
EVT_BUTTON(wxID_CANCEL, wxProgressDialog::OnCancel)
EVT_CLOSE(wxProgressDialog::OnClose)
END_EVENT_TABLE()
IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
// ============================================================================
EVT_CLOSE(wxProgressDialog::OnClose)
END_EVENT_TABLE()
IMPLEMENT_CLASS(wxProgressDialog, wxDialog)
// ============================================================================
// ============================================================================
// ----------------------------------------------------------------------------
// ============================================================================
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
wxProgressDialog::wxProgressDialog(wxString const &title,
// ----------------------------------------------------------------------------
wxProgressDialog::wxProgressDialog(wxString const &title,
// we can't have values > 65,536 in the progress control under Windows, so
// scale everything down
m_factor = m_maximum / 65536 + 1;
// we can't have values > 65,536 in the progress control under Windows, so
// scale everything down
m_factor = m_maximum / 65536 + 1;
long widthText;
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
long widthText;
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
#else // !MSW
c->centreX.SameAs(this, wxCentreX);
#endif // MSW/!MSW
c->bottom.SameAs(this, wxBottom, 2*LAYOUT_Y_MARGIN);
c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
#else // !MSW
c->centreX.SameAs(this, wxCentreX);
#endif // MSW/!MSW
c->bottom.SameAs(this, wxBottom, 2*LAYOUT_Y_MARGIN);
// VZ: I like the labels be centered - if the others don't mind, you may
// remove "#ifdef __WXMSW__" and use it for all ports
// VZ: I like the labels be centered - if the others don't mind, you may
// remove "#ifdef __WXMSW__" and use it for all ports
c->left.SameAs(this, wxCentreX, LAYOUT_X_MARGIN);
#else // !MSW
c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
c->left.SameAs(this, wxCentreX, LAYOUT_X_MARGIN);
#else // !MSW
c->right.SameAs(this, wxRight, 2*LAYOUT_X_MARGIN);
+ (void)ShowModal();
+ }
+ else // auto 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();
// ----------------------------------------------------------------------------
// event handlers
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// event handlers
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// destruction
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// destruction
// ----------------------------------------------------------------------------