LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What's the difference between BOUNDS and SIZE?

I have a decoration (picture) on the panel.

Thru the DECORATIONS[ ] property, I get a refernce to it.

I put a property node on that refernce.

I have the write-only BOUNDS property : Help says "Max bounding area of the object in terms of width and height in pixels".

I have the read/write SIZE property: Help says "Bounding area of the object in terms of width and height in pizels".

So what's the difference? All my tests show them identical in all circumstances.

I thought maybe the BOUNDS was the original size (and thus you couldn't change it), and the SIZE was the current size (which you could change), but that's not the case. When I change the SIZE, the report BOUNDS matches the new SIZE.

I don't see any other objects with both a BOUNDS and a SIZE property. Graphs have a DRAW AREA SIZE, but that's clearly a different meaning.

Clues, anyone?

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 1 of 5
(2,712 Views)

I really have no idea why they made the Bounds property read only. Every object (or at least almost every one) has a property which allows you to change its size dynamically, but for each object this is found in a different place. For graphic controls, it's "Draw Area Size", for booleans, it would be "Button Size", for simple numerics and strings it would be "Text Size", for sliders it would be "Housing Size" and so on. The only reason I can think of for why the Bounds property is read only is because it would make it too hard or unpredictable to know how the control would resize because the bounds property includes the label, caption, index controls, plot displays and so on and it would change depending on what you display.

There are several annoying things about this -

  • When you set a size, it's not the size of the entire control, but only of part of it and your controls might not come out the size you wish.
  • You have to hunt for the relevant property.
  • You can't use a generic property for all objects, meaning that if you don't know the type of control in advance, you will need additional code to handle this.

___________________
Try to take over the world!
Message 2 of 5
(2,697 Views)
Coastal,
     The bounds property is:

"Maximum bounding area of the object specified in terms of width and height in pixels. For a front panel object, this property returns the dimensions of the rectangle enclosing all the visible object components, such as the control, caption, label, graph legends, and so on." (taken from LabVIEW Help)

Because the decoration does not have a caption, label, legends or anything extra, the bounds are the same as reading the size.

Thanks,

Nathan
Message 3 of 5
(2,675 Views)
Thanks for your thoughts.

I suppose that BOUNDS is there because every object has a BOUNDS.

I suppose that it's READ-ONLY because every object has it READ ONLY.

I suppose that a decoration needs to be re-sizeable, so they added a new property, peculiar to decorations, called SIZE, to re-size it.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 4 of 5
(2,676 Views)

Hi Coastal,

This is interesting...

All of a sudden, three people are interested in modifying decorations:  Size & color

Thanks for this post.  It is helpful!  I didn't understand the bounds either!!  I initially thought it was the boundary as set by the box around certain decorations (eg. triangle).

RayR

0 Kudos
Message 5 of 5
(2,634 Views)