padding on fields

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

padding on fields

Post by jalz » Wed Feb 04, 2015 12:30 am

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

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: padding on fields

Post by dave.kilroy » Wed Feb 04, 2015 1:05 am

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
"...this is not the code you are looking for..."

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: padding on fields

Post by Simon » Wed Feb 04, 2015 1:55 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: padding on fields

Post by bn » Wed Feb 04, 2015 2:46 am

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

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 858
Joined: Wed Jun 24, 2009 1:17 pm
Contact:

Re: padding on fields

Post by dave.kilroy » Wed Feb 04, 2015 2:50 am

Hi Bernd - you were quite right, I could have just given Jazz a one-liner piece of code - I "SLIPPED UP" there :)
"...this is not the code you are looking for..."

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: padding on fields

Post by bn » Wed Feb 04, 2015 2:54 am

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

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: padding on fields

Post by jalz » Wed Feb 04, 2015 8:47 pm

Thank you all, you're all lot simply brilliant :D

Post Reply