X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c801d85f158c4cba50b588807daabdcbd0ed3853..ec45f8ee19190fce57180381611075d3a5b63435:/src/generic/splitter.cpp diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 84ec2282aa..764f9c4b6c 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -45,8 +45,8 @@ END_EVENT_TABLE() wxSplitterWindow::wxSplitterWindow(void) { m_splitMode = wxSPLIT_VERTICAL; - m_windowOne = NULL; - m_windowTwo = NULL; + m_windowOne = (wxWindow *) NULL; + m_windowTwo = (wxWindow *) NULL; m_dragMode = wxSPLIT_DRAG_NONE; m_oldX = 0; m_oldY = 0; @@ -55,25 +55,25 @@ wxSplitterWindow::wxSplitterWindow(void) m_sashSize = 7; m_borderSize = 2; m_sashPosition = 0; - m_sashCursorWE = NULL; - m_sashCursorNS = NULL; - m_sashTrackerPen = NULL; - m_lightShadowPen = NULL; - m_mediumShadowPen = NULL; - m_darkShadowPen = NULL; - m_faceBrush = NULL; - m_facePen = NULL; - m_hilightPen = NULL; + m_sashCursorWE = (wxCursor *) NULL; + m_sashCursorNS = (wxCursor *) NULL; + m_sashTrackerPen = (wxPen *) NULL; + m_lightShadowPen = (wxPen *) NULL; + m_mediumShadowPen = (wxPen *) NULL; + m_darkShadowPen = (wxPen *) NULL; + m_faceBrush = (wxBrush *) NULL; + m_facePen = (wxPen *) NULL; + m_hilightPen = (wxPen *) NULL; m_minimumPaneSize = 0; } -wxSplitterWindow::wxSplitterWindow(wxWindow *parent, const wxWindowID id, const wxPoint& pos, - const wxSize& size, const long style, const wxString& name) +wxSplitterWindow::wxSplitterWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos, + const wxSize& size, long style, const wxString& name) :wxWindow(parent, id, pos, size, style, name) { m_splitMode = wxSPLIT_VERTICAL; - m_windowOne = NULL; - m_windowTwo = NULL; + m_windowOne = (wxWindow *) NULL; + m_windowTwo = (wxWindow *) NULL; m_dragMode = wxSPLIT_DRAG_NONE; m_oldX = 0; m_oldY = 0; @@ -86,12 +86,12 @@ wxSplitterWindow::wxSplitterWindow(wxWindow *parent, const wxWindowID id, const m_sashCursorWE = new wxCursor(wxCURSOR_SIZEWE); m_sashCursorNS = new wxCursor(wxCURSOR_SIZENS); m_sashTrackerPen = new wxPen(*wxBLACK, 2, wxSOLID); - m_lightShadowPen = NULL; - m_mediumShadowPen = NULL; - m_darkShadowPen = NULL; - m_faceBrush = NULL; - m_facePen = NULL; - m_hilightPen = NULL; + m_lightShadowPen = (wxPen *) NULL; + m_mediumShadowPen = (wxPen *) NULL; + m_darkShadowPen = (wxPen *) NULL; + m_faceBrush = (wxBrush *) NULL; + m_facePen = (wxPen *) NULL; + m_hilightPen = (wxPen *) NULL; if ( style & wxSP_3D ) { @@ -112,8 +112,6 @@ wxSplitterWindow::wxSplitterWindow(wxWindow *parent, const wxWindowID id, const // Eventually, we'll respond to colour change messages InitColours(); - SetDoubleClick(TRUE); - // For debugging purposes, to see the background. // SetBackground(wxBLUE_BRUSH); } @@ -173,7 +171,6 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) m_dragMode = wxSPLIT_DRAG_NONE; SetCursor(*wxSTANDARD_CURSOR); - wxSetCursor(*wxSTANDARD_CURSOR); } else if (event.LeftUp() && m_dragMode == wxSPLIT_DRAG_DRAGGING) { @@ -201,7 +198,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) // We remove the first window from the view wxWindow *removedWindow = m_windowOne; m_windowOne = m_windowTwo; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; OnUnsplit(removedWindow); m_sashPosition = 0; @@ -210,7 +207,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) { // We remove the second window from the view wxWindow *removedWindow = m_windowTwo; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; OnUnsplit(removedWindow); m_sashPosition = 0; } @@ -231,7 +228,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) // We remove the first window from the view wxWindow *removedWindow = m_windowOne; m_windowOne = m_windowTwo; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; OnUnsplit(removedWindow); m_sashPosition = 0; @@ -240,7 +237,7 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) { // We remove the second window from the view wxWindow *removedWindow = m_windowTwo; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; OnUnsplit(removedWindow); m_sashPosition = 0; } @@ -259,19 +256,15 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) if ( m_splitMode == wxSPLIT_VERTICAL ) { SetCursor(*m_sashCursorWE); - // Windows needs the following - wxSetCursor(*m_sashCursorWE); } else { SetCursor(*m_sashCursorNS); - wxSetCursor(*m_sashCursorNS); } } else { SetCursor(*wxSTANDARD_CURSOR); - wxSetCursor(*wxSTANDARD_CURSOR); } } else if ( (event.Dragging() && (m_dragMode == wxSPLIT_DRAG_DRAGGING)) || @@ -280,12 +273,10 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) if ( m_splitMode == wxSPLIT_VERTICAL ) { SetCursor(*m_sashCursorWE); - wxSetCursor(*m_sashCursorWE); } else { SetCursor(*m_sashCursorNS); - wxSetCursor(*m_sashCursorNS); } // Detect that this is really a drag: we've moved more than 1 pixel either way @@ -316,8 +307,6 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) } else { - SetCursor(*wxSTANDARD_CURSOR); - wxSetCursor(*wxSTANDARD_CURSOR); } } @@ -341,7 +330,7 @@ void wxSplitterWindow::OnSize(wxSizeEvent& WXUNUSED(event)) SizeWindows(); } -bool wxSplitterWindow::SashHitTest(const int x, const int y, const int tolerance) +bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance) { if ( m_windowTwo == NULL || m_sashPosition == 0) return FALSE; // No sash @@ -429,8 +418,8 @@ void wxSplitterWindow::DrawSash(wxDC& dc) dc.DrawLine(m_sashPosition+m_sashSize-2, 1, m_sashPosition+m_sashSize-2, h-1); dc.SetPen(*m_darkShadowPen); - dc.DrawLine(m_sashPosition+m_sashSize-1, 2, m_sashPosition+m_sashSize-1, h-2); - } + dc.DrawLine(m_sashPosition+m_sashSize-1, 2, m_sashPosition+m_sashSize-1, h-2); + } else { dc.SetPen(*m_facePen); @@ -481,7 +470,7 @@ void wxSplitterWindow::DrawSash(wxDC& dc) } // Draw the sash tracker (for whilst moving the sash) -void wxSplitterWindow::DrawSashTracker(const int x, const int y) +void wxSplitterWindow::DrawSashTracker(int x, int y) { int w, h; GetClientSize(&w, &h); @@ -584,14 +573,14 @@ void wxSplitterWindow::SizeWindows(void) void wxSplitterWindow::Initialize(wxWindow *window) { m_windowOne = window; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; m_sashPosition = 0; } // Associates the given window with window 2, drawing the appropriate sash // and changing the split mode. // Does nothing and returns FALSE if the window is already split. -bool wxSplitterWindow::SplitVertically(wxWindow *window1, wxWindow *window2, const int sashPosition) +bool wxSplitterWindow::SplitVertically(wxWindow *window1, wxWindow *window2, int sashPosition) { if ( IsSplit() ) return FALSE; @@ -609,7 +598,7 @@ bool wxSplitterWindow::SplitVertically(wxWindow *window1, wxWindow *window2, con return TRUE; } -bool wxSplitterWindow::SplitHorizontally(wxWindow *window1, wxWindow *window2, const int sashPosition) +bool wxSplitterWindow::SplitHorizontally(wxWindow *window1, wxWindow *window2, int sashPosition) { if ( IsSplit() ) return FALSE; @@ -638,7 +627,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) if ( toRemove == NULL || toRemove == m_windowTwo) { wxWindow *win = m_windowTwo ; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; m_sashPosition = 0; OnUnsplit(win); SizeWindows(); @@ -647,7 +636,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) { wxWindow *win = m_windowOne ; m_windowOne = m_windowTwo; - m_windowTwo = NULL; + m_windowTwo = (wxWindow *) NULL; m_sashPosition = 0; OnUnsplit(win); SizeWindows(); @@ -658,7 +647,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) return TRUE; } -void wxSplitterWindow::SetSashPosition(const int position, const bool redraw) +void wxSplitterWindow::SetSashPosition(int position, bool redraw) { m_sashPosition = position;