TreeView and right mouse button

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
msu
Posts: 71
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

TreeView and right mouse button

Post 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
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: TreeView and right mouse button

Post 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.
I'm on registered MorphOS using FlowStudio.
User avatar
msu
Posts: 71
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

Re: TreeView and right mouse button

Post 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?
SamuraiCrow
Posts: 475
Joined: Fri May 15, 2015 5:15 pm
Location: Waterville, Minnesota USA

Re: TreeView and right mouse button

Post 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.
I'm on registered MorphOS using FlowStudio.
User avatar
msu
Posts: 71
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

Re: TreeView and right mouse button

Post 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.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TreeView and right mouse button

Post 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.
User avatar
msu
Posts: 71
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

Re: TreeView and right mouse button

Post 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.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TreeView and right mouse button

Post 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.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TreeView and right mouse button

Post 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.
Post Reply