EVT_IDLE(wxSplitterWindow::OnIdle)
EVT_MOUSE_EVENTS(wxSplitterWindow::OnMouseEvent)
-#ifdef __WXMSW__
+#if defined( __WXMSW__ ) || defined( __WXMAC__)
EVT_SET_CURSOR(wxSplitterWindow::OnSetCursor)
#endif // wxMSW
m_needUpdating = TRUE;
}
}
- else if ( event.LeftDClick() )
+ else if ( event.LeftDClick() && m_windowTwo )
{
OnDoubleClickSash(x, y);
}
return FALSE;
}
- OnUnsplit(win);
+ win->Show(FALSE);
DoSetSashPosition(0);
SizeWindows();
// 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;
{
if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways )
{
- Unsplit();
+ wxWindow* win = m_windowTwo;
+ if (Unsplit(win))
+ OnUnsplit(win);
}
}
//else: blocked by user
(void)DoSendEvent(event);
}
-#ifdef __WXMSW__
+#if defined( __WXMSW__ ) || defined( __WXMAC__)
// this is currently called (and needed) under MSW only...
void wxSplitterWindow::OnSetCursor(wxSetCursorEvent& event)