Running MAC Os Mojave 10.14.6 and PB 5.73 LTS
All I want to do is check/uncheck some selected list icon checkboxes from a selection.
I have got the checking Ok selecting more than one row in the list icon and clicking Select checks the checkboxes.
Trying to uncheck them gives me a problem.
Running the code select a few entries then click select and the checkboxes are selected.
Select the same ones again and click deselect and nothing happens!
Code: Select all
If OpenWindow(0, 0, 0, 700, 300, "ListIconCheck", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(1, 10, 20, 330, 200, "Column 1", 100, #PB_ListIcon_GridLines|#PB_ListIcon_CheckBoxes|#PB_ListIcon_MultiSelect)
ButtonGadget(2,340,20,80,25,"Select")
ButtonGadget(3,340,50,80,25,"Deselect")
For b = 2 To 4
AddGadgetColumn(1, b, "Column " + Str(b), 65)
Next
For b = 0 To 5
AddGadgetItem(1, b, "Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4")
Next
Repeat
Event = WaitWindowEvent()
Select EventGadget()
Case 2
If EventType() = #PB_EventType_LeftClick
Debug "Select"
For x = 0 To CountGadgetItems(1)
Debug "Item " + Str(x)
If GetGadgetItemState(1,x) = #PB_ListIcon_Selected
SetGadgetItemState(1,x, #PB_ListIcon_Checked)
EndIf
Next
EndIf
Case 3
If EventType() = #PB_EventType_LeftClick
Debug "Unselect"
For x = 0 To CountGadgetItems(1)
If GetGadgetItemState(1,x) = #PB_ListIcon_Selected
Debug "Item " + Str(x)
SetGadgetItemState(1,x,0)
EndIf
Next
EndIf
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf