Page 1 of 1

ListIconGadget - #PB_ListIcon_CheckBoxes - any event?

Posted: Tue Oct 07, 2008 5:23 pm
by WilliamL
Does pb generate an event when the check box is clicked? I'd like to know when I checked a box so I can react to it. I only seem to get an event if I check on the line that has the check box.

Code: Select all

If OpenWindow(0, 0, 0, 400,400, "ListIconView...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

       ListIconGadget(1, 10, 10,380,380,"First column:",200,#PB_ListIcon_CheckBoxes | #PB_ListIcon_GridLines) 
       AddGadgetColumn(1,1,"Column two",100)
       For a= 1 To 4 : AddGadgetItem(1, -1, "Line "+Chr(10)+Str(a)) : Next
              
     Repeat
       Event = WaitWindowEvent()
       Select Event
         Case #PB_Event_Gadget
           Select EventGadget()
             Case 1 
               Select EventType()
                 Case #PB_EventType_LeftClick
                     AddGadgetItem(1, -1, "left click on line "+Str(GetGadgetState(1)+1))
               EndSelect
           EndSelect
       EndSelect
     Until Event = #PB_Event_CloseWindow
EndIf
If you run this you will get a response if you click on column one or two but nothing if you click the box.

Re: ListIconGadget - #PB_ListIcon_CheckBoxes - any event?

Posted: Wed Oct 08, 2008 3:09 pm
by michel51
WilliamL wrote:Does pb generate an event when the check box is clicked? I'd like to know when I checked a box so I can react to it. I only seem to get an event if I check on the line that has the check box.
I think there is no event.
Look into the help to "getgadgetitemstate()".
You have to detect the checkbox by yourself if you have used the > #PB_ListIcon_CheckBoxes < Flag.

Posted: Wed Oct 08, 2008 5:58 pm
by WilliamL
Thanks for the reply. It's nice to get some feedback incase I overlooked something. (I keep forgetting that there is a pdf help manual to look into also.)

I decided to set the checkbox to 'checked' when the line is clicked. That way I can do the other procedures and have the check. That meets my needs in this situation. Same result, just not as intuitive.