07-13-2009 05:51 AM
Okay, I'm not sure if this is actually possible but I shall ask anyway. Partially because I have limited FP real estate and also because I think this is relatively easy method for the user to use, I have come up with the following idea:
I want something that looks similar to a menu ring when not selected, displaying the text 'Plots'. Then, when it is clicked a list/menu opens downwards (as opposed to the default operation of menu rings). In this list/menu will be an element for each plot that is displayed on an XY Graph. Each element will contain a check-box (control) and a string (indicator). The strings will each display their respective plot name. The user can then click on the list/menu/thing to show the elements for the plots, and can check or uncheck however many they wish. The idea is that whichever plots are checked will be the ones displayed on the XY Graph.
Firstly, have I explained this well enough, and secondly, is it possible?
Thank you.
James
Solved! Go to Solution.
07-13-2009 06:17 AM
Similar to the Thread Options menu in these forums (look up and the left), when the mouse is hovered over/clicked on it a menu appears below with string fields. You could create something like this with checkboxes also. To do this (and this may not be the best way but just my first thought ) you could have a modal borderless subvi appear positioned over the control that has the controls and string indicators within it that you need. It would appear when you click on your "Plots" control (which could be a simple string indicator). It would disappear if the user moved their mouse out of the subvi's window bounds for more than a few seconds (as with the Thread Options menu above).
The subvi would have to resize itself to suit the number of XY graph curve details it needs to display, but this isn't too difficult.
There may some drawbacks to this that I haven't thought of yet though...
07-13-2009 06:40 AM
Thank you for this suggestion. A couple of questions though...
How would I ensure that the SubVI is always 'aligned' with the control on the main FP?
Also, how would I make it disappear when the mouse is not over it?
And how do I make a VI borderless?
07-13-2009 06:49 AM
You need to get the position of the control via property nodes and you can set the position of the SubVi Front Panel acordingly.
You can use the FP.Open=False property to close the SubVI.
To make it borderless you need to uncheck all kinds of properties in the VI properties (like window has titel bar).
I once created pop-up menues this way, so it is possible.
Felix
07-13-2009 07:32 AM
07-13-2009 08:03 AM
07-14-2009 05:32 AM
Thank you. With a couple of tweaks here and there, it'll be working just as I'd hoped. 🙂
I have one problem though. How can I simulate 'Mouse Leave' and 'Mouse Enter' events in LabVIEW 6.1? If it's not possible, I may have to settle with a normal pop-up window.
07-14-2009 05:58 AM
Would I be going down the right path if I used the 'Coords' data field of the 'Mouse Move' event to check if the cursor is still within the boundaries of the FP?
The coords returned in this case are relative to the FP origin. However, when finding the 'FP.PanelBounds' property of the VI, the coords returned are in global screen coordinates, that is, the numbers refer to coordinates within a computer monitor's screen rather than in relation to the FP origin.
Does anyone know how I can translate one from the other and visi versa?
07-15-2009 02:31 AM
07-15-2009 03:53 AM
Okay, yes - I asked the question too quickly. I'll look more carefully next time!
This is more a general question now... Some 'Event Structure' events have a 'CtrRef' data field. If I use this reference in following code, do I then need to close it like I would every other reference? Then if I don't use it, do I still need to close it or is that done automatically? Following on from that, if that particular data field is not even shown/selected, will I be loosing memory even then by not closing the reference? At what point might I end up loosing memory if I leave it unclosed? When is the reference actually 'opened' for use?