UPDATED
I want to get the row state(index number) of a ListIconGadget when I press a checkbox in a ListIconsGadget.
Because now I have first select the full row then press the checkbox to detect on which row the checkbox has been pressed.
But I want to get the pressed checkbox row index nomatter what the selected full row is.
Just press only the checkbox, you then see that no row state is returned.,only if you first select one (click on text) but that is what I want.
Just run the example below and you will see.
Any suggestions are welcome
Code: Select all
If OpenWindow(0, 100, 100, 295, 360, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")
If CreateGadgetList(WindowID())
ListIconGadget(0, 10, 10, 168, 250, "Fields", 164, #PB_ListIcon_CheckBoxes|#PB_ListIcon_FullRowSelect)
AddGadgetItem(0,-1,"Field1")
AddGadgetItem(0,-1,"Field2")
EndIf
Repeat
EventID.l = WaitWindowEvent()
If EventID = #PB_EventCloseWindow ; If the user has pressed on the close button
Quit = 1
EndIf
If EventID = #PB_EventGadget
Select EventGadgetID()
Case 0
If EventType() = #PB_EventType_LeftClick
state= GetGadgetState(0)
state1= GetGadgetItemState(0,0)
MessageRequester("Info","Row: " +Str(state) + " Item State: " + Str(state1),0)
EndIf
EndSelect
EndIf
Until Quit = 1
EndIf
End
Using Windows 98 SE
Registered PB version : 3.40 (Windows)
--------------------------
C. de Visser
Author of Super Guitar Chord Finder
http://www.ready4music.com
