LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change the selection of tree control with a right click

How is it possible to change the item selected in a tree control (LabVIEW7) with a mouse right click ?
0 Kudos
Message 1 of 8
(4,014 Views)
Hi,

With an event structure, you can catch the mouse down event, and change the
button value. The event is send again with the modified button.

Regards,

Wiebe.

"Filippo" wrote in message
news:50650000000800000053CD0000-1079395200000@exchange.ni.com...
> How is it possible to change the item selected in a tree control
> (LabVIEW7) with a mouse right click ?
0 Kudos
Message 2 of 8
(4,014 Views)
Thanks a lot, but the problem is quite different. When I right click on a tree item, a pop-up menu is displayed, but it must be bound to the item clicked, but the item selected can be different. So, if I right click on the first tree item, the item selected must change in the first item, but I don't know what is the right clicked item. I know only the mouse coordinates.
I tried to generate a left click by a simple dll using mouse_event function, but it doesn't work properly.

Filippo
0 Kudos
Message 3 of 8
(4,014 Views)
Filippo,

As I understand, you want to have a custom popup menu when you right click a
tree item. The menu item(s) should depend on the tree item selected.

If this is what you need, I can send an example.

Regards,

Wiebe.


"Filippo" wrote in message
news:50650000000500000061770100-1079395200000@exchange.ni.com...
> Thanks a lot, but the problem is quite different. When I right click
> on a tree item, a pop-up menu is displayed, but it must be bound to
> the item clicked, but the item selected can be different. So, if I
> right click on the first tree item, the item selected must change in
> the first item, but I don't know what is the right clicked item. I
> know only the mouse coordinates.
> I tried to generate a left click by a
simple dll using mouse_event
> function, but it doesn't work properly.
>
> Filippo
0 Kudos
Message 4 of 8
(4,014 Views)
Sorry for my english ! If you can send me an example, it could be very useful for me.
My e-mail is : pippovic@inwind.it.
Thanks.
Regards,

Filippo
0 Kudos
Message 5 of 8
(4,014 Views)
Filippo,

Here is a popup menu toolkit, with an additional example for a listbox. If I
understand your problem, it shouldn't be hard to change it to a tree
control.

Regards,

Wiebe.

"Filippo" wrote in message
news:506500000005000000E6770100-1079395200000@exchange.ni.com...
> Sorry for my english ! If you can send me an example, it could be very
> useful for me.
> My e-mail is : pippovic@inwind.it.
> Thanks.
> Regards,
>
> Filippo



[Attachment Menu 042004.zip, see below]
0 Kudos
Message 6 of 8
(4,014 Views)
Ciao Filippo,

so che non è molto educato nei confronti degli altri scrivere in italiano ma sarebbe utile per me capire esattamente il problema proposto. CIAO!
0 Kudos
Message 7 of 8
(4,014 Views)
Faremo un piccolo strappo alla regola.
Io devo visualizzare un pop-up menu personalizzato quando si clicca con il tasto destro su un item di un tree control. Il problema sta nel fatto che se l'item selezionato è il primo e io clicco con destro su un item diverso, la selezione rimane la medesima, cioè il primo, mentre è necessario che cambi, anche perchè il menù visualizzato può dipendere dall'item stesso. Con un list control il problema si risolve semplicemente come si vede nell'esempio allegato. Con il tree control la soluzione è stata generare un click sinistro con una semplice dll in C,ogni volta che avviene un click destro. Qualche effetto collaterale c'è perchè cmq in LabVIEW viene visto un evento Mouse Down e Mouse Up, da gestire di
conseguenza. Non so se è la via migliore, ma per ora è l'unica trovata.
Il menù è stato poi realizzato con un ulteriore tree control in quanto è possibile inserire anche delle icone.

Ciao

Filippo
0 Kudos
Message 8 of 8
(4,014 Views)