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

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
said
Enthusiast
Enthusiast
Posts: 342
Joined: Thu Apr 14, 2011 6:07 pm

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

Post 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
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

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

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply