- if ( m_facePen )
- delete m_facePen;
- if ( m_faceBrush )
- delete m_faceBrush;
- if ( m_mediumShadowPen )
- delete m_mediumShadowPen;
- if ( m_darkShadowPen )
- delete m_darkShadowPen;
- if ( m_lightShadowPen )
- delete m_lightShadowPen;
- if ( m_hilightPen )
- delete m_hilightPen;
-
- // Shadow colours
-#if defined(__WIN95__)
-// COLORREF ref = ::GetSysColor(COLOR_3DFACE); // Normally light grey
- wxColour faceColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
- m_facePen = new wxPen(faceColour, 1, wxSOLID);
- m_faceBrush = new wxBrush(faceColour, wxSOLID);
-
-// ref = ::GetSysColor(COLOR_3DSHADOW); // Normally dark grey
- wxColour mediumShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW));
- m_mediumShadowPen = new wxPen(mediumShadowColour, 1, wxSOLID);
-
-// ref = ::GetSysColor(COLOR_3DDKSHADOW); // Normally black
- wxColour darkShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DDKSHADOW));
- m_darkShadowPen = new wxPen(darkShadowColour, 1, wxSOLID);
-
-// ref = ::GetSysColor(COLOR_3DLIGHT); // Normally light grey
- wxColour lightShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT));
- m_lightShadowPen = new wxPen(lightShadowColour, 1, wxSOLID);
-
-// ref = ::GetSysColor(COLOR_3DHILIGHT); // Normally white
- wxColour hilightColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT));
- m_hilightPen = new wxPen(hilightColour, 1, wxSOLID);
-#else
- m_facePen = new wxPen("LIGHT GREY", 1, wxSOLID);
- m_faceBrush = new wxBrush("LIGHT GREY", wxSOLID);
- m_mediumShadowPen = new wxPen("GREY", 1, wxSOLID);
- m_darkShadowPen = new wxPen("BLACK", 1, wxSOLID);
- m_lightShadowPen = new wxPen("LIGHT GREY", 1, wxSOLID);
- m_hilightPen = new wxPen("WHITE", 1, wxSOLID);
-#endif
+ 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;
+ event.m_data.pt.y = y;
+ if ( DoSendEvent(event) )
+ {
+ if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways )
+ {
+ wxWindow* win = m_windowTwo;
+ if ( Unsplit(win) )
+ {
+ wxSplitterEvent unsplitEvent(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+ unsplitEvent.m_data.win = win;
+ (void)DoSendEvent(unsplitEvent);
+ }
+ }
+ }
+ //else: blocked by user
+}
+
+void wxSplitterWindow::OnUnsplit(wxWindow *winRemoved)
+{
+ // call this before calling the event handler which may delete the window
+ winRemoved->Show(FALSE);
+}
+
+#if defined( __WXMSW__ ) || defined( __WXMAC__)
+
+// this is currently called (and needed) under MSW only...
+void wxSplitterWindow::OnSetCursor(wxSetCursorEvent& event)
+{
+ // if we don't do it, the resizing cursor might be set for child window:
+ // and like this we explicitly say that our cursor should not be used for
+ // children windows which overlap us
+
+ if ( SashHitTest(event.GetX(), event.GetY()) )
+ {
+ // default processing is ok
+ event.Skip();
+ }
+ //else: do nothing, in particular, don't call Skip()