LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I undo the usage of the Control method "ObjHighlight"?

I have a piece of code which uses the VI Server method "ObjHighlight" based on actions on a tree control.

 

I have the slight problem, however, that when I try to highlight different items successively without user interaction then any previously highlighted object remains highlighted also and it looks like I'm shift-selecting items.

 

How do I limit the "ObjHighlight" method to only a single item programatically.  I know that clicking on the FP the object is on will reset the highlight, but can this be done programatically?

0 Kudos
Message 1 of 13
(3,876 Views)

Shane,

 

can you attach an example? I dont seem be able to reproduce the issue...

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 13
(3,867 Views)

I would think that the selection mode property would be a good thing to try.

 

But I'm clearly confused.  Doesn't ObjHighlight blink the entire tree object? or am I missing how you are using that method?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 13
(3,861 Views)

The tree inclusion is probably misleading.

 

My "Tree" is simply representing the internal hierarchy of a specific VI, Controls, Tabs and what not.  I want the user to be able to double click on any given control there and highlight that object on the VI.

 

The tree itself is not being highlighted, it's simply controlling which other object should be highlighted.

 

It'll be hard to get an example without posting too much code because I'm parsing an entire hierarchy of VIs using come of my own tools and re-creating a VI server reference from a stored HEX value for the control which actually resides in a different project.

 

0 Kudos
Message 4 of 13
(3,847 Views)

Shane,

 

attached my approach in LV 2014. Is your approach comparable? If not, how does it differ?

 

Norbert

 

PS: Sorry for using a template VI, but still it is not possible to attach VI-files with my browser (Mozilla) 😞

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 13
(3,840 Views)

Of course trying to get a working demo leads to the problem not occurring.

 

It might be important that I'm accessing objects in this way across project boundaries.  When the objects are in the same project at least, it seems to be no problem.

 

I need to dig deeper.

 

Shane.

 

PS Mine differs in that it's in LV 2012 (Can't open the attachment, sorry)

0 Kudos
Message 6 of 13
(3,838 Views)

That would be where I misunderstood.

 

Assuming: the object located and highlighted is on an idle vi.  Undo Transaction "Should" unhighlight.

 

Catching back up-

 

I wonder if you are getting 1 highlighted object per context.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 13
(3,831 Views)

OK, I managed to recreate the problem in a smaller VI.

 

I think it's important that the Controls are being highlighted in a different project than the code highlighting them.

 

Here's an example which opens references to ALL VIs in memory in ALL projects in memory (bear this in mind before running the code, I have ZERO clean-up code in there).

 

It then presents a ring with all "VI"s in memory.  Selecting "Highlight" will step through all controls on the selected VI FP top-level and highlight them all with a 250ms wait between each one.

 

On my machine at least when it's finished, ALL controls are highlighted, not just one.

 

Edit: Sorry, I just added a different version of the file without our entire project hierarchy stored within the Ring..... Oops. Smiley Embarassed

0 Kudos
Message 8 of 13
(3,821 Views)

Ah, i see what you mean. It seems that it selected the controls (similar to CTRL+A). Is that what you are seeing?

 

One remark: It does not happen on VIs which are password-protected....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 13
(3,801 Views)

Before you call the ObjHighlight method try getting the reference to the control's owning VI, get its FP reference and call the 'Clear Selection' method on the FP.  This should leave you with only the last object selected.  If you want no selecting then simply wire False to the Selected property of the control after you call the ObjHighlight method.

Message 10 of 13
(3,789 Views)