From: Julian Smart Date: Sat, 5 Apr 2003 10:33:10 +0000 (+0000) Subject: APplied patch [ 705301 ] Don't send event for wxSplitter::Unsplit X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/a2f9a636883d3207c0c36bd9f283a7beb23f6c43?ds=inline APplied patch [ 705301 ] Don't send event for wxSplitter::Unsplit git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index 5312bf6dba..dbcbfa37ea 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -1206,6 +1206,8 @@ wxGenericFileDialog::wxGenericFileDialog(wxWindow *parent, mainsizer->Add( choicesizer, 0, wxEXPAND ); } + // FIXME - memory leaks!! + m_choice->Append( firstWildText, (void*) new wxString( firstWild ) ); while (tokens.HasMoreTokens()) { diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index db5c3c62d2..ecacc1f253 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -358,7 +358,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) m_needUpdating = TRUE; } } - else if ( event.LeftDClick() ) + else if ( event.LeftDClick() && m_windowTwo ) { OnDoubleClickSash(x, y); } @@ -892,7 +892,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) return FALSE; } - OnUnsplit(win); + win->Show(FALSE); DoSetSashPosition(0); SizeWindows(); @@ -1062,6 +1062,8 @@ int wxSplitterWindow::OnSashPositionChanging(int newSashPosition) // the sash if the minimum pane size is zero. void wxSplitterWindow::OnDoubleClickSash(int x, int y) { + wxCHECK_RET(m_windowTwo, wxT("splitter: no window to remove")); + // new code should handle events instead of using the virtual functions wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, this); event.m_data.pt.x = x; @@ -1070,7 +1072,9 @@ void wxSplitterWindow::OnDoubleClickSash(int x, int y) { if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways ) { - Unsplit(); + wxWindow* win = m_windowTwo; + if (Unsplit(win)) + OnUnsplit(win); } } //else: blocked by user