09-17-2008 08:58 AM
Hi,
I have a requirement for one of my programs. On my front panel I have different objects of different sizes. I want to resize my front panel window to the size of any particular object that I select. I should be able to maximize my window an then select another object to resize the Front panel again. This has to happen during th runtime of the program. ( in the sense, I don't want to freshly execute my program to resize it to another object) Please help me!!
Regards
Leena
09-17-2008 09:11 AM
This seems like a very strange application...
You need to use property nodes to resize the front panel, and you need to respond to events. For the resize use Front Panel Window.Panel Bounds. For the events, you can respond to the Mouse Down event. At run-time I don't know what you mean by "that I select", since you can't really select controls/indicators at run-time. You can click on them, thereby setting the focus on them, and that will generate a mouse-down event for that control/indicator. If you have a lot of controls/indicators you may want to use dynamic event registration to register the Mouse Down event for all your controls/indicators. Search the examples (Help -> Find Examples) for "events" and open the "Dynamicall Register for Events" example. I can't really say whether this is the best way because, like I said, the application seems strange, and I don't know what you've got on your front panel.
09-17-2008 09:50 AM
hi,
thanks for your quick reply!! I did mean clickling on the objects (not "select" sorry) I have already tried using the property nodes (Window bounds)..... but that doesn't give me exactly what I need. (but it is definitely something similar) The property node resizes the front panel with respect to the coordinates of the monitor (not the coordinates of the Front panel). Therefore I can resize the Front panel only to the objects that exist very close to the top left corner. I also tried the "mouse down event". The mouse down event "reads" the coordinates from the Front panel. But cannot find some property node that helps me input the Front panel coordinates. Yup, the application does sound strange, but i do need it!! ![]()
09-17-2008 10:01 AM - edited 09-17-2008 10:02 AM
links wrote:hi,
The property node resizes the front panel with respect to the coordinates of the monitor (not the coordinates of the Front panel). Therefore I can resize the Front panel only to the objects that exist very close to the top left corner.
Errr.. could you say that again in a different way? I don't quite understand that.
There's a part of this that really doesn't make much sense to me. Let's say you have a front panel that looks like this:
Now, if the VI is running, and you click on "OK 1", and I understood what you're saying, the new front panel should look like this:
OK... Now how is the user supposed to be able to click on "OK 2"?
09-17-2008 10:20 AM - edited 09-17-2008 10:21 AM
09-17-2008 10:49 AM - edited 09-17-2008 10:50 AM
I will use the maximize button (title bar, top right corner) and then continue with clicking on my next object (in your example "OK 2" )
09-17-2008 11:39 AM
09-18-2008 12:57 AM
wowww...... that is fantastic....... thanks a tonn...... that is exactly what i wanted!!!!
The property node "Origin"........ Thats the most important block in my program....... thanks again!!! ![]()
regards
09-18-2008 09:09 AM
09-19-2008 04:35 AM
Yeah sure!!! I actually simulate a Control system using Labview. Most of the time, I run a number of vi's simultaneously, where each vi have Front panels that are the size of my entire monitor. Therefore in order to avoid switching between Front panels everytime, I manually resize all my vi front panels, to display only the controls and indicators I am presently using. This definitely consumed a lot f my time when i had to do it almost 10 - 15 times a day. Therefore i planned to modify my programs, where i could select the an area in the Front panel and the entire front panel would resize to the area I selected.
Have a look at the vi I attached!! Thats the modification I needed. I have put up some dummy controls n indicators on the front panel.
This is how it functions:
- Press the "F3" key (on the keyboard) and simultaneously click and drag the mouse (front panel) over an area of interest.
- Then release the mouse n "F3" key.
=> The front panel resizes to the area selected.
- Then hit the "F3" key once again
=> The front panel resizes to the standard (original) size.
- Maximize the window using the "maximize button" on the title bar, and then try hitting th "F3" key twice.
=> The front panel resizes again to the standard size.
Well thats my program. Hope my explanation is a little more clear this time.![]()
Thanks once again.
Regards