Page 1 of 1

padding on fields

Posted: Wed Feb 04, 2015 12:30 am
by jalz
Hi Guys,

It's probably under my nose but can't seem to find it. I have a field which has the text aligned property set to align right. I have a border around the field and I have typed a number in that field. There seems to be 4mm gap between the edge of the right border of that field and the last digit of my number. Is there anyway I can narrow that gap, Id like it a bit more tighter. I have played around with the margins property for the textfield, but that has not helped much (although it did align the top of my number/text nicely in the middle of the field). Is there a property I have overlooked or is this text field control in particular defined to have 2/3px padding as a minimum around it.

Thanks as always
Jalz

Re: padding on fields

Posted: Wed Feb 04, 2015 1:05 am
by dave.kilroy
Hi Jalz - you were right to look at margins.

By default a single figure appears in the margins box in the 'Text Formatting' tab of the inspector which means the same value is applied to the left, top, right and bottom margins.

If you want a wider-than-usual right margin you would put something like "4,4,8,4" in the box (as with the values of a rect the order goes clockwise like this: left, top, right, bottom).

Dave

Re: padding on fields

Posted: Wed Feb 04, 2015 1:55 am
by Simon
Hi Dave,
...the order goes clockwise like this:...
Maybe I will finally be able to remember rect!
I always have to look it up, thanks.

Simon

Re: padding on fields

Posted: Wed Feb 04, 2015 2:46 am
by bn
Hi,

you could also set the rightMargin to 8.

When you address the margins by "name" you don't have to worry about the other margins setting.

And if you start off with margins = 4, i.e. all four margins are set to 4 and then issue "set the rightMargin to 8" and look into the inspector for the margins again it will be "4,4,8,4"

Kind regards
Bernd

Re: padding on fields

Posted: Wed Feb 04, 2015 2:50 am
by dave.kilroy
Hi Bernd - you were quite right, I could have just given Jazz a one-liner piece of code - I "SLIPPED UP" there :)

Re: padding on fields

Posted: Wed Feb 04, 2015 2:54 am
by bn
Hi Dave,

it actually took me a long time to "find" the different margin names. Up till then I did some complicated things with "the margins", tested for the number of items etc.

That was a pain. I just wanted to spare everybody this.

No wisecracking intended.

Kind regards

Bernd

Re: padding on fields

Posted: Wed Feb 04, 2015 8:47 pm
by jalz
Thank you all, you're all lot simply brilliant :D