Remove "in" units from X Coordinates

Avatar

03-10-2008

Does any know how to remove the "in" units from an x coordinate?

Replies

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

03-10-2008

Not sure I follow ....do you want to work in different units?

Avatar

03-10-2008

When I get the X coord for an object in script. Text1.x it returns 2in but i need to take that value (without the units "in") and add a value to it.



Also, I am having some difficuly getting the width value of a textbox that expands to fit.



I want to position a help button after a textbox. I want to know the position of the textbox and the width. So i can set the X value of the help button.



Thanks,

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

03-10-2008

I have an example of this on another computer that I cannot get to until next Tuesday....I will post the example then.

Avatar

04-10-2008

Sick.. I figured it out. Wrap the expandable text and help button in a subform and make the content Flowed - Western text.

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

07-10-2008

That is not the way I would do it.

Here is some code that will give you the length of the field after rendering. You can change the units to any supported value at it will work fine. Note that this is javascript.



var oH = xfa.layout.w(txtDescription, "in");

this.w = oH + "in";



where txtDescription is the name of the field that you want to get the length of. This code wouldl be executed in the layout event of the object that you are trying to position.



Hope this helps

Avatar

07-10-2008

Would I be able to get the x/y coords as well by this approach?

xfa.layout.x(txtQuestion,"in");

xfa.layout.y(txtQuestion,"in");

Avatar

Avatar

pguerett

Avatar

pguerett

pguerett

07-10-2008

Yes..that woudl be the absolute positioning after layout (useful in a flowed form). Not the x and y at Design time like in a static form.