Rightclick support for ListViewGadget
Rightclick support for ListViewGadget
Not a big deal, but could ListViewGadgets support the right click event type without the need for API? I couldn't figure out why my code wasn't working until I read that ListView only fires left click events.
Re: Rightclick support for ListViewGadget
Would like to ask again to add the rightclick for the ListView gadget.
MacBook Pro-M1 (2021), Sequoia 15.4, PB 6.20
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: Rightclick support for ListViewGadget
I would appreciate that, too.
Regards, Little John
Regards, Little John
Re: Rightclick support for ListViewGadget
Hello everyone,
Sorry to re-open a old topic, I prefer to post here instead to create a new one. I'm working on professional project and I for one element to display I wish to use a ListViewGadget() what is my surprise when I try to use a Right Mouse Click to display a Popup Menu. It didn't work because no event.
The only workaround is to use a ListIconGadget() with only one column. It's working but visually speaking it's very ugly because I don't need a title and leaving it empty is ...
So any chance to have #PB_EventType_RightClick #PB_EventType_RightDoubleClick for the ListViewGadget() for the next version ?
Best regards
Guimauve
Sorry to re-open a old topic, I prefer to post here instead to create a new one. I'm working on professional project and I for one element to display I wish to use a ListViewGadget() what is my surprise when I try to use a Right Mouse Click to display a Popup Menu. It didn't work because no event.
The only workaround is to use a ListIconGadget() with only one column. It's working but visually speaking it's very ugly because I don't need a title and leaving it empty is ...
So any chance to have #PB_EventType_RightClick #PB_EventType_RightDoubleClick for the ListViewGadget() for the next version ?
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
Re: Rightclick support for ListViewGadget
+1 for RightClick and RightDoubleClick
@Guimauve: But in your case you can use #LVS_NOCOLUMNHEADER:
br Kevin
@Guimauve: But in your case you can use #LVS_NOCOLUMNHEADER:
Code: Select all
If OpenWindow(0, 0, 0, 400, 300, "Test")
ListIconGadget(0, 10, 10, 380, 280, "", 355, #LVS_NOCOLUMNHEADER)
For i = 0 To 99
AddGadgetItem(0, -1, Str(i+1)+". Element")
Next
Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf



Re: Rightclick support for ListViewGadget
+1 for RightClick and RightDoubleClick
Would be nice if it were in the spirit of PureBasic: cross-platform!
Would be nice if it were in the spirit of PureBasic: cross-platform!
DE AA EB
Re: Rightclick support for ListViewGadget
Only if I create a program for Windows. But it's not the case, I'm working on Linux.CSHW89 wrote:+1 for RightClick and RightDoubleClick
@Guimauve: But in your case you can use #LVS_NOCOLUMNHEADER:
br Kevin
I will have to check if it's possible to do something similar with GTK+
Best regards
Guimauve
Dear Optimist, Pessimist,
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
and Realist,
While you guys were
busy arguing about the
glass of water, I DRANK IT !
Sincerely,
the Opportunist
Re: Rightclick support for ListViewGadget
Guimauve wrote:I will have to check if it's possible to do something similar with GTK+
Code: Select all
ProcedureC GdkEventHandler(*EventButton.GdkEventButton, UserData.I)
Protected *ListView.GtkWidget
If *EventButton\type = #GDK_BUTTON_PRESS
*ListView = GadgetID(0)
If *ListView\window = gdk_window_get_parent_(*EventButton\window)
If *EventButton\button = 3
Debug "Right click detected"
EndIf
EndIf
EndIf
gtk_main_do_event_(*EventButton)
EndProcedure
OpenWindow(0, 200, 100, 220, 140, "Detect right click", #PB_Window_SystemMenu)
ListViewGadget(0, 10, 10, 200, 120)
For i = 1 To 5
AddGadgetItem(0, -1, "Line " + Str(i))
Next i
gdk_event_handler_set_(@GdkEventHandler(), 0, 0)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Code: Select all
#Window = 0
#ListView = 0
ProcedureC GdkEventHandler(*EventButton.GdkEventButton, UserData.I)
Protected *ListView.GtkWidget
If *EventButton\type = #GDK_BUTTON_PRESS
*ListView = GadgetID(#ListView)
If *ListView\window = gdk_window_get_parent_(*EventButton\window)
If *EventButton\button = 3
PostEvent(#PB_Event_Gadget, #Window, #ListView, #PB_EventType_RightClick)
EndIf
EndIf
EndIf
gtk_main_do_event_(*EventButton)
EndProcedure
OpenWindow(#Window, 200, 100, 220, 140, "Detect right click", #PB_Window_SystemMenu)
ListViewGadget(#ListView, 10, 10, 200, 120)
For i = 1 To 5
AddGadgetItem(0, -1, "Line " + Str(i))
Next i
gdk_event_handler_set_(@GdkEventHandler(), 0, 0)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = #ListView
Select EventType()
Case #PB_EventType_LeftClick
Debug "Left click on line " + Str(GetGadgetState(#ListView) + 1)
Case #PB_EventType_RightClick
Debug "Right click on line " + Str(GetGadgetState(#ListView) + 1)
EndSelect
EndIf
EndSelect
ForEver
- Andre
- PureBasic Team
- Posts: 2137
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: Rightclick support for ListViewGadget
+1 for rightclick support at ListViewGadget and other eventtypes, already supported by ListIconGadget.
Re: Rightclick support for ListViewGadget
+1 for rightclick support at ListViewGadget and other eventtypes, already supported by ListIconGadget.
DE AA EB
Re: Rightclick support for ListViewGadget
+1 for RightClick and RightDoubleClick and cross-platform !
Re: Rightclick support for ListViewGadget
+1 for RightClick
As PB starter I haven't tested all Gadget's to know what events they can accept, but LeftClick and RightClick should be a minimum for all in my opinion. Cross-platform.
LeftClick to select wherever possible and RightClick to connect a popup menu or label for info or add-delete-insert-copy-move actions etc. (like insert a column...for ListView).
As PB starter I haven't tested all Gadget's to know what events they can accept, but LeftClick and RightClick should be a minimum for all in my opinion. Cross-platform.
LeftClick to select wherever possible and RightClick to connect a popup menu or label for info or add-delete-insert-copy-move actions etc. (like insert a column...for ListView).
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Re: Rightclick support for ListViewGadget
+1, been limited by this before!
Re: Rightclick support for ListViewGadget
+1 RightClick
But not sure for what a DoubleRightClick might be useful... But implementation is OK.
But not sure for what a DoubleRightClick might be useful... But implementation is OK.
- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%