diff --git a/include/wx/defs.h b/include/wx/defs.h index 87f846741f..c5bba8db2c 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -926,14 +926,16 @@ enum wxStretch #endif #define wxDEFAULT_FRAME_STYLE \ - (wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN) + (wxSYSTEM_MENU | wxRESIZE_BORDER | \ + wxMINIMIZE_BOX | wxMAXIMIZE_BOX | \ + wxCAPTION | wxCLIP_CHILDREN) #ifdef __WXMSW__ -# define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME) +# define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU | wxCAPTION) #else -// Under Unix, the dialogs don't have a system menu. Specifying -// wxSYSTEM_MENU here, will make a close button appear. -# define wxDEFAULT_DIALOG_STYLE (wxCAPTION|wxTHICK_FRAME) +// Under Unix, the dialogs don't have a system menu. Specifying wxSYSTEM_MENU +// here will make a close button appear. +# define wxDEFAULT_DIALOG_STYLE wxCAPTION #endif /* diff --git a/src/common/list.cpp b/src/common/list.cpp index 9bbe3d99a0..0e326ee1f5 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -204,7 +204,7 @@ void wxListBase::DoCopy(const wxListBase& list) } } - wxASSERT_MSG( m_count = list.m_count, _T("logic error in wxList::DoCopy") ); + wxASSERT_MSG( m_count == list.m_count, _T("logic error in wxList::DoCopy") ); } wxListBase::~wxListBase() diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 32b6f18d88..99a3797604 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -100,10 +100,6 @@ private: wxArrayInt m_severity; wxArrayLong m_times; - // the sizer containing the buttons to which we dynamically add (and - // remove) the "Save" button - wxBoxSizer *m_sizerButtons; - // the "toggle" button and its state wxButton *m_btnDetails; bool m_showingDetails; @@ -715,9 +711,11 @@ wxLogDialog::wxLogDialog(wxWindow *parent, m_showingDetails = FALSE; // not initially m_listctrl = (wxListCtrl *)NULL; + #if wxUSE_STATLINE m_statline = (wxStaticLine *)NULL; #endif // wxUSE_STATLINE + #if wxUSE_FILE m_btnSave = (wxButton *)NULL; #endif // wxUSE_FILE @@ -726,13 +724,13 @@ wxLogDialog::wxLogDialog(wxWindow *parent, // sizers even though our window is not resizeable to calculate the size of // the dialog properly wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - m_sizerButtons = new wxBoxSizer(wxVERTICAL); + wxBoxSizer *sizerButtons = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sizerAll = new wxBoxSizer(wxHORIZONTAL); wxButton *btnOk = new wxButton(this, wxID_OK, _("OK")); - m_sizerButtons->Add(btnOk, 0, wxCENTRE|wxBOTTOM, MARGIN/2); + sizerButtons->Add(btnOk, 0, wxCENTRE|wxBOTTOM, MARGIN/2); m_btnDetails = new wxButton(this, wxID_MORE, ms_details + _T(" >>")); - m_sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1); + sizerButtons->Add(m_btnDetails, 0, wxCENTRE|wxTOP, MARGIN/2 - 1); #ifndef __WIN16__ wxIcon icon = wxTheApp->GetStdIcon((int)(style & wxICON_MASK)); @@ -741,7 +739,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent, const wxString& message = messages.Last(); sizerAll->Add(CreateTextSizer(message), 0, wxCENTRE|wxLEFT|wxRIGHT, MARGIN); - sizerAll->Add(m_sizerButtons, 0, wxALIGN_RIGHT|wxLEFT, MARGIN); + sizerAll->Add(sizerButtons, 0, wxALIGN_RIGHT|wxLEFT, MARGIN); sizerTop->Add(sizerAll, 0, wxCENTRE|wxALL, MARGIN); @@ -874,7 +872,7 @@ void wxLogDialog::CreateDetailsControls() int y; GetTextExtent(_T("H"), (int*)NULL, &y, (int*)NULL, (int*)NULL, &font); - int height = wxMin(y*(count + 3), 100); + int height = wxMax(y*(count + 3), 100); m_listctrl->SetSize(-1, height); } @@ -948,7 +946,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) #endif // wxUSE_STATLINE #if wxUSE_FILE - m_sizerButtons->Remove(m_btnSave); + sizer->Remove(m_btnSave); #endif // wxUSE_FILE } else // show details now @@ -960,24 +958,20 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event)) CreateDetailsControls(); } -#if wxUSE_FILE - m_sizerButtons->Add(m_btnSave, 0, wxCENTRE|wxTOP, MARGIN); -#endif // wxUSE_FILE - #if wxUSE_STATLINE sizer->Add(m_statline, 0, wxEXPAND | (wxALL & ~wxTOP), MARGIN); #endif // wxUSE_STATLINE - sizer->Add(m_listctrl, 1, wxEXPAND| (wxALL & ~wxTOP), MARGIN); + sizer->Add(m_listctrl, 1, wxEXPAND | (wxALL & ~wxTOP), MARGIN); + +#if wxUSE_FILE + sizer->Add(m_btnSave, 0, wxALIGN_RIGHT | (wxALL & ~wxTOP), MARGIN); +#endif // wxUSE_FILE } m_showingDetails = !m_showingDetails; // in any case, our size changed - update -#if wxUSE_FILE - m_sizerButtons->RecalcSizes(); -#endif // wxUSE_FILE - sizer->SetSizeHints(this); sizer->Fit(this); diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index e01a58440d..745da8d084 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -224,13 +224,6 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) if ( m_page ) { - // ask the current page first - if ( !m_page->TransferDataFromWindow() ) - { - // the page data is incorrect - return FALSE; - } - // send the event to the old page wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGING, GetId(), goingForward); if ( m_page->GetEventHandler()->ProcessEvent(event) && @@ -343,6 +336,15 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) (event.GetEventObject() == m_btnPrev), wxT("unknown button") ); + // ask the current page first: notice that we do it before calling + // GetNext/Prev() because the data transfered from the controls of the page + // may change the value returned by these methods + if ( m_page && !m_page->TransferDataFromWindow() ) + { + // the page data is incorrect, don't do anything + return; + } + bool forward = event.GetEventObject() == m_btnNext; wxWizardPage *page; diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 7a39ad3f99..5bfc05bd95 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -338,10 +338,6 @@ void wxDialog::DoShowModal() { m_oldFocus = parent; } - if ( !m_oldFocus ) - { - m_oldFocus = wxTheApp->GetTopWindow(); - } // enter the modal loop while ( IsModalShowing() ) @@ -406,7 +402,7 @@ bool wxDialog::Show(bool show) if ( !GetParent() ) { wxWindow *parent = wxTheApp->GetTopWindow(); - if ( parent && parent != this ) + if ( parent && parent != this && parent->IsShown() ) { // use it m_parent = parent; diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index affc9f7a81..0cf0c6ec99 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -154,6 +154,10 @@ bool wxFrame::Create(wxWindow *parent, x, y, width, height, style); wxModelessWindows.Append(this); + + // unlike (almost?) all other windows, frames are created hidden + m_isShown = FALSE; + return TRUE; } @@ -289,6 +293,10 @@ void wxFrame::DoShowWindow(int nShowCmd) bool wxFrame::Show(bool show) { + // don't use wxWindow version as we want to call DoShowWindow() + if ( !wxWindowBase::Show(show) ) + return FALSE; + DoShowWindow(show ? SW_SHOW : SW_HIDE); if ( show )