wxLayoutConstraints *c;
wxClientDC dc(this);
- dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
+ dc.SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
long widthText;
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
#endif // MSW/!MSW
c->bottom.SameAs(this, wxBottom, 2*LAYOUT_Y_MARGIN);
- wxSize sizeBtn = wxButton::GetDefaultSize();
- c->width.Absolute(sizeBtn.x);
- c->height.Absolute(sizeBtn.y);
+ c->width.AsIs();
+ c->height.AsIs();
m_btnAbort->SetConstraints(c);
- sizeDlg.y += 2*LAYOUT_Y_MARGIN + sizeBtn.y;
+ sizeDlg.y += 2*LAYOUT_Y_MARGIN + wxButton::GetDefaultSize().y;
}
- else
+ else // no "Cancel" button
+ {
m_btnAbort = (wxButton *)NULL;
+ }
SetAutoLayout(TRUE);
Layout();
SetTimeLabel(remaining, m_remaining);
}
- if ( (value == m_maximum ) && !(GetWindowStyle() & wxPD_AUTO_HIDE) )
+ if ( (value == m_maximum ) )
{
- if ( m_btnAbort )
+ // so that we return TRUE below and that out [Cancel] handler knew what
+ // to do
+ m_state = Finished;
+ if( !(GetWindowStyle() & wxPD_AUTO_HIDE) )
{
- // tell the user what he should do...
- m_btnAbort->SetLabel(_("Close"));
- }
+ if ( m_btnAbort )
+ {
+ // tell the user what he should 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
- {
- EnableCloseButton(TRUE);
- }
+ else // enable the close button to give the user a way to close the dlg
+ {
+ EnableCloseButton(TRUE);
+ }
#endif // __WXMSW__
- if ( !newmsg )
- {
- // also provide the finishing message if the application didn't
- m_msg->SetLabel(_("Done."));
- }
-
- // so that we return TRUE below and that out [Cancel] handler knew what
- // to do
- m_state = Finished;
+ if ( !newmsg )
+ {
+ // also provide the finishing message if the application didn't
+ m_msg->SetLabel(_("Done."));
+ }
- wxYield();
+ wxYield();
- (void)ShowModal();
+ (void)ShowModal();
+ }
+ else
+ {
+ Hide();
+ ReenableOtherWindows();
+ }
}
else
{