git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
		
			
				
	
	
		
			165 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			TeX
		
	
	
	
	
	
			
		
		
	
	
			165 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			TeX
		
	
	
	
	
	
| \section{\class{wxSpinButton}}\label{wxspinbutton}
 | |
| 
 | |
| A wxSpinButton has two small up and down (or left and right) arrow buttons. It is often
 | |
| used next to a text control for increment and decrementing a value.
 | |
| 
 | |
| \wxheading{Derived from}
 | |
| 
 | |
| \helpref{wxControl}{wxcontrol}\\
 | |
| \helpref{wxWindow}{wxwindow}\\
 | |
| \helpref{wxEvtHandler}{wxevthandler}\\
 | |
| \helpref{wxObject}{wxobject}
 | |
| 
 | |
| \wxheading{Include files}
 | |
| 
 | |
| <wx/spinbutt.h>
 | |
| 
 | |
| \wxheading{Window styles}
 | |
| 
 | |
| \twocolwidtha{5cm}
 | |
| \begin{twocollist}\itemsep=0pt
 | |
| \twocolitem{\windowstyle{wxSP\_HORIZONTAL}}{Specifies a horizontal spin button.}
 | |
| \twocolitem{\windowstyle{wxSP\_VERTICAL}}{Specifies a vertical spin button.}
 | |
| \twocolitem{\windowstyle{wxSP\_ARROW\_KEYS}}{The user can use arrow keys.}
 | |
| \twocolitem{\windowstyle{wxSP\_WRAP}}{The value wraps at the minimum and maximum.}
 | |
| \end{twocollist}
 | |
| 
 | |
| See also \helpref{window styles overview}{windowstyles}.
 | |
| 
 | |
| \wxheading{Event handling}
 | |
| 
 | |
| To process input from a spin button, use one of these event handler macros to direct input to member
 | |
| functions that take a \helpref{wxScrollEvent}{wxscrollevent} argument:
 | |
| 
 | |
| \twocolwidtha{7cm}
 | |
| \begin{twocollist}
 | |
| \twocolitem{{\bf EVT\_SPIN(id, func)}}{Catch all scroll commands.}
 | |
| \twocolitem{{\bf EVT\_SPIN\_UP(id, func)}}{Catch up (or left) commands. Win32 only. }
 | |
| \twocolitem{{\bf EVT\_SPIN\_DOWN(id, func)}}{Catch down (or right) commands. Win32 only. }
 | |
| \twocolitem{{\bf EVT\_COMMAND\_TOP(id, func)}}{Catch a command to put the scroll thumb at the maximum position.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_SCROLL(id, func)}}{Catch all scroll commands.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_TOP(id, func)}}{Catch a command to put the scroll thumb at the maximum position.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_BOTTOM(id, func)}}{Catch a command to put the scroll thumb at the maximum position.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_LINEUP(id, func)}}{Catch a line up command.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_LINEDOWN(id, func)}}{Catch a line down command.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_PAGEUP(id, func)}}{Catch a page up command.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_PAGEDOWN(id, func)}}{Catch a page down command.}
 | |
| \twocolitem{{\bf EVT\_COMMAND\_THUMBTRACK(id, func)}}{Catch a thumbtrack command (continuous movement of the scroll thumb).}
 | |
| \end{twocollist}%
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{Event handling overview}{eventhandlingoverview}
 | |
| 
 | |
| \latexignore{\rtfignore{\wxheading{Members}}}
 | |
| 
 | |
| \membersection{wxSpinButton::wxSpinButton}\label{wxspinbuttonconstr}
 | |
| 
 | |
| \func{}{wxSpinButton}{\void}
 | |
| 
 | |
| Default constructor.
 | |
| 
 | |
| \func{}{wxSpinButton}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
 | |
| \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
 | |
| \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
 | |
| \param{const wxString\& }{name = ``spinButton"}}
 | |
| 
 | |
| Constructor, creating and showing a spin button.
 | |
| 
 | |
| \wxheading{Parameters}
 | |
| 
 | |
| \docparam{parent}{Parent window. Must not be NULL.}
 | |
| 
 | |
| \docparam{id}{Window identifier. A value of -1 indicates a default value.}
 | |
| 
 | |
| \docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
 | |
| 
 | |
| \docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
 | |
| 
 | |
| \docparam{style}{Window style. See \helpref{wxSpinButton}{wxspinbutton}.}
 | |
| 
 | |
| \docparam{validator}{Window validator.}
 | |
| 
 | |
| \docparam{name}{Window name.}
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::Create}{wxspinbuttoncreate}, \helpref{wxValidator}{wxvalidator}
 | |
| 
 | |
| \membersection{wxSpinButton::\destruct{wxSpinButton}}
 | |
| 
 | |
| \func{void}{\destruct{wxSpinButton}}{\void}
 | |
| 
 | |
| Destructor, destroying the spin button.
 | |
| 
 | |
| \membersection{wxSpinButton::Create}\label{wxspinbuttoncreate}
 | |
| 
 | |
| \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
 | |
| \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
 | |
| \param{long}{ style = wxSP\_HORIZONTAL}, \param{const wxValidator\& }{validator = wxDefaultValidator},\rtfsp
 | |
| \param{const wxString\& }{name = ``spinButton"}}
 | |
| 
 | |
| Scrollbar creation function called by the spin button constructor.
 | |
| See \helpref{wxSpinButton::wxSpinButton}{wxspinbuttonconstr} for details.
 | |
| 
 | |
| \membersection{wxSpinButton::GetMax}\label{wxspinbuttongetmax}
 | |
| 
 | |
| \constfunc{int}{GetMax}{\void}
 | |
| 
 | |
| Returns the maximum permissable value.
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange}
 | |
| 
 | |
| \membersection{wxSpinButton::GetMin}\label{wxspinbuttongetmin}
 | |
| 
 | |
| \constfunc{int}{GetMin}{\void}
 | |
| 
 | |
| Returns the minimum permissable value.
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::SetRange}{wxspinbuttonsetrange}
 | |
| 
 | |
| \membersection{wxSpinButton::GetValue}\label{wxspinbuttongetvalue}
 | |
| 
 | |
| \constfunc{int}{GetValue}{\void}
 | |
| 
 | |
| Returns the current spin button value.
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::SetValue}{wxspinbuttonsetvalue}
 | |
| 
 | |
| \membersection{wxSpinButton::SetRange}\label{wxspinbuttonsetrange}
 | |
| 
 | |
| \func{void}{SetRange}{\param{int}{ min}, \param{int}{ max}}
 | |
| 
 | |
| Sets the range of the spin button.
 | |
| 
 | |
| \wxheading{Parameters}
 | |
| 
 | |
| \docparam{min}{The minimum value for the spin button.}
 | |
| 
 | |
| \docparam{max}{The maximum value for the spin button.}
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::GetMin}{wxspinbuttongetmin}, \helpref{wxSpinButton::GetMax}{wxspinbuttongetmax}
 | |
| 
 | |
| \membersection{wxSpinButton::SetValue}\label{wxspinbuttonsetvalue}
 | |
| 
 | |
| \func{void}{SetValue}{\param{int}{ value}}
 | |
| 
 | |
| Sets the value of the spin button.
 | |
| 
 | |
| \wxheading{Parameters}
 | |
| 
 | |
| \docparam{value}{The value for the spin button.}
 | |
| 
 | |
| \wxheading{See also}
 | |
| 
 | |
| \helpref{wxSpinButton::GetValue}{wxspinbuttongetvalue}
 | |
| 
 |