WindowSetScrollbar

HC GUI programming WindowSet WindowSetScrollbar
WindowSetOwnForegroundColour WindowSetScrollPos

WindowSetScrollbar window orientation position thumbSize range refresh


Sets the scrollbar properties of a built-in scrollbar.

Parameters

orientation: Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.

position: The position of the scrollbar in scroll units.

thumbSize: The size of the thumb, or visible portion of the scrollbar, in scroll units.

range: The maximum position of the scrollbar.

refresh: true to redraw the scrollbar, false otherwise.

Remarks: Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time. You would use:

	SetScrollbar(wxVERTICAL, 0, 16, 50);
Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34.

You can determine how many lines are currently visible by dividing the current view size by the character height in pixels.

When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and SetScrollbar call into a function named AdjustScrollbars, which can be called initially and also from your wxSizeEvent handler function.

WindowSetOwnForegroundColour WindowSetScrollPos