fb:porticula NoPaste
Demo_ListBox_2.bas
Uploader: | Muttonhead |
Datum/Zeit: | 17.07.2014 18:08:59 |
'Compileroption -s console
#include "sGUI\sGUI.bas"
#include once "sGUI\ListBox.bas"
screen 19,32,,&H04
InitGFX
dim as EventHandle ptr event
event=CreateEventHandle
dim as Gadget ptr list
list=AddListBox(event,10,10,18,5,1)'<-!!!! mode 0=bisherige Darstellung, mode=1 Spielerei mit Label und Item
GadgetOn (list)
TO_AppendLine(list, "LBL:Label 1")
TO_AppendLine(list, "ITM:001:Item 1")
TO_AppendLine(list, "ITM:100:Item 2")
TO_AppendLine(list, "ITM:003:Item 3")
TO_AppendLine(list, "LBL:Label 2")
TO_AppendLine(list, "ITM:199:Item 4")
TO_AppendLine(list, "LBL:Label 3")
TO_AppendLine(list, "ITM:101:Item 5")
TO_AppendLine(list, "ITM:120:Item 6")
TO_AppendLine(list, "ITM:053:Item 7")
TO_AppendLine(list, "LBL:Label 4")
TO_AppendLine(list, "ITM:999:Item 8")
UpdateGadget(list)
SetListBoxVal(list,53)'<-- ItemID 53 entspricht selektiertem Item 7 im mode 1 !!!!
dim as integer ff=freefile
open cons for output as ff
do
event->xSleep(1)
if event->GADGETMESSAGE then
select case event->GADGETMESSAGE
case list
print #ff, "selektierter Eintrag: " & str(GetListBoxVal(list))
end select
end if
loop until event->EXITEVENT
DestroyEventHandle (event)
end