⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hvscroll.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
📖 第 1 页 / 共 2 页
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Name:        hvscroll.tex%% Purpose:     wxHVScrolledWindow documentation%% Author:      Vadim Zeitlin%% Modified by: Brad Anderson%% Created:     24.01.06%% RCS-ID:      $Id: hvscroll.tex,v 1.1 2006/02/15 09:59:25 RR Exp $%% Copyright:   (c) 2003 Vadim Zeitlin <vadim@wxwindows.org>%% License:     wxWindows license%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{\class{wxHVScrolledWindow}}\label{wxhvscrolledwindow}This class is strongly influenced by \helpref{wxVScrolledWindow}{wxvscrolledwindow}. Like wxVScrolledWindow, this class is here to provide an easy way to implementvariable line sizes.  The difference is that wxVScrolledWindow only works withvertical scrolling.  This class extends the behavior of wxVScrolledWindow tothe horizontal axis in addition to the vertical axis.The scrolling is also "virtual" in the sense that row widths and column heightsonly need to be known for the rows and columns that are currently visible.Like \helpref{wxVScrolledWindow}{wxvscrolledwindow}, this is a generalizationof the \helpref{wxScrolledWindow}{wxscrolledwindow} class which can be onlyused when all rows have a constant height and columns have a constant width. Like wxVScrolledWinow it lacks some of wxScrolledWindow features such asscrolling another window or only scrolling a rectangle of the window and notits entire client area.If only vertical scrolling is needed, wxVScrolledWindow is recommendedbecause it is simpler to use.   There is no wxHScrolledWindow but horizontal-only scrolling is implementedeasily enough with this class.To use this class, you need to derive from it and implement both the \helpref{OnGetRowHeight()}{wxhvscrolledwindowongetrowheight} and the \helpref{OnGetColumnWidth()}{wxhvscrolledwindowongetcolumnwidth} pure virtualmethods. You also must call \helpref{SetRowColumnCounts}{wxhvscrolledwindowsetrowcolumncounts} to let thebase class know how many rows and columns it should display. After theserequirements are met scrolling is handled entirely by wxHVScrolledWindow. Youonly need to draw the visible part of contents in your {\tt OnPaint()} methodas usual. You should use \helpref{GetVisibleRowsBegin()}{wxhvscrolledwindowgetvisiblerowsbegin}, \helpref{GetVisibleColumnsBegin()}{wxhvscrolledwindowgetvisiblecolumnsbegin}, \helpref{GetVisibleRowsEnd()}{wxhvscrolledwindowgetvisiblerowsend}, and \helpref{GetVisibleColumnsEnd()}{wxhvscrolledwindowgetvisiblecolumnsend} todetermine which lines to to display. If physical scrolling is enabled thedevice context origin is shifted by the scroll position (through{\tt PrepareDC()}), child windows are moved as the window scrolls, and thepixels on the screen are moved to minimize the region that requires painting.Physical scrolling is enabled by default.\wxheading{Derived from}\helpref{wxPanel}{wxpanel}\wxheading{Include files}<wx/vscroll.h>\latexignore{\rtfignore{\wxheading{Members}}}\membersection{wxHVScrolledWindow::wxHVScrolledWindow}\label{wxhvscrolledwindowctor}\func{}{wxHVScrolledWindow}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}This is the normal constructor, no need to call Create() after using this one.Note that {\tt wxVSCROLL} and {\tt wxHSCROLL} are always automatically added toour style, there is no need to specify them explicitly.\func{}{wxHVScrolledWindow}{\void}Default constructor, you must call \helpref{Create()}{wxhvscrolledwindowcreate}later.\wxheading{Parameters}\docparam{parent}{The parent window, must not be {\tt NULL}}\docparam{id}{The identifier of this window, {\tt wxID\_ANY} by default}\docparam{pos}{The initial window position}\docparam{size}{The initial window size}\docparam{style}{The window style. There are no special style bits defined forthis class.}\docparam{name}{The name for this window; usually not used}\membersection{wxHVScrolledWindow::Create}\label{wxhvscrolledwindowcreate}\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id = wxID\_ANY}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}}Same as the \helpref{non default ctor}{wxhvscrolledwindowctor} but returnsstatus code: {\tt true} if ok, {\tt false} if the window couldn't have been created.Just as with the ctor above, both the {\tt wxVSCROLL} and the {\tt wxHSCROLL}styles are always used. There is no need to specify either explicitly.\membersection{wxHVScrolledWindow::EnablePhysicalScrolling}\label{wxhvscrolledwindowenablephysicalscrolling}\func{\void}{EnablePhysicalScrolling}{\param{bool }{scrolling = true}}With physical scrolling enabled the device origin is changed properly when awxDC is prepared using {\tt PrepareDC()}, children are actually moved and layedout according to the current scroll position, and the contents of the window(pixels) are actually moved to reduce the amount of redraw needed.Physical scrolling is enabled by default but can be disable or re-enabled atany time.  An example of when you'd want to disable it would be if you havestatically positioned graphic elements or children you do not want to movewhile the window is being scrolled.  If you disable physical scrolling you mustmanually adjust positioning for items within the scrolled window yourself.Also note that an unprepared wxDC requires you to do the same, regardless ofthe physical scrolling state.\membersection{wxHVScrolledWindow::EstimateTotalHeight}\label{wxhvscrolledwindowestimatetotalheight}\constfunc{virtual wxCoord}{EstimateTotalHeight}{\void}This protected function is used internally by wxHVScrolledWindow to estimate thetotal height of the window when \helpref{SetRowColumnCounts}{wxhvscrolledwindowsetrowcolumncounts}is called. The default implementation uses the brute force approach if thenumber of the items in the control is small enough. Otherwise, it tries to findthe average row height using some rows in the beginning, middle and the end.If it is undesirable to query all these rows (some of which might be nevershown) just for the total height calculation, you may override the function andprovide your own guess using a better and/or faster method.Note that although returning a totally wrong value would still work, it riskscausing some very strange scrollbar behaviour so this function should reallytry to make the best guess possible.\membersection{wxHVScrolledWindow::EstimateTotalWidth}\label{wxhvscrolledwindowestimatetotalwidth}\constfunc{virtual wxCoord}{EstimateTotalWidth}{\void}This protected function is used internally by wxHVScrolledWindow to estimate thetotal width of the window when \helpref{SetRowColumnCounts}{wxhvscrolledwindowsetrowcolumncounts}is called. The default implementation uses the brute force approach if thenumber of the items in the control is small enough. Otherwise, it tries to findthe average column width using some columns in the beginning, middle and the end.If it is undesirable to query all these columns (some of which might be nevershown) just for the total width calculation, you may override the function andprovide your own guess using a better and/or faster method.Note that although returning a totally wrong value would still work, it riskscausing some very strange scrollbar behaviour so this function should reallytry to make the best guess possible.\membersection{wxHVScrolledWindow::GetColumnCount}\label{wxhvscrolledwindowgetcolumncount}\constfunc{wxSize}{GetColumnCount}{\void}Get the number of columns this window contains (previously set by \helpref{SetRowColumnCounts()}{wxhvscrolledwindowsetrowcolumncounts})\membersection{wxHVScrolledWindow::GetRowCount}\label{wxhvscrolledwindowgetrowcount}\constfunc{wxSize}{GetRowCount}{\void}Get the number of rows this window contains (previously set by \helpref{SetRowColumnCounts()}{wxhvscrolledwindowsetrowcolumncounts})\membersection{wxHVScrolledWindow::GetRowColumnCounts}\label{wxhvscrolledwindowgetrowcolumncounts}\constfunc{wxSize}{GetRowColumnCounts}{\void}Get the number of rows (X or width) and columns (Y or height) this windowcontains (previously setby \helpref{SetRowColumnCounts()}{wxhvscrolledwindowsetrowcolumncounts})\membersection{wxHVScrolledWindow::GetVisibleBegin}\label{wxhvscrolledwindowgetvisiblebegin}\constfunc{wxPoint}{GetVisibleBegin}{\void}Returns the indicies of the first visible row (Y) and column (X).\wxheading{See also}\helpref{GetVisibleRowsBegin}{wxhvscrolledwindowgetvisiblerowsbegin}, \helpref{GetVisibleColumnsBegin}{wxhvscrolledwindowgetvisiblecolumnsbegin}\membersection{wxHVScrolledWindow::GetVisibleColumnsBegin}\label{wxhvscrolledwindowgetvisiblecolumnsbegin}\constfunc{size\_t}{GetVisibleColumnsBegin}{\void}Returns the index of the first currently visible column.\wxheading{See also}\helpref{GetVisibleColumnsEnd}{wxhvscrolledwindowgetvisiblecolumnsend}\membersection{wxHVScrolledWindow::GetVisibleColumnsEnd}\label{wxhvscrolledwindowgetvisiblecolumnsend}\constfunc{size\_t}{GetVisibleColumnsEnd}{\void}Returns the index of the first column after the currently visible page. If thereturn value is $0$ it means that no columns are currently shown (which onlyhappens if the control is empty). Note that the index returned by this methodis not always a valid index as it may be equal to \helpref{GetColumnCount}{wxhvscrolledwindowgetcolumncount}.\wxheading{See also}\helpref{GetVisibleColumnsBegin}{wxhvscrolledwindowgetvisiblecolumnsbegin}\membersection{wxHVScrolledWindow::GetVisibleEnd}\label{wxhvscrolledwindowgetvisiblebegin}\constfunc{wxPoint}{GetVisibleEnd}{\void}Returns the indicies of the row and column after the last visible row (Y) andlast visible column (X), respectively.\wxheading{See also}\helpref{GetVisibleRowsEnd}{wxhvscrolledwindowgetvisiblerowsend}, \helpref{GetVisibleColumnsEnd}{wxhvscrolledwindowgetvisiblecolumnsend}\membersection{wxHVScrolledWindow::GetVisibleRowsBegin}\label{wxhvscrolledwindowgetvisiblerowsbegin}\constfunc{size\_t}{GetVisibleRowsBegin}{\void}Returns the index of the first currently visible row.\wxheading{See also}\helpref{GetVisibleRowsEnd}{wxhvscrolledwindowgetvisiblerowsend}\membersection{wxHVScrolledWindow::GetVisibleRowsEnd}\label{wxhvscrolledwindowgetvisiblerowsend}\constfunc{size\_t}{GetVisibleRowsEnd}{\void}Returns the index of the first row after the currently visible page. If thereturn value is $0$ it means that no rows are currently shown (which onlyhappens if the control is empty). Note that the index returned by this methodis not always a valid index as it may be equal to \helpref{GetRowCount}{wxhvscrolledwindowgetrowcount}.\wxheading{See also}\helpref{GetVisibleRowsBegin}{wxhvscrolledwindowgetvisiblerowsbegin}\membersection{wxHVScrolledWindow::HitTest}\label{wxhvscrolledwindowhittest}\constfunc{wxPoint}{HitTest}{\param{wxCoord }{x}, \param{wxCoord }{y}}\constfunc{wxPoint}{HitTest}{\param{const wxPoint\& }{pt}}Return the position (X as column, Y as row) of the cell occupying the specifiedposition (in physical coordinates). A value of {\tt wxNOT\_FOUND} in either X,Y, or X and Y means it is outside the range availible rows and/or columns.\membersection{wxHVScrolledWindow::IsColumnVisible}\label{wxhvscrolledwindowiscolumnvisible}\constfunc{bool}{IsColumnVisible}{\param{size\_t}{column}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -