Page 1 of 1

TreeView and right mouse button

Posted: Sun May 17, 2020 6:36 pm
by msu
Hi,
just got a problem with the TreeView widget.
I want to activate an entry by right-clicking (right mouse button).
Is that possible?

greetings
msu

Re: TreeView and right mouse button

Posted: Tue May 19, 2020 5:56 pm
by SamuraiCrow
If it is not possible to right-click without triggering a menu in your OS then no. RapaGUI gadgets are native widgets in the host operating system.

Re: TreeView and right mouse button

Posted: Wed May 20, 2020 4:57 pm
by msu
If I right-click an entry in the TreeView widget, an event is surely triggered?
Does RapaGUI send a message in this case?

Re: TreeView and right mouse button

Posted: Wed May 20, 2020 5:07 pm
by SamuraiCrow
If the event is generated it is processed before it even gets to Hollywood, I think. The edit function on listview items is a double left-click. Maybe that will work also for the tree gadget. Maybe my memory is wrong but it might be consistant with that.

Re: TreeView and right mouse button

Posted: Wed May 20, 2020 6:59 pm
by msu
SamuraiCrow wrote: Wed May 20, 2020 5:07 pm If the event is generated it is processed before it even gets to Hollywood, I think. The edit function on listview items is a double left-click. Maybe that will work also for the tree gadget. Maybe my memory is wrong but it might be consistant with that.
Yes, exactly. A double left click can be processed with the TreeView widget without errors.

My plan now a little more precisely:
1. Right mouse button over a TreeView entry opens a context menu
2. Use various functions such as renaming or moving.

Re: TreeView and right mouse button

Posted: Thu May 21, 2020 12:03 pm
by airsoftsoftwair
msu wrote: Wed May 20, 2020 4:57 pm If I right-click an entry in the TreeView widget, an event is surely triggered?
Does RapaGUI send a message in this case?
Yes, but it is tied to context menus. You can attach a context menu to a treeview widget by setting Area.ContextMenu for it but it's impossible to do anything else when RMB is clicked. The only thing that can be done on RMB is to have the context menu pop up.

Re: TreeView and right mouse button

Posted: Thu May 21, 2020 1:37 pm
by msu
Okay, then I have to rethink my concept.
In Windows programs, it is actually standard that when I right-click on a TreeView entry, it automatically becomes the active entry.
In RapaGUI, an entry is only activated (highlighted) by clicking the right mouse button as long as the right mouse button remains pressed. When I release the mouse button, the original active entry is highlighted again.
This could quickly lead to confusion.

Re: TreeView and right mouse button

Posted: Thu May 21, 2020 10:10 pm
by airsoftsoftwair
Now I see what you mean. When I right-click an entry in the Demo example that comes with RapaGUI it briefly selects that entry and then jumps back to the previously active entry. This indeed looks like a bug to me.

Re: TreeView and right mouse button

Posted: Fri Jul 17, 2020 5:15 pm
by airsoftsoftwair
Ok, so this won't be fixed because it's the standard Windows behaviour. I agree it's weird but it's just the way the Windows treeview control behaves on right mouseclick when there's no context menu.