LeftClick Event in ListIcon undetected

Just starting out? Need help? Post your questions and find answers here.
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

LeftClick Event in ListIcon undetected

Post by tatanas »

Hi,
I first thought it was a bug in my program but I tried this snipet :

Code: Select all

 
If OpenWindow(0, 0, 0, 700, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	
	ListIconGadget(0,  10,  25, 330, 70, "lv1", 100)
	AddGadgetItem(0, -1, "item1")
	ListIconGadget(1,  10, 120, 330, 70, "lv2", 100, #PB_ListIcon_CheckBoxes)
	AddGadgetItem(1, -1, "item1")
	ListIconGadget(2,  10, 215, 330, 70, "lv3", 100, #PB_ListIcon_MultiSelect)
	AddGadgetItem(2, -1, "item1")
	
	Repeat
		event = WaitWindowEvent()
		
		If event = #PB_Event_Gadget
			Select EventGadget()
				Case 0
					If EventType() = #PB_EventType_LeftClick
						Debug "click lv1"
					EndIf
					
				Case 1
					If EventType() = #PB_EventType_LeftClick
						Debug "click lv2"
					EndIf				
					
				Case 2
					If EventType() = #PB_EventType_LeftClick
						Debug "click lv3"
					EndIf
					
			EndSelect			
		EndIf   	
		
	Until event = #PB_Event_CloseWindow
EndIf

As soos as the #PB_ListIcon_MultiSelect Flag is set, the ListIcon don't receive #PB_EventType_LeftClick anymore. But it works if you click on an item in this listicon and the double click is captured too.

PB 5.72 x64 / Windows 7 x64
Windows 10 Pro x64
PureBasic 6.04 x64
User avatar
mk-soft
Always Here
Always Here
Posts: 5387
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: LeftClick Event in ListIcon undetected

Post by mk-soft »

Its the same as by PB v.5.46,v5.71,v5.72

I think it is normal with list and multi selection.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: LeftClick Event in ListIcon undetected

Post by tatanas »

Ah ok.

So the only way to handle this event is WM_NOTIFY on the listicon ?
Windows 10 Pro x64
PureBasic 6.04 x64
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: LeftClick Event in ListIcon undetected

Post by RASHAD »

Work as expected
PB 5.72 x86 Windows 7 SP1 x64
Egypt my love
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: LeftClick Event in ListIcon undetected

Post by tatanas »

What do you mean by "as expected" ?
My snipet returns an leftclick event when you click (not an item) on listview background with multiselect flag ?
Or as mk-soft said, this is a normal behaviour ?
Windows 10 Pro x64
PureBasic 6.04 x64
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4659
Joined: Sun Apr 12, 2009 6:27 am

Re: LeftClick Event in ListIcon undetected

Post by RASHAD »

#PB_EventType_LeftClick: left click on an item, or a checkbox was checked/unchecked
#PB_EventType_LeftDoubleClick
#PB_EventType_RightClick
#PB_EventType_RightDoubleClick
#PB_EventType_Change: the current item changed
#PB_EventType_DragStart: the user tried to start a Drag & Drop operation.
Read the manual(Work as expected)
Egypt my love
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: LeftClick Event in ListIcon undetected

Post by tatanas »

Damn, shame on me :oops:
Windows 10 Pro x64
PureBasic 6.04 x64
User avatar
mk-soft
Always Here
Always Here
Posts: 5387
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: LeftClick Event in ListIcon undetected

Post by mk-soft »

It's not clear.

With a ListIconGadget without multi selection an event LeftClick will occur if no item is selected.
For a ListIconGadget with multi selection no event.

You don't have to be ashamed
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Post Reply