From 1ec25e8ff7e86e1035bc06050f123c0ead8dba60 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 7 Apr 2004 05:20:58 +0000 Subject: [PATCH] Added some convenience inlines git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/window.tex | 18 ++++++++++++++++++ include/wx/window.h | 16 +++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 563d1d6f06..1cf2671836 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -2844,6 +2844,10 @@ implements the following methods:\par \func{virtual void}{SetSizeHints}{\param{int}{ minW=-1}, \param{int}{ minH=-1}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1}, \param{int}{ incW=-1}, \param{int}{ incH=-1}} +\func{void}{SetSizeHints}{\param{const wxSize\&}{ minSize}, +\param{const wxSize\&}{ maxSize=wxDefaultSize}, \param{const wxSize\&}{ incSize=wxDefaultSize}} + + Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. @@ -2861,6 +2865,12 @@ If a pair of values is not set (or set to -1), the default values will be used. \docparam{incH}{Specifies the increment for sizing the height (Motif/Xt only).} +\docparam{minSize}{Minimum size.} + +\docparam{maxSize}{Maximum size.} + +\docparam{incSize}{Increment size (Motif/Xt only).} + \wxheading{Remarks} If this function is called, the user will not be able to size the window outside the @@ -2972,6 +2982,10 @@ Sets the virtual size of the window in pixels. \func{virtual void}{SetVirtualSizeHints}{\param{int}{ minW},\param{int}{ minH}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1}} +\func{void}{SetVirtualSizeHints}{\param{const wxSize\&}{ minSize=wxDefaultSize}, +\param{const wxSize\&}{ maxSize=wxDefaultSize}} + + Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. @@ -2986,6 +3000,10 @@ will be used. \docparam{maxH}{Specifies the maximum height allowable.} +\docparam{minSize}{Minimum size.} + +\docparam{maxSize}{Maximum size.} + \wxheading{Remarks} If this function is called, the user will not be able to size the virtual area diff --git a/include/wx/window.h b/include/wx/window.h index 9c3744965e..b2e14d4151 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -340,9 +340,22 @@ public: virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); + void SetSizeHints( const wxSize& minSize, + const wxSize& maxSize=wxDefaultSize, + const wxSize& incSize=wxDefaultSize) + { + SetSizeHints(minSize.x, minSize.y, + maxSize.x, maxSize.y, + incSize.x, incSize.y); + } virtual void SetVirtualSizeHints( int minW, int minH, int maxW = -1, int maxH = -1 ); + void SetVirtualSizeHints( const wxSize& minSize, + const wxSize& maxSize=wxDefaultSize) + { + SetVirtualSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y); + } virtual int GetMinWidth() const { return m_minWidth; } virtual int GetMinHeight() const { return m_minHeight; } @@ -351,7 +364,8 @@ public: // Override this method to control the values given to Sizers etc. virtual wxSize GetMaxSize() const { return wxSize( m_maxWidth, m_maxHeight ); } - + virtual wxSize GetMinSize() const { return wxSize( m_minWidth, m_minHeight ); } + // Methods for accessing the virtual size of a window. For most // windows this is just the client area of the window, but for // some like scrolled windows it is more or less independent of -- 2.45.2