Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 7 and Version 8 of code/doc/GUI


Ignore:
Timestamp:
May 21, 2009, 2:56:52 AM (15 years ago)
Author:
bknecht
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/GUI

    v7 v8  
    9898==== Listbox ====
    9999
     100Listbox is a box where you have a list of ListboxItems which you can choose from. See this example on how to create a Listbox in Lua:
     101
    100102{{{
    101103list = windowManager:createWindow("TaharezLook/Listbox", "listbox")
     
    103105CEGUI.toListbox(list):addItem(item)
    104106}}}
     107
     108To be able to choose an item in the Listbox use
     109
     110{{{
     111item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     112}}}
     113
     114The selected item is received when calling
     115
     116{{{
     117list:getFirstSelectedItem()
     118}}}
     119
     120If nothing is chosen, the function returns ''nil''.
     121
     122To react on events use
     123 * ''ListItemsChanged'' - For changed content of the list
     124 * ''ItemSelectionChanged'' - If the selection of an item changed
     125
     126Other events are easy to figure out from their documented event name. Just drop the ''Event'' and you're good to go.