Added knowledge of virtual size to wx(Scrolled)Windows, they can now

manage their own scrollbars with the help of a sizer or other user
clues (SetVirtualSizeHints) without the need for an ancillary container.
Added SetSizerAndFit convenience method.
SetSizer now enables/disables AutoLayout automagically.
Logic bugfix for scrollsub sample.
Syntax bugfix in parser.y.
Compiler warning fix in textctrl.cpp.

 Modified Files:
    docs/latex/wx/scrolwin.tex docs/latex/wx/sizer.tex
    docs/latex/wx/window.tex include/wx/scrolwin.h
    include/wx/sizer.h include/wx/window.h
    include/wx/generic/scrolwin.h include/wx/gtk/scrolwin.h
    samples/scrollsub/scrollsub.cpp src/common/parser.y
    src/common/sizer.cpp src/common/wincmn.cpp
    src/generic/scrlwing.cpp src/gtk/scrolwin.cpp
    src/msw/textctrl.cpp


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ron Lee
2002-04-19 22:12:38 +00:00
parent 1d0edc0f73
commit 566d84a7c3
17 changed files with 601 additions and 309 deletions

View File

@@ -358,11 +358,22 @@ scroll steps may be variable according to the position in the document, it will
necessary to derive a new class from wxWindow, overriding {\bf OnSize} and
adjusting the scrollbars appropriately.
\wxheading{See also}
\helpref{wxWindow::SetVirtualSize}{wxwindowsetvirtualsize}
\membersection{wxScrolledWindow::SetScrollRate}\label{wxscrolledwindowsetscrollrate}
\func{void}{SetScrollRate}{\param{int}{xstep}, \param{int}{ystep}}
Set the horizontal and vertical scrolling increment only. See the pixelsPerUnit
parameter in SetScrollbars.
\membersection{wxScrolledWindow::SetTargetWindow}\label{wxscrolledwindowsettargetwindow}
\func{void}{SetTargetWindow}{\param{wxWindow* }{window}}
Call this function to tell wxScrolledWindow to perform the actually scrolling on
Call this function to tell wxScrolledWindow to perform the actual scrolling on
a different window (not on itself).
\membersection{wxScrolledWindow::GetViewStart}\label{wxscrolledwindowgetviewstart}

View File

@@ -131,6 +131,20 @@ Tell the sizer to resize the {\it window} to match the sizer's minimal size. Thi
is commonly done in the constructor of the window itself, see sample in the description
of \helpref{wxBoxSizer}{wxboxsizer}.
\membersection{wxSizer::FitInside}\label{wxsizerfitinside}
\func{void}{FitInside}{\param{wxWindow* }{window}}
Tell the sizer to resize the virtual size of the {\it window} to match the sizer's
minimal size. This will not alter the on screen size of the window, but may cause
the addition/removal/alteration of scrollbars required to view the virtual area in
windows which manage it.
\wxheading{See also}
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars},\rtfsp
\helpref{wxSizer::SetVirtualSizeHints}{wxsizersetvirtualsizehints}
\membersection{wxSizer::GetSize}\label{wxsizergetsize}
\func{wxSize}{GetSize}{\void}
@@ -230,8 +244,19 @@ after initial creation.
\func{void}{SetSizeHints}{\param{wxWindow* }{window}}
Tell the sizer to set the minimal size of the {\it window} to match the sizer's minimal size.
This is commonly done in the constructor of the window itself, see sample in the description
of \helpref{wxBoxSizer}{wxboxsizer} if the window is resizable (as are many dialogs under Unix and
frames on probably all platforms).
Tell the sizer to set (and \helpref{Fit}{wxsizerfit}) the minimal size of the {\it window} to
match the sizer's minimal size. This is commonly done in the constructor of the window itself,
see sample in the description of \helpref{wxBoxSizer}{wxboxsizer} if the window is resizable
(as are many dialogs under Unix and frames on probably all platforms).
\membersection{wxSizer::SetVirtualSizeHints}\label{wxsizersetvirtualsizehints}
\func{void}{SetVirtualSizeHints}{\param{wxWindow* }{window}}
Tell the sizer to set the minimal size of the {\it window} virtual area to match the sizer's
minimal size. For windows with managed scrollbars this will set them appropriately.
\wxheading{See also}
\helpref{wxScrolledWindow::SetScrollbars}{wxscrolledwindowsetscrollbars}

View File

@@ -570,6 +570,7 @@ implements the following methods:\par
\wxheading{See also}
\helpref{GetSize}{wxwindowgetsize}
\helpref{GetVirtualSize}{wxwindowgetvirtualsize}
\membersection{wxWindow::GetConstraints}\label{wxwindowgetconstraints}
@@ -826,7 +827,8 @@ method:\par
\wxheading{See also}
\helpref{GetClientSize}{wxwindowgetclientsize}
\helpref{GetClientSize}{wxwindowgetclientsize},\rtfsp
\helpref{GetVirtualSize}{wxwindowgetvirtualsize}
\membersection{wxWindow::GetSizer}\label{wxwindowgetsizer}
@@ -902,6 +904,23 @@ only be called within an \helpref{wxPaintEvent}{wxpaintevent} handler.
Returns a pointer to the current validator for the window, or NULL if there is none.
\membersection{wxWindow::GetVirtualSize}\label{wxwindowgetvirtualsize}
\constfunc{void}{GetVirtualSize}{\param{int* }{width}, \param{int* }{height}}
\constfunc{wxSize}{GetVirtualSize}{\void}
This gets the virtual size of the window in pixels.
\wxheading{Parameters}
\docparam{width}{Receives the window virtual width.}
\docparam{height}{Receives the window virtual height.}
\helpref{GetSize}{wxwindowgetsize},\rtfsp
\helpref{GetClientSize}{wxwindowgetclientsize}
\membersection{wxWindow::GetWindowStyleFlag}\label{wxwindowgetwindowstyleflag}
\constfunc{long}{GetWindowStyleFlag}{\void}
@@ -2405,11 +2424,21 @@ Pass FALSE if you wish to handle deleting the old sizer yourself.}
\wxheading{Remarks}
SetSizer now enables and disables Layout automatically, but prior to wxWindows 2.3.3
the following applied:
You must call \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} to tell a window to use
the sizer automatically in OnSize; otherwise, you must override OnSize and call Layout()
explicitly. When setting both a wxSizer and a \helpref{wxLayoutConstraints}{wxlayoutconstraints},
only the sizer will have effect.
\membersection{wxWindow::SetSizerAndFit}\label{wxwindowsetsizerandfit}
\func{void}{SetSizerAndFit}{\param{wxSizer* }{sizer}, \param{bool }{deleteOld=TRUE}}
The same as \helpref{SetSizer}{wxwindowsetsizer}, except it also sets the size hints
for the window based on the sizer's minimum size.
\membersection{wxWindow::SetTitle}\label{wxwindowsettitle}
\func{virtual void}{SetTitle}{\param{const wxString\& }{title}}
@@ -2450,6 +2479,37 @@ See also: \helpref{GetToolTip}{wxwindowgettooltip},
Get the associated tooltip or NULL if none.
\membersection{wxWindow::SetVirtualSize}\label{wxwindowsetvirtualsize}
\func{void}{SetVirtualSize}{\param{int}{ width}, \param{int}{ height}}
\func{void}{SetVirtualSize}{\param{const wxSize\&}{ size}}
Sets the virtual size of the window in pixels.
\membersection{wxWindow::SetVirtualSizeHints}\label{wxwindowsetvirtualsizehints}
\func{virtual void}{SetVirtualSizeHints}{\param{int}{ minW},\param{int}{ minH}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1}}
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.
\wxheading{Parameters}
\docparam{minW}{Specifies the minimum width allowable.}
\docparam{minH}{Specifies the minimum height allowable.}
\docparam{maxW}{Specifies the maximum width allowable.}
\docparam{maxH}{Specifies the maximum height allowable.}
\wxheading{Remarks}
If this function is called, the user will not be able to size the virtual area
of the window outside the given bounds.
\membersection{wxWindow::SetWindowStyle}\label{wxwindowsetwindowstyle}