back to gui 

wxScrolledWindow

generated from ../src/mod_gui/control/scrollwnd.cpp

The wxScrolledWindow class manages scrolling for its client area, transforming the coordinates according to the scrollbar positions, and setting the scroll positions, thumb sizes and ranges according to the area in view.

Constants

Constructor

wxScrolledWindow

wxScrolledWindow()
 
wxScrolledWindow(Parent, 
                 Id, 
                 Position = wxDefaultPosition, 
                 Size = wxDefaultSize, 
                 Style = wxWindow.HSCROLL + wxWindow.VSCROLL)
 
Name Type Default Description
Parent wxWindow The parent window
Id Integer A windows identifier. Use -1 when you don't need it.
Position wxPoint wxDefaultPosition The position of the control on the given parent
Size wxSize wxDefaultSize The size of the control
Style Integer wxWindow.HSCROLL + wxWindow.VSCROLL The style of the control

Constructs a new wxScrolledWindow object.

Properties

Name Type Description
retained read only Boolean Motif only: true if the window has a backing bitmap
scrollPixelsPerUnit read only Array Get the number of pixels per scroll unit (line), in each direction, as set by setScrollbars. A value of zero indicates no scrolling in that direction.
viewStart read only Array Get the position at which the visible portion of the window starts.
virtualSize read only Array Gets the size in device units of the scrollable window area (as opposed to the client size, which is the area of the window currently visible)

Methods

calcScrolledPosition

calcScrolledPosition(x, 
                     y) : Array
 
Name Type Default Description
x Integer
y Integer

Translates the logical coordinates to the device ones.

calcUnscrolledPosition

calcUnscrolledPosition(x, 
                       y) : Array
 
Name Type Default Description
x Integer
y Integer

Translates the device coordinates to the logical ones.

create

create(Parent, 
       Id, 
       Position = wxDefaultPosition, 
       Size = wxDefaultSize, 
       Style = wxWindow.HSCROLL + wxWindow.VSCROLL)
 
Name Type Default Description
Parent wxWindow The parent window
Id Integer A windows identifier. Use -1 when you don't need it.
Position wxPoint wxDefaultPosition The position of the control on the given parent
Size wxSize wxDefaultSize The size of the control
Style Integer wxWindow.HSCROLL + wxWindow.VSCROLL The style of the control

Constructs a new wxScrolledWindow object.

enableScrolling

enableScrolling(xScrolling, 
                yScrolling)
 
Name Type Default Description
xScrolling Boolean
yScrolling Boolean

Enable or disable physical scrolling in the given direction. Physical scrolling is the physical transfer of bits up or down the screen when a scroll event occurs. If the application scrolls by a variable amount (e.g. if there are different font sizes) then physical scrolling will not work, and you should switch it off. Note that you will have to reposition child windows yourself, if physical scrolling is disabled.

Physical scrolling may not be available on all platforms. Where it is available, it is enabled by default.

getView

getView() : Array
 

Get the number of pixels per scroll unit (line), in each direction, as set by setScrollbars. A value of zero indicates no scrolling in that direction.

scroll

scroll(x, 
       y)
 
Name Type Default Description
x Integer The x position to scroll to
y Integer The y position to scroll to

Scrolls a window so the view start is at the given point.

The positions are in scroll units, not pixels, so to convert to pixels you will have to multiply by the number of pixels per scroll increment. If either parameter is -1, that position will be ignored (no change in that direction).

setScrollRate

setScrollRate(xStep, 
              yStep)
 
Name Type Default Description
xStep Integer
yStep Integer

Set the horizontal and vertical scrolling increment only. See the pixelsPerUnit parameter in setScrollbars.

setScrollbars

setScrollbars(pixelsPerUnitX, 
              pixelsPerUnitY, 
              noUnitsX, 
              noUnitsY, 
              xPos = 0, 
              yPos = 0, 
              noRefresh = false)
 
Name Type Default Description
pixelsPerUnitX Integer Pixels per scroll unit in the horizontal direction.
pixelsPerUnitY Integer Pixels per scroll unit in the vertical direction.
noUnitsX Integer Number of units in the horizontal direction.
noUnitsY Integer Number of units in the vertical direction.
xPos Integer 0 Position to initialize the scrollbars in the horizontal direction, in scroll units.
yPos Integer 0 Position to initialize the scrollbars in the vertical direction, in scroll units.
noRefresh Integer false Will not refresh window if true.

Sets up vertical and/or horizontal scrollbars.

The first pair of parameters give the number of pixels per 'scroll step', i.e. amount moved when the up or down scroll arrows are pressed. The second pair gives the length of scrollbar in scroll steps, which sets the size of the virtual window. xPos and yPos optionally specify a position to scroll to immediately. For example, the following gives a window horizontal and vertical scrollbars with 20 pixels per scroll step, and a size of 50 steps (1000 pixels) in each direction. window.setScrollbars(20, 20, 50, 50); wxScrolledWindow manages the page size itself, using the current client window size as the page size.

setTargetWindow

setTargetWindow(Window)
 
Name Type Default Description
Window wxWindow

Call this function to tell wxScrolledWindow to perform the actual scrolling on a different window (and not on itself).




Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.