Creation/Dev/Script/Client/GuiScrollCtrl: Difference between revisions
(Added picture, description and an example script) |
|||
Line 1: | Line 1: | ||
Inherits [[Creation/Dev/Script/Client/GuiControl|GuiControl]]. | Inherits [[Creation/Dev/Script/Client/GuiControl|GuiControl]]. | ||
=Description= | |||
[[Image:Guicontrol_scroll.png]] | |||
The scroll control is basicly a container where you can add other controls, and the scroll control is automatically displaying vertical and horizontal scroll bars so that you can reach those child controls. Use the ''hScrollBar'' and ''vScrollBar'' variables to say which scroll bars should be displayed. | |||
Use ''globalToLocalCoord()'' and ''localToGlobalCoord()'' described in [[Creation/Dev/Script/Client/GuiControl|GuiControl]] to translate between child position to mouse position and vice versa. | |||
Line 30: | Line 38: | ||
onScrolled(newposx,newposy,deltax,deltay) - either the horizontal or vertical scrollbar has been moved | onScrolled(newposx,newposy,deltax,deltay) - either the horizontal or vertical scrollbar has been moved | ||
=Example= | |||
<pre> | |||
new GuiScrollCtrl("Test_ScrollField") { | |||
profile = GuiBlueScrollProfile; | |||
x = 10; | |||
y = 10; | |||
width = 160; | |||
height = 80; | |||
hScrollBar = "dynamic"; | |||
vScrollBar = "alwaysOn"; | |||
} | |||
</pre> |
Revision as of 18:41, 16 September 2006
Inherits GuiControl.
Description
The scroll control is basicly a container where you can add other controls, and the scroll control is automatically displaying vertical and horizontal scroll bars so that you can reach those child controls. Use the hScrollBar and vScrollBar variables to say which scroll bars should be displayed.
Use globalToLocalCoord() and localToGlobalCoord() described in GuiControl to translate between child position to mouse position and vice versa.
Variables
childmargin - string
constantthumbheight - boolean
hscrollbar - string - "alwaysOn", "alwaysOff", "dynamic" - controls the horizontal scroll bar
scrollpos - string
tile - boolean
vscrollbar - string - "alwaysOn", "alwaysOff", "dynamic" - controls the vertical scroll bar
wheelscrolllines - integer
willfirstrespond - boolean
Functions
scrolldelta(int, int)
scrollto(int, int)
Events
onScrolled(newposx,newposy,deltax,deltay) - either the horizontal or vertical scrollbar has been moved
Example
new GuiScrollCtrl("Test_ScrollField") { profile = GuiBlueScrollProfile; x = 10; y = 10; width = 160; height = 80; hScrollBar = "dynamic"; vScrollBar = "alwaysOn"; }