10-20-2010 02:46 PM
Hello, I was wondering if some one can help me to do this. I want to place a small image / picture on front panel. And if i double click on that image it should open a dialogue box or a sub vi.
thanks in advance,
Sulekha.
10-20-2010 02:57 PM
You can use the Mouse Down? event for the picture indicator. Then you can read the Mods terminal that shows up inside on the left hand side of the event case to see if a double click has occurred.
10-20-2010 03:34 PM
Ravens do you have any link that explains the theory, how to deal with the image on front panels. I did a search in the forum but couldnt find any luck. If you have any can you please post it.
10-20-2010 03:36 PM
Ravens I dont see any indicator on the block diagram when i place a picture on the front panel.
10-20-2010 04:42 PM - edited 10-20-2010 04:51 PM
You need to place a "2d picture control" right-click and change to indicator. You cant just copy and paste any ol' bitmap onto your front panel and expect a picture indicator to show up.
10-20-2010 09:40 PM - edited 10-20-2010 09:40 PM
Thanks, Imstuck. Excellent image.
I guess there is one other way to do it if the poster doesn't want a picture control or indicator on the front panel, but just has an image dropped on it as a decoration. That would be to do a Mouse Down? event on the VI's pane, and compare the coordinate's of the mouse with some coordinates that define the location of the image.
But it would be a lot easier to just have the picture be an actual picture indicator or control.
10-20-2010 10:12 PM
Thank you Ravens and Imstuck for the explanation. I created a vi with out 2-D picture control logic. This is opening the sub vi when i double click it during run time. But is there any way to open the sub vi or an dialogue box by double clicking the image with out actually running the vi.
Sulekha.
10-20-2010 10:23 PM - edited 10-20-2010 10:24 PM
@sulekha wrote:
But is there any way to open the sub vi or an dialogue box by double clicking the image with out actually running the vi.
Sulekha.
No, because a VI has to be running in order for the code inside of it to be able to execute.
Why would your main VI not be running?
10-20-2010 10:47 PM
My Main should not be running because I want to do some thing like this:
I want to hide a path control in a dialouge box. Where user clicks a image on the front panel, which opens a box containing path, so that he can feed a text file, which is used by some other part of my main program.
thank you.
10-20-2010 11:07 PM
At what point of time do you ever get your Main VI running? What do you want your Main VI to do once you actually start it running?
Perhaps it just a matter of having your Main VI running but just idling in a while loop waiting for something else to happen before you get to the meat of your program that will occur in the main VI.
One other possible way, and I'm not really sure if this can be done since I have no experience with them, is to use an Xcontrol. These are special controls you create that have some background code you can execute.
But before I can really recommend you use Xcontrols (assuming they can do what I am thinking), is that you truly define what your program's architecture is going to be as it seems to not be very defined right now.