Jump to content

Bounding Boxes


Recommended Posts

The rectangular Boolean controls have properties to retrieve the width and height of the button inside the bounding box. However there seem to be no properties to determine the absolute position of the button regardless of the position of labels, captions and decals which can extend the bounding box and change the origin of the control, hence its apparent position in the window.

Does anyone know of a way around this aside from either;

1) Creating the labels and pictures as seperate entities, hassle but easy,

2) Assuming the button's bottom right corner will always be aligned with the bottom right of the bounding box- slightly dangerous if a variable length caption is used, but a caption so long it overhangs the control looks a bit cacky anyway and I'd tend to avoid that.

Link to comment
  • 2 months later...

Hi Craig,

Maybe this does what you're looking for..

We can get the absolute position of the button text. From this, we can find the absolute position of the button (irrespective of the label and caption positions):

Get the size of the text and the size of the button itself. Subtracting the text-size from the button-size, and then dividing by two will give us the offset from the absolute position of the text. Subtracting this offset from the absolute position of the text will give us the absolute position (top, left) of the button -- regardless of where the label and captions are (see attached 7.1 VI).

Caveat: this assumes (rightfully?) that the button text is smaller than the button size.. However, the above can be modified to take care of this case as well using an absolute value (no pun intended) for the offset.

Hope this is what you were looking for.

Regards,

Khalid

Download File:post-19-1087102723.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.