07-15-2009 05:03 AM
I would expect that the compiler would not open the reference if you do not use it within the Event case.
And I would recommend closing it yourself if you do use it, because it is always a recommended strategy to close references when you are done with them.
07-15-2009 08:45 AM
Thank you. Next question! 🙂
Is it possible to have a string indicator automatically resize itself to ensure all the contained text is shown? I have found a property called Text.SizeToText, but it doesn't work as I had hoped. Any suggestions?
07-15-2009 08:52 AM
Nope, not that I know of. You'll need to do this programmatically.
There's a vi called Get Text Rectangle (vi.lib\picture\picture.llb\Get Text Rect.vi), which will tell you exactly how large your text box will be in pixels. Use the width information from this to programmatically set the width of your string indicator.
07-15-2009 11:37 AM
07-16-2009 10:49 AM - edited 07-16-2009 10:52 AM
*Deleted*
07-20-2009 09:50 AM
Is there really no way to programatically change the width of a string indicator in LabVIEW 6.1? 😞
Not sure, I don't work in 6.1 anymore, but it is quite possible it was not a writeable property in that release. Why do you need to alter the width of a string anyway? Can you not simply make the string indicator more than wide enough for all possible content?
08-11-2009 10:43 AM - edited 08-11-2009 10:46 AM
I've finaly come back to this, and appear to be doing something wrong... 😞
I'm enclosing the code of the mini menu VI, and a picture showing where it appears in relation to the 'Select Plot' Ring. All I want to do is to pin the top right corner of the VI to the bottom right corner of the ring. How hard can it be?! 😮
(The boxes pointing to the two control inputs merely state what they are, and the order of the elements in the clusters)
Please point out where I may be going wrong. Thanks.
James.
08-11-2009 04:36 PM - edited 08-11-2009 04:38 PM
Ok, your coding style is very different to mine, so it would have been much easier if you'd posted your code instead of a snapshot here. But nevermind. As I erased my own example codes, I've re-created some code to do this again.
Some pointers:
See my attached images to see how to position the top right of the checkbox subvi directly coincident with the bottom right of the ringlist object. I haven't included the subvis because the subvi has no waiting code and exits immediately, but it works as far as positioning itself goes. I've used a lot of your code as a starting block, so it will look very familiar to you. The constants for borders etc. could do with a little tweaking.
Calling vi coordinate calculations:
The checkbox subvi positioning calculations:
Result (the mouse cursor does not appear in the snapshot, but is over the ring list):
08-12-2009 08:47 AM - edited 08-12-2009 08:50 AM
I've made a few minor modifications to my code, but for some reason I still get the same result as before. 😞
I've attached a snapshot of all the code involved, and also the sub VI (I'm not allowed to share my main VI due to its content).
Alas, for I know not what I am doing wrong!
P.S. Thank you for all the help so far. 🙂
08-12-2009 09:15 AM
I would suggest you start using Probes to study the values being calculated and the coordinate for the subvi PanelBounds property. You know what they ought to be, so if they seem unreasonable, start tracking them back. Afterall, the calculations should be simple enough (subvi top = Ring list bottom, subvi right = ringlist right, subvi bottom = subvi top + height, subvi left = sibvi right - width). And the ring list bottom and right should be screen relative, as you seem to correctly calculate in your main vi.
I'm afraid I'm not in a position to download and test you own subvi at the minute 😕