API:ScrollWindowUpdateScrollRect
From RoR Wiki
UI Lua API · ScrollWindow functions
Version: WAR 1.4.8
Measures a ScrollWindow's content again and updates its scroll range and scroll bar.
ScrollWindowUpdateScrollRect(scrollWindowName)
Arguments
- scrollWindowName
string– Name of the ScrollWindow.
Returns
Nothing.
Details
- Call this after adding, removing, resizing, showing or hiding windows inside the ScrollWindow's scroll child.
- The content height runs from the top of the scroll child (or of a child window above it) to the bottom of the lowest child window. Only child windows that are shown and have a height greater than 0 are counted.
- If neither the content height nor the ScrollWindow's own height has changed since the last measurement, nothing else happens.
- Otherwise:
- The scroll bar is shown or enabled when the content is taller than the window, and hidden or disabled when it is not. Whether it is hidden or disabled depends on the ScrollWindow's definition.
- The scroll bar's range is set from the content height and the window height.
- The scroll child is resized to the content height.
Errors
Error in function call 'ScrollWindowUpdateScrollRect': Window %s does not existError in function call 'ScrollWindowUpdateScrollRect': Window %s is not a ScrollWindow
Example
From default/ea_guildwindow/source/guildwindowtaballiance.lua:
ScrollWindowUpdateScrollRect( "GWAllianceInAllianceAlliedGuilds" )
From default/easystem_layouteditor/source/layouteditor.lua:
ScrollWindowUpdateScrollRect( "LayoutEditorWindowControlScreenDialogScrollWindow" ) ScrollWindowSetOffset( "LayoutEditorWindowControlScreenDialogScrollWindow", 0 )
