Beta Documentation - Subject to change.
Sets the orientation of elements in the listbox.
Syntax
Lua |
---|
function ListBox:SetOrientation(value);
|
Parameters
- value
-
Type:
number
Sets the direction in which elements are laid out in the listbox.
Remarks
Examples
This example demonstrates a listbox whose elements are laid out from left to right instead of top to bottom.
Creating a Horizontal ListBox | Copy Code |
---|
window = Turbine.UI.Lotro.Window();
window:SetPosition( 200, 200 );
window:SetSize( 200, 200 );
window:SetText( "Test" );
window:SetVisible( true );
listbox = Turbine.UI.ListBox();
listbox:SetParent( window );
listbox:SetBackColor( Turbine.UI.Color( 0.2, 0.2, 0.2 ) );
listbox:SetPosition( 30, 50 );
listbox:SetSize( 140, 120 );
listbox:SetOrientation( Turbine.UI.Orientation.Horizontal );
for i = 1, 20 do
local listItem = Turbine.UI.Control();
listItem:SetSize( 20, 50 );
listItem:SetBackColor( Turbine.UI.Color( math.random(), math.random(), math.random() ) );
listbox:AddItem( listItem );
end
|
See Also