1. wxProgressDialog uses wxWindowDisabler, not (dumb) wxEnableTopLevelWindows

2. some more wxWindowDisabler bugs fixed (updated dialogs sample to test them)
3. Esc won't close the dialogs without cancel button under MSW
4. status bar can be child of windows of clases other than wxFrame
   (updated statbar sample to show it)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-03-12 00:26:21 +00:00
parent 5028104652
commit cbc66a2704
10 changed files with 128 additions and 90 deletions

View File

@@ -103,14 +103,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
wxClientDC dc(this);
dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
long widthText;
#if defined(__VISAGECPP__)
// have two versions of this in wxWindowDC tp avoid function hiding
// since there are two of these in wxDCBase, and in turn in wxDC.
// VA cannot resolve this so:
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
#else
dc.GetTextExtent(message, &widthText, (long*)NULL);
#endif
m_msg = new wxStaticText(this, -1, message);
c = new wxLayoutConstraints;
@@ -218,14 +211,15 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
Centre(wxCENTER_FRAME | wxBOTH);
if ( !(style & wxPD_APP_MODAL) )
if ( style & wxPD_APP_MODAL )
{
if ( m_parentTop )
m_parentTop->Enable(FALSE);
m_winDisabler = new wxWindowDisabler(this);
}
else
{
wxEnableTopLevelWindows(FALSE);
if ( m_parentTop )
m_parentTop->Enable(FALSE);
m_winDisabler = NULL;
}
Show(TRUE);
@@ -389,14 +383,14 @@ void wxProgressDialog::OnClose(wxCloseEvent& event)
wxProgressDialog::~wxProgressDialog()
{
if ( !(GetWindowStyle() & wxPD_APP_MODAL) )
if ( GetWindowStyle() & wxPD_APP_MODAL )
{
if ( m_parentTop )
m_parentTop->Enable(TRUE);
delete m_winDisabler;
}
else
{
wxEnableTopLevelWindows(TRUE);
if ( m_parentTop )
m_parentTop->Enable(TRUE);
}
}