Jump to content

"Click-through" control?


Recommended Posts

Dear all,

I'm trying to create a UI consisting of a graph and an overlaid picture with various decorations. However, I need an event to fire when I double-click on the graph in order to get the graph coordinates for the event. I can't seem to accomplish this when the overlay covers the plot area - then the "mouse down" event can never be associated with the graph, only with the overlay.

Solutions I have tried:

1) Change the order of the controls programmatically - the cleanest solution. You can do this in edit mode with the Align/Distribute/Reorder toolbar, but there doesn't seem to be a corresponding property for doing it at runtime. Am I missing something? If not, I think this is a significant flaw in Labview.

2) Move the overlay far outside the front panel window on the first mouse click, then bring it back after the second. This kind of works, but makes for an unsatisfying UI.

3) Use dynamic event registration to disable the "mouse down" event for the overlay on the first mouse click, so that the second click can be associated with a "mouse down" event on the graph. This would only work if disabling an event on a control allowed that kind of event to "pass through" to the next control in line. Unfortunately Labview isn't set up like that, so it also doesn't work.

All this is a nice learning experience, but I would rather have a working piece of code right now. Could someone give me a hint?

Thanks,

Dave

Link to comment

QUOTE(DaveKielpinski @ Nov 5 2007, 10:45 AM)

Dear all,

I'm trying to create a UI consisting of a graph and an overlaid picture with various decorations. However, I need an event to fire when I double-click on the graph in order to get the graph coordinates for the event. I can't seem to accomplish this when the overlay covers the plot area - then the "mouse down" event can never be associated with the graph, only with the overlay.

Solutions I have tried:

1) Change the order of the controls programmatically - the cleanest solution. You can do this in edit mode with the Align/Distribute/Reorder toolbar, but there doesn't seem to be a corresponding property for doing it at runtime. Am I missing something? If not, I think this is a significant flaw in Labview.

2) Move the overlay far outside the front panel window on the first mouse click, then bring it back after the second. This kind of works, but makes for an unsatisfying UI.

3) Use dynamic event registration to disable the "mouse down" event for the overlay on the first mouse click, so that the second click can be associated with a "mouse down" event on the graph. This would only work if disabling an event on a control allowed that kind of event to "pass through" to the next control in line. Unfortunately Labview isn't set up like that, so it also doesn't work.

All this is a nice learning experience, but I would rather have a working piece of code right now. Could someone give me a hint?

Thanks,

Dave

You can add an image to an 8.5 graph as an overlay, underlay. In that case you won't have issues.

Could you show the code + an image of the wanted layout?

Ton

Link to comment

QUOTE(tcplomp @ Nov 5 2007, 08:40 PM)

You can add an image to an 8.5 graph as an overlay, underlay. In that case you won't have issues.

Could you show the code + an image of the wanted layout?

Ton

hmm... I'm only running 8.2.1 for the moment. I didn't find any overlay/underlay features for graphs in my version, and I couldn't find any documentation of such a feature on the NI site.

As for code, I can show you lots of it, according to the things I previously tried (listed in my post). But it would probably be too tedious for you.

The main problem is not actually overlaying the picture on the graph - I've got that worked out. The problem is that once I overlay the picture on the graph, I can no longer get events associated with the graph.

Thanks,

Dave

Link to comment

QUOTE(DaveKielpinski @ Nov 5 2007, 12:01 PM)

As for code, I can show you lots of it, according to the things I previously tried (listed in my post). But it would probably be too tedious for you.

Try me ;)

Have a look at the following properties:

PlotImages.Back (behind the curves and raster)

PlotImages.Front (for curves and raster)

PlotImages.Middle (in between curves and raster)

These are only present for graphs and available in LabVIEW 8.2 as well

To calculate from pane/panel coordinates to graph coordinates the PlotBounds property might be usefull.

A better way is the 'Map Coords to XY' method wich converts pane coordinates (returned by a mouse down event on a decoration) to X and Y coordinates of a graph.

Ton

Link to comment

Thanks Ton! It is good to know about those "Plot Image" properties. Unfortunately the XControl I was envisioning will not work for other reasons. For instance, I wanted to have a graph X-axis with different scaling at different parts of the graph. This seems flatly impossible.

I wonder if I am discovering the limitations of Labview. It seems like NI's philosophy is to make Labview the most general WYSIWYG programming interface possible. However, the permutations that fools like me can come up with will just exceed anyone's imagination. Of course it is possible to program in Labview in a way that goes against NI's philosophy, but if you take it to an extreme, you just end up programming in a graphical version of C without all the open-source user libraries.

/rant

Link to comment

QUOTE(DaveKielpinski @ Nov 7 2007, 01:33 PM)

For instance, I wanted to have a graph X-axis with different scaling at different parts of the graph. This seems flatly impossible.
Hi,

did you take a look at the picture plot (see LV examples)?

The graph is plotted completely into a picture control so virtualy everything becomes possible... icon4.gif

TNT

Link to comment

QUOTE(DaveKielpinski @ Nov 7 2007, 12:33 PM)

I wonder if I am discovering the limitations of Labview. It seems like NI's philosophy is to make Labview the most general WYSIWYG programming interface possible. However, the permutations that fools like me can come up with will just exceed anyone's imagination. Of course it is possible to program in Labview in a way that goes against NI's philosophy, but if you take it to an extreme, you just end up programming in a graphical version of C without all the open-source user libraries.

Labwindows?

The power of LabVIEW is the block diagram (IMHO) and not the UI. Dataflow is something I :wub: .

If you want to have a mixed axis the picture is control is the tool for you. NI has provided a lot of 'open source user libraries' to build axis and make your own graphs.

Ton

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.