tsm.alandfaraway.info
Online players
Online DMs
bg.alandfaraway.info
Online players
Online DMs
ms.alandfaraway.info
Online players
Online DMs
UIListBox is a container similar to UIPane, and anything listed under UIPane that makes sense for UIListBox probably does the same thing under UIListBox. The attributes that are unique to UIListBox will be discussed in this article. Refer to UIPane for the basic attributes (Like X, Y, Height, Width, etc).
There's a couple different ways list boxes are used. A list box can be used for displaying multiple rows of objects. Things like the Feat List or the lines of text in the chat windows use it this way. This is accomplished by just adding multiple objects to the list box. Typically these objects are the same size, but that is not a requirement.
A list box can also be used for containing a single large text field and being able to scroll over that text field. This can be seen in places like the class and race descriptions on character creation. This approach is accomplished by having a single text field within the list box, making the height of the text field dynamic, and changing the text of the text field. The listbox will allow for scrolling over the large text field.
If the engine finds a UIFrame nested within a UIListBox while loading the XML, it treats that UIFrame as a border for the full size of the listbox. This may be untested behavior since a separate UIFrame is typically added to the UIScene to act as the border.
If the engine finds a UIScrollBar nested within a UIListBox while loading the XML, that scrollbar will become the scrollbar for the UIListBox and be attached to the left or right depending on the attributes.
A UIListBox can contain the following types of UIObjects as its rows: UIButton, UILabel, UIHotbarbutton, UIText, UICollapsable, UIPane, UIGrid, UIIcon, UITextTree
If the object found has an attribute called 'prototype=true', then that object becomes the ProtoType for the list box. The prototype defines all the attributes, styles, etc., that each row added dynamically to the listbox should have. Unfortunately, this is something better experimented with to understand rather than trying to explain. But in brief, find a listbox that has a prototype object in the game, and see what effect changing the prototype's attributes have on the way the listbox rows look in the game.
hidescrollbar If this is set to true, then the scrollbar will be hidden no matter what. This is for the rare case you may want text to scroll by but don't care to have the user able to scroll back up. Defaults to false.
hidescrollbarwhennotneeded If this is set to true, the scrollbar will be hidden unless there are enough contents within the listbox to require scrolling to see them all. Defaults to false.
scrollbaronright Setting this to true moves the scrollbar over to the right side of the listbox. Setting it to false will move the scroll bar to the left side of the listbox. The default behavior is 'true'.
scrollsegmentsize This is how many pixels you want the listbox to scroll for each 'scroll click' on the part of the user. The parameter is a number, the default value is 1.
selectonleftclick This tells the game that you want the user to be able to click on the rows of the listbox. This means that the listbox is intended to contain a number of rows and you want the user to pick a row. It is false by default. If false, clicking on a row will perform the OnLeftClick callback if you click on a button row, or will set the text field as the focus if there is just a single large text field in the listbox. If true, clicking on a row will still execute the OnLeftClick callback for the button if there is one. It will also set that row as selected.
showpartialchild This tells the listbox if it should just clip the bottom row if it can't show the entire row. Parameters are 'true' or 'false'. Default is true.
snaptobottom Setting this to 'true' will snap the listbox to the bottom of the container any time the text field in the listbox is resized. This is used mostly for situations where text keeps getting added to a text field and you want the listbox to keep scrolling to the bottom to display all the text.
unequalcontrols The purpose of this attribute is to speed up performance on listboxes where each row is the same height. If your list box will definitely have each row with the same height, then set this to false to speed up scrolling with that list box.
xPadding The amount of padding that the listbox should put between the edges of the listbox and the contents of the listbox. This padding is applied equally to both sides. So if the padding is 5, and the listbox is 100 pixels wide, then the listbox will constrain the rows to a max width of 90.
yPadding The amount of padding that the listbox puts between each row. This includes padding between the top row and the top of the listbox and the bottom row and the bottom of the listbox as well.
Powered by Drupal & phpBB3