Page 1 of 1

Click to unselect a ListView (when all items are selected)

Posted: Thu Sep 12, 2013 2:17 am
by said
I find it a bit unusual that once all items are selected, the only way to un-select is to use the keyboard-arrows, cant be done by mouse!

Code: Select all

  If OpenWindow(0, 0, 0, 270, 140, "ListViewGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ListViewGadget(0, 10, 10, 250, 120, #PB_ListView_MultiSelect|#PB_ListView_ClickSelect)
    For a = 1 To 5
      AddGadgetItem (0, -1, "Item " + Str(a) + " of the Listview") ; define listview content
    Next
    SetGadgetState(0, 9) ; set (beginning with 0) the tenth item as the active one
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf

Re: Click to unselect a ListView (when all items are selecte

Posted: Thu Sep 12, 2013 3:45 am
by IdeasVacuum
You can add, say, a Case for right mouse click in your loop - if the User applies a RMC on an item that is selected, deselect it.