From: Vadim Zeitlin Date: Mon, 22 Nov 2010 01:23:16 +0000 (+0000) Subject: Deprecate not working wxSplitterWindow::SetSashSize(). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/26696222ffb75ac8531207cf356a52b033c48d9e?ds=inline Deprecate not working wxSplitterWindow::SetSashSize(). Setting sash size to non default value didn't work correctly and didn't make much sense anyhow as the sash appearance is platform-dependent and current code for drawing it doesn't work for arbitrary sizes. Simply remove the possibility to set the sash size. Closes #12412. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 7244535737..39df924f0c 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -133,9 +133,6 @@ public: // Is the window split? bool IsSplit() const { return (m_windowTwo != NULL); } - // Sets the sash size - void SetSashSize(int width) { m_sashSize = width; } - // Sets the border size void SetBorderSize(int WXUNUSED(width)) { } @@ -221,6 +218,10 @@ public: virtual bool MacClipGrandChildren() const { return true ; } #endif + // Sets the sash size: this doesn't do anything and shouldn't be used at + // all any more. + wxDEPRECATED_INLINE( void SetSashSize(int WXUNUSED(width)), return; ) + protected: // event handlers #if defined(__WXMSW__) || defined(__WXMAC__) @@ -282,7 +283,6 @@ protected: int m_oldY; // current tracker position if not live mode int m_sashPosition; // Number of pixels from left or top double m_sashGravity; - int m_sashSize; wxSize m_lastSize; int m_requestedSashPosition; int m_sashPositionCurrent; // while dragging diff --git a/interface/wx/splitter.h b/interface/wx/splitter.h index bda303b58d..6a9de45dc2 100644 --- a/interface/wx/splitter.h +++ b/interface/wx/splitter.h @@ -136,6 +136,18 @@ public: */ int GetSashPosition() const; + /** + Returns the sash size in pixels. + + The size of the sash is its width for a vertically split window and its + height for a horizontally split one. Its other direction is the same as + the client size of the window in the corresponding direction. + + The sash size is platform-dependent because it conforms to the current + platform look-and-feel and cannot be changed. + */ + int GetSashSize() const; + /** Gets the split mode. @@ -285,15 +297,6 @@ public: */ void SetSashPosition(int position, bool redraw = true); - /** - Sets the sash size. Normally, the sash size is determined according to the - metrics - of each platform, but the application can override this, for example to show - a thin sash that the user is not expected to drag. If @a size is more -1, - the custom sash size will be used. - */ - void SetSashSize(int size); - /** Sets the split mode. diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index fedb025def..3cffee36f0 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -129,7 +129,6 @@ void wxSplitterWindow::Init() m_sashStart = 0; m_sashPosition = m_requestedSashPosition = 0; m_sashGravity = 0.0; - m_sashSize = -1; // -1 means use the native sash size m_lastSize = wxSize(0,0); m_checkRequestedSashPosition = false; m_minimumPaneSize = 0; @@ -491,7 +490,7 @@ bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance) int wxSplitterWindow::GetSashSize() const { - return m_sashSize > -1 ? m_sashSize : wxRendererNative::Get().GetSplitterParams(this).widthSash; + return wxRendererNative::Get().GetSplitterParams(this).widthSash; } int wxSplitterWindow::GetBorderSize() const