LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
VDB_1

Created controls and indicators should always be placed within the bounds of the front panel

Status: Completed

 Available in LabVIEW NXG. All new controls and indicators on the front panel are placed in the Unplaced Items Tray. A similar approach is taken for control and indicator terminals on the block diagram.

Consider the following scenario:

 

You have a front panel with a fixed size and all controls are placed exactly as you want them.

Now you click a wire on the diagram and select “Create Control” or “Create Indicator”. In my experience this new control is created outside of the front panels bounds in 90% of all cases…

 

Now you need to resize the front panel, find the control, move it to the desired position, and resize the front panel back to its original size. And if you’re really lucky you also need to scroll around the front panel and set the origin back to its original position...


I’m aware that I could set the front panel and window bounds properties at the start of the program to set the size and origin of the FP, but that doesn’t help me much when I’m editing. I would need to start the VI once to set these properties.

 

Life would be so much easier if the control would just be placed in the center of the front panel…

9 Comments
altenbach
Knight of NI

Some related ideas that address your problems in a different way:

 

 

 

AristosQueue (NI)
NI Employee (retired)

VDB_1: What version of LabVIEW are you using? I haven't seen a control appear outside the visible panel bounds in many years. I'm pretty sure that somewhere around LV 7.1 that was guaranteed. Looking at the actual code, the new control appears in the same relative position on the panel as the FPTerminal does on the diagram (and vice versa, for that matter). If there's already a control in that position, the new control slides to the nearest empty space on the visible panel. The only time that a control moves out of the bounds is when there is no empty space anywhere on the visible panel because you've already got controls in the way.

 

I'm not saying there aren't better algorithms for picking the place, or altogether better ways of doing this (like the unplaced items tray), but the particular problem that you cite is one that I just don't see.

kegghead
Member
AQ is correct, but the problem still arises frequently with large controls, especially cluster typedefs. Also with full panels. In these cases I'd prefer the control to be placed somewhere in bounds, but at the top of the z stack.
Broken_Arrow
Active Participant

This happens to me with a Place Contents VI that I use to place an Error In and Error Out on the BD. When I go to the FP, it's never in the FP bounds. I've always thought it was a problem with the VI, but maybe it's this, since trying to fix it didn't work.

Richard






VDB_1
Member

AQ, this happens in 2010, haven't tested it in 2011 yet. You're right, this problem occurs when there's not enough empty space left.

keggheads suggestion is very good, stay with the current algorithm and only place a new control in the middle if it doesn't fit in some free space within the FPs bounds.

tst
Knight of NI Knight of NI
Knight of NI

> Looking at the actual code, the new control appears in the same relative position on the panel as the FPTerminal does on the diagram

 


One thing to note is that when you paste code it does play with it. For example (this is in 2009):

 

  1. Create a blank VI.
  2. Scroll the panel in some direction enough so that it's noticable (2000 px or so should do the trick)
  3. Drop a control.
  4. Go to the BD and copy the terminal.
  5. Create another blank VI.
  6. Go to the BD.
  7. Drop something in the BD and now scroll the BD to another direction than you did in step 2.
  8. Paste the terminal into where you are now in the BD.
  9. The control is now placed somewhere completely off, presumably somehow refering to the original ratio between its FP and BD position.

___________________
Try to take over the world!
wired
Active Participant

I've had this mess up my front panel containing splitter bars in LV2010. Undo got rid of the control, but the front panel was still messed up and splitter bars had to be repositioned.

 

Big Kudos!

altenbach
Knight of NI

I must say that my front panel is typically "full" and perfectly aligned and whenever I add new features, the new controls are outside, forcing me to scroll and messing with my alignment.

 

(I just noticed a probably closely related issue: Placement of the front panel objects when pasting a snippet. I just dropped a snippet into a completely blank VI and the front panel graph was way off to the lower right edge, with only about 25% of it showing in the visible area of the FP. The placement math is useless and needs more intelligence! Since dragging a snippet from the explorer requires two windows, the code is typically dropped near the edge of the diagram. LabVIEW should still make some efforts to keep the associated front panel objects mostly in view if possible.)

Darren
Proven Zealot
Status changed to: Completed

 Available in LabVIEW NXG. All new controls and indicators on the front panel are placed in the Unplaced Items Tray. A similar approach is taken for control and indicator terminals on the block diagram.