ScrollWindow

The ScrollWindow is a container window that provides a vertical scrolling panel for all of it’s child windows.

Summary
ScrollWindowThe ScrollWindow is a container window that provides a vertical scrolling panel for all of it’s child windows.
Implementation DetailsTo use a scroll window, you add children as normal to it’s childscrollwindow.
XML DefinitionThis is the ScrollWindow XML definition.
XML Tag
Required AttributesRequired for the window element to create itself properly.
childscrollwindowName of the child Window that contains all items you wish to scroll through.
scrollbarName of the child <VerticalScrollBar> that is anchored at the appropriate location on the window.
lineheightThe line height to be used with the scrollbar.
autoHideScrollBarAuto-hides the scroll bar when the window the contents scroll child is less than one page.
ScrollWindowSetOffset()Sets the current scroll position offset.
ScrollWindowGetOffset()Returns the current scroll position offset.
ScrollWindowUpdateScrollRect()Updates the childscrollwindow and scrollbar to reflect it’s current contents.

Implementation Details

To use a scroll window, you add children as normal to it’s childscrollwindow.  This child window will resize as necissary to fit the lenght of your child windows when you call ScrollWindowUpdateScrollRect().  If the contents of the window extend beyond the size of the scroll window, the scrollbar will be shown and automatically update to reflect the lenght of your child windows.

The ScrollWindow is very useful to create a scrolling pannel of assorted data or large blocks of text.  If you want to display a list of similar information, considering using a ListBox element instead.

XML Definition

This is the ScrollWindow XML definition.

Summary
XML Tag
Required AttributesRequired for the window element to create itself properly.
childscrollwindowName of the child Window that contains all items you wish to scroll through.
scrollbarName of the child <VerticalScrollBar> that is anchored at the appropriate location on the window.
lineheightThe line height to be used with the scrollbar.
autoHideScrollBarAuto-hides the scroll bar when the window the contents scroll child is less than one page.
ScrollWindowSetOffset()Sets the current scroll position offset.
ScrollWindowGetOffset()Returns the current scroll position offset.
ScrollWindowUpdateScrollRect()Updates the childscrollwindow and scrollbar to reflect it’s current contents.

XML Tag

<ScrollWindow>
....
</ScrollWindow>

Required Attributes

Required for the window element to create itself properly.

childscrollwindow

Name of the child Window that contains all items you wish to scroll through.  The scroll child should anchored at the appropriate spot on the window.  It will be adjusted up and down automatically to facilitate scrolling.

Expects

A string value, which is the name of a valid child Window.

Default Value

  • ””

scrollbar

Name of the child <VerticalScrollBar> that is anchored at the appropriate location on the window.

Expects

A string value, which is the name of a valid child <VerticalScrollBar>.

Default Value

  • ””

lineheight

The line height to be used with the scrollbar.

Expects

A number value.

Default Value

  • 0

autoHideScrollBar

Auto-hides the scroll bar when the window the contents scroll child is less than one page.

Expects

A boolean value.

Default Value

  • false

ScrollWindowSetOffset()

Sets the current scroll position offset.

Parameters

scrollWindowName(string) The name of the ScrollWindow
scrollPos(number) The current scroll position offset.

Returns

nilno return value

Notes

  • none

Example

ScrollWindowSetOffset( "InteractionWindowMain", 0 )

ScrollWindowGetOffset()

Returns the current scroll position offset.

Parameters

scrollWindowName(string) The name of the ScrollWindow

Returns

scrollPos(number) The current scroll position offset.

Notes

  • none

Example

local scrollPos = ScrollWindowGetOffset( "InteractionWindowMain" )

ScrollWindowUpdateScrollRect()

Updates the childscrollwindow and scrollbar to reflect it’s current contents.

Parameters

scrollWindowName(string) The name of the ScrollWindow

Returns

nilno return value

Notes

  • none

Example

ScrollWindowUpdateScrollRect( "InteractionWindowMain" )
Name of the child Window that contains all items you wish to scroll through.
Window is the base level window definition.
Name of the child VerticalScrollBar that is anchored at the appropriate location on the window.
Updates the childscrollwindow and scrollbar to reflect it’s current contents.
The ListBox window element provides an automated way of viewing large tables of data without manually allocating large numbers of window elements for the display.