NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Resizing an ExpressionEdit control

I've added a couple of ExpressionEdit controls to my customized TestStand Operator interface, but I cannot seem to resize them vertically.  As shown in the attachment, when I grab the resizing handles, the outside border seems to grow, but the actual ExpressionEdit stays the same size.  How do I grow this control vertically?
0 Kudos
Message 1 of 9
(4,725 Views)
On the General property page, check the Multiline option.
Message 2 of 9
(4,720 Views)

That worked great.  Now I have some more fundamental (but harder to answer) questions.

In TS3.5,  I worked with mainly ONE VI called Full OI -Resize Controls to resize the base front panel controls, plus those I added.  It seems in TS4.0, there are quite a few of these resize VIs (such as Full UI - Update Border Between ListBar and Tab Control, Full UI - Update Drag Bar Between ExecutionSteps and CallStack, etc).

1) If I disallow the operator from modifying the size of the borders of Top VI, why do we need all of these resize VIs. 
2) Is there a decent explanation somewhere that describes how, when one adds controls to the Top Level, what changes need to be made behind the scenes..                        

0 Kudos
Message 3 of 9
(4,710 Views)

 

1) If I disallow the operator from modifying the size of the borders of Top VI, why do we need all of these resize VIs. 

You could possibly get rid of all the resizing code if you will not allow your users to resize the window, adjust pane sizes using the drag bar, or hide controls (i.e. when enabling or disabling editing).  Try replacing Full UI Arrange Controls.vi with a VI that does nothing and you will get an idea of what the resizing code does for you.   If you really want everything fixed, then you don't need it.   However, most users like to have the option to resize panes and windows.

You could possibly get rid of all the resizing code if you will not allow your users to resize the window, adjust pane sizes using the drag bar, or hide controls (i.e. when enabling or disabling editing).  try replacing Full UI Arrange Controls.vi with a VI that does nothing and you will get an idea of what the resizing code does for you.   If you really want everything fixed, then you don't need it.   However, most users like to have the option to resize panes and windows.

2) Is there a decent explanation somewhere that describes how, when one adds controls to the Top Level, what changes need to be made behind the scenes..       

 

I think this would be an excellent KB topic, I will suggest Allen look into writing one, especially since he now will have something to start with...   Here are the main points:

 

Full UI Arrange Controls is the one VI where all the resizing starts.   To make it readable I added a lot of subVIs, however they are just logical groupings.  You don't really need these subVIs but without them Full UI Arrange Controls is huge and very difficult to read.  Inside of these subVIs you will find some low level functions from the TestStand palette: TestStand - Create control Info, TestStand - Divide Space Between Panes.vi,   TestStand - Update Control Positions and Sizes.vi, and TestStand - Drag Splitter.vi.  You should try to make use of these VIs as they can make your life a lot easier.

 

Note that TestStand - Create control Info and TestStand - Update Control Positions and Sizes.vi are polymorphic VIs- because the TestStand controls are in ActiveX Containers but the tab control is a regular LabVIEW control.   Because of LabVIEW type restrictions you can't interchange these references freely, and to complicate matters you sometimes need a reference to the control's borders object as well as a reference to the active X container containing the control. 

 

To get around type issues I created a common data structure with all of the size info from a control called the control info cluster.  You can use TestStand - Create control Info to get a filled control info cluster.  You then build an array of these control info clusters and pass it to a resizing VI such as TestStand - Divide Space Between Panes.vi or TestStand - Drag Splitter.vi.   You get out an updated array of control info clusters, index the array and pass them to TestStand - Update Control Positions and Sizes.vi which resizes the actual control.   Some good examples to look at are Full UI - Update Drag Bar Between ExecutionVariables CallStack and Threads.vi Full UI - Update Border Between ListBar and Tab Control.vi.   

 

Let's say that you inserted another control between Variables and the Sequence list. To update the horizontal size you would need to change Full UI update drag bar between fileVariables and sequencesList to add another call to Create control Info for you new control, add it to the array between the other two control info clusters.  You also have to update the array indexing of the output too- the index of the control on the input must match the index of the control on the output or you will have some very strange behavior!    Finally you will add a call to TestStand - Update Control Positions and Sizes.vi to resize and reposition your new control.

 

To update vertical sizing, edit Full UI - Update Drag Bar Between FileSteps and SequencesList.vi - the top and height of the filesVariables control (and your new control) should be the same as the Sequences List Control.

 

You would also need update the border drag call back Update Drag Bar Between FileVariables and SequencesList.vi and add a border drag callback for your new control as well as saving and reloading the control size (full UI - Load Control Sizes.vi and Full UI - ApplicationMgr Query Shutdown.vi).    You may want your control hidden when not in editor mode (Full UI - Hide Editor Only Controls.vi) or if it is always visible you may want to resize it differently when not in editor mode (inner most case structure in Full UI Arrange Controls.vi).

 

-Rick Francis

Message 4 of 9
(4,680 Views)

That is great info.  But, of course, I have a couple of questions. 

(1) I have experimented (unsuccesfully) with the Space Start and Space End of the TestStand - Divide Space Between Panes.vi.  In the original TopLevel, the FileSteps and SequenceList were being divided (right?).  I didn't see how the Space Start and Space End values passed in accomplished this. 

(2) I'm trying to re-organize the TopLevel Front Panel such that on the SequenceFile Tab, the FileSteps are at the top-left and go almost all the way down to the bottom of the tab control.  At the bottom (taking up about 1/2 inch) are the TestUUTs, SinglePass, Run MainSequence buttons.  To the right of the FileSteps (taking up the right 1/3 of the tab control) are the FileVariables, the SequenceList, the Threads (which I don't even want to display), and two ExpressionEdit boxes that I added to display the Descriptions of the SequenceFile and the selected Sequence.  These five 'panes' go from top to bottom of the tab control and are to the right of the FileSteps.  If you can picture that, how do I modify the Space Start, Space End of the TestStand - Divide Space Between Panes.vi.

Thanks for your help.

0 Kudos
Message 5 of 9
(4,674 Views)

1) I have experimented (unsuccesfully) with the Space Start and Space End of the TestStand - Divide Space Between Panes.vi.  In the original TopLevel, the FileSteps and SequenceList were being divided (right?).  I didn't see how the Space Start and Space End values passed in accomplished this. 

Space Start and Space End define how much space you want to divide between the N panes.   Both of these are in pixels; note that you have to tell the function if you want to split horizontally or vertically by wiring a Boolean to the Vertical Splitter control.  Note that there is a hard coded minimum size per pane.  Don't try to put too many panes in a small area.

(2) I'm trying to re-organize the TopLevel Front Panel such that on the SequenceFile Tab, the FileSteps are at the top-left and go almost all the way down to the bottom of the tab control.  At the bottom (taking up about 1/2 inch) are the TestUUTs, SinglePass, Run MainSequence buttons.  To the right of the FileSteps (taking up the right 1/3 of the tab control) are the FileVariables, the SequenceList, the Threads (which I don't even want to display), and two ExpressionEdit boxes that I added to display the Descriptions of the SequenceFile and the selected Sequence.  These five 'panes' go from top to bottom of the tab control and are to the right of the FileSteps.  If you can picture that, how do I modify the Space Start, Space End of the TestStand - Divide Space Between Panes.vi.

I am having a bit of trouble picturing your layout, so I'm going to make some suggestions that you can use to help you whatever your layout is going to be rather than for a particular layout.

First off, I would suggest you use LabVIEW to mock up a layout- it doesn't have to be functional, what you care about is that you have a control that takes up the proper amount of space for each element.  If you don't want a pane (i.e. Threads) REMOVE IT!   Once you have it laid out, as you want here is a trick to find the size and position of a control: Go to the block diagram right click on a terminal and select create reference.   Wire the reference into a property node and select the position and bounds All Elements and wire them to indicators then run the VI.   These properties give you the top and left control coordinates and the control's width and height.   Generally you will want one control to be adjacent to another- So if you have control A always on the left and it is a fixed size and three other controls B,C,and D then you would use the divide space among panes on controls B C D so that they share the remaining space.   Space Start would be the A.left + A.width and the end space would be the right side of the tab control (or the screen) i.e. tab.left + tab.width.   I would recommend against hard coding constant values- if you want 1/3 or the screen calculate it form the screen size.    You never know when you will need to change screen size! 

Repeat this process for panes that are tiled vertically as well, but use tops and height instead of left and width.

 

The next part of the process is to decide which (if any) borders you would like users to be able to drag.    This can be set by right clicking on the control (say the sequence File View) and selecting Sequence View -> Properties...   a dialog appears with several tabs, select Borders and select which of the borders you want to allow dragging on (Top. Left, Bottom, or Right).   Note that when two panes are adjacent only one of them needs to have a dragable border to allow the user to resize both.   You will need to create a callback VI to handle the drag events and add it to the Reg Event Callback in Full UI - Configure Event Callbacks.vi.   If you uncheck dragging or separate panes by adding a pane between them you should remove the unused border drag callback from Reg Event Callback in Full UI - Configure Event Callbacks.vi.

 

-Rick Francis

Message 6 of 9
(4,649 Views)

I'm having trouble understanding the order of events as it relates to the use of the TestStand VIs. 

(1) Why do I have to TestStand - Create Control Info before TestStand - Divide Space Between Panes.

(2) Do I need to TestStand - Create Control for the Variables/Threads/Sequences/ExpressionEdits that also reside on the tabcontrol?

(3) Why do we need to TestStand - Update Control Position and Size if we follow thos calls with calls to the property nodes to set the Top and Height?

0 Kudos
Message 7 of 9
(4,643 Views)

>(1) Why do I have to TestStand - Create Control Info before TestStand - Divide Space Between Panes.

Because the Divide Space Between Panes takes Control Info Clusters as inputs- you need to get the information on the control's size, position and borders before the Divide Space Between Panes can calculate the new positions and sizes.

>(2) Do I need to TestStand - Create Control for the Variables/Threads/Sequences/ExpressionEdits that also reside on the tabcontrol?

You will need to call it once for every control that you are dividing space amonst.

>(3) Why do we need to TestStand - Update Control Position and Size if we follow thos calls with calls to the property nodes to set the Top and Height?

To set the Left and Width of the controls. 
 
-Rick Francis
0 Kudos
Message 8 of 9
(4,621 Views)

It's been a while since you originally answered this question.  At the time, I went a different route, chosing instead to modify all the routines that account for allowing the user to resize.  Now I'm faced with a similar issue - I went from an HMI designed specifically for a 22" monitor to one for a 19" monitor.  The 22" monitor, however, has a different aspect ratio as it's HD.

 

I manually shrunk everything down so as to fit in a 19" monitor's space.  I didn't think I needed to do much else, since in the original exersize I used blah.left and blah.top instead of any constants.  When I ran, though, the Top Level front panel appeared with the 22" width.  I tried a number of things (unsuccessfully), so then I tried your suggestion about replacing Full UI Arrange Controls.vi with a VI that does nothing.  I didn't exactly do that however.  Instead I used LabVIEW's "Disable Diagram" structure, and essentially commented out all the code.  Anyway, when I did this, the new sizes (19") of all the controls/indicatorsTop Level were nearly perfect.  There's just one problem (see attached) - When I created the front panel, Border #2 is just a few pixels to the right of Border #1.  When I run, though, Border #2 appears about three inches too far to the right.

 

There are other slight issues remaining, but this is the first, as it wont let me fit into the 19" monitor (ultimate target).

0 Kudos
Message 9 of 9
(4,177 Views)