Description of MUSHclient world function: world.SetWorldWindowStatus
||Sets the scroll bar position, and hides or shows it
long SetScroll(long Position, BOOL Visible);
View list of data type meanings
This lets you do two things:
* Hide the existing scroll bar if desired
* Set the "scroll position" in the output window
The first feature (hiding the scroll bar) lets you, well, hide it, so that you can draw your own wherever you want (eg. with a themed miniwindow somewhere near where the text appears).
The second feature lets your code scroll the text around (so you can still use the existing output buffer) in response to the player clicking and dragging on "your" thumb, or arrows.
A position of -1 means "the end of the window" (which is the number of lines multiplied by the height of the font, minus the size of the output window).
A position of -2 means "no change".
You can use GetInfo (296) to find the current scroll-bar position (and thus add or subtract from it, to scroll up or down small amounts (like a line or a page).
You can use GetInfo (120) to find if the scroll-bar is currently hidden or not.
The existing code adds the font height (GetInfo (212)) to the current scroll position to scroll downwards a line, and subtracts it to scroll up a line.
To scroll up or down pages you need to find the size of the output window text rectangle, and add or subtract that.
Note: Available in version 4.60 onwards.
SetScroll (0, false) -- hide scroll bar, go to top of window
SetScroll (-1, false) -- hide scroll bar, go to end of window
SetScroll (-2, false) -- hide scroll bar, do not change position
SetScroll (-2, true) -- show scroll bar, do not change position
The Visible flag is optional and defaults to true.
eOK - success
View list of return code meanings
|Introduced in version
See also ...
||Gets information about the current world
Search for script function
Enter a word or phrase in the box below to narrow the list down to those that match.
The function name, prototype, summary, and description are searched.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )