// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if wxUSE_SPLITTER
#ifdef __BORLANDC__
#pragma hdrstop
#endif
BEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow)
EVT_PAINT(wxSplitterWindow::OnPaint)
EVT_SIZE(wxSplitterWindow::OnSize)
- EVT_IDLE(wxSplitterWindow::OnIdle)
EVT_MOUSE_EVENTS(wxSplitterWindow::OnMouseEvent)
#if defined( __WXMSW__ ) || defined( __WXMAC__)
DrawSash(dc);
}
-void wxSplitterWindow::OnIdle(wxIdleEvent& event)
+void wxSplitterWindow::OnInternalIdle()
{
+ wxWindow::OnInternalIdle();
+
if (m_needUpdating)
SizeWindows();
-
- event.Skip();
}
void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
m_windowOne = m_windowTwo;
m_windowTwo = (wxWindow *) NULL;
OnUnsplit(removedWindow);
+ wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+ event.m_data.win = removedWindow;
+ (void)DoSendEvent(event);
SetSashPositionAndNotify(0);
}
else if ( posSashNew == GetWindowSize() )
wxWindow *removedWindow = m_windowTwo;
m_windowTwo = (wxWindow *) NULL;
OnUnsplit(removedWindow);
+ wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
+ event.m_data.win = removedWindow;
+ (void)DoSendEvent(event);
SetSashPositionAndNotify(0);
}
else
SizeWindows();
} // left up && dragging
- else if (event.Moving() && !event.Dragging())
+ else if ((event.Moving() || event.Leaving() || event.Entering()) && (m_dragMode == wxSPLIT_DRAG_NONE))
{
// Just change the cursor as required
- if ( SashHitTest(x, y) )
+ if ( !event.Leaving() && SashHitTest(x, y) )
+ {
SetResizeCursor();
+ }
else
+ {
SetCursor(* wxSTANDARD_CURSOR);
+ }
}
else if (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING))
{
return FALSE;
}
- win->Show(FALSE);
+ OnUnsplit(win);
DoSetSashPosition(0);
SizeWindows();
if ( GetMinimumPaneSize() == 0 || m_permitUnsplitAlways )
{
wxWindow* win = m_windowTwo;
- if (Unsplit(win))
- OnUnsplit(win);
+ 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)
{
- // do it before calling the event handler which may delete the window
+ // call this before calling the event handler which may delete the window
winRemoved->Show(FALSE);
-
- wxSplitterEvent event(wxEVT_COMMAND_SPLITTER_UNSPLIT, this);
- event.m_data.win = winRemoved;
-
- (void)DoSendEvent(event);
}
#if defined( __WXMSW__ ) || defined( __WXMAC__)
//else: do nothing, in particular, don't call Skip()
}
+#endif // wxUSE_SPLITTER
#endif // wxMSW