Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Vertical spacing - make equal...?

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey there folks--

silly little thing, but i'm curious if anyone know how the 'make vertical (and horizontal) spacing equal' function works.. more specifically, when you have three controls and you select to make spacing equal, which initial spacing does vfp use as the target?

for example, i have three labels with tops set at 24,54 and 78. no matter what order i select them in, the one with top 78 always moves to 84 (the other two stay the same). is there a way to move the top (24) one instead?

it doesn't seem to be an order-of-selection thing, and tab index doesn't seem to have an effect... does vfp just take the average of the initial spacing between all objects?

any thoughts? just curious..

thanks
--frank~
 

It's not the average of the initial spacing; it just adjusts all spaces to the first one - the space between the two top objects, no matter how many objects you select, in what order, or whether the top space wider or narrower than the rest, or how high the objects are. I didn't find this answer in Help, it's just from my experience.
 
just tried it and that doesn't seem to hold true..

i have 5 labels, all equally spaced at 25 pixels apart.. i took the top label and moved it down 10 pixels.. then selected all and made the spacing equal and vfp moved the bottom 4 down so the space between the top 2 equalled the spacing between the bottom 4..

also tried decreasing the space between the bottom two.. same result..

then tried decreasing the space between the top 2 and bottom 2 (so labels 2,3,4 were equidistant).. same result, the top and bottom were adjusted to match the space between 2-3-4..

however! when i decreased the space between 1,2,3,4 (leaving 4-5 at 25), label 5 was moved up to match the other 4..

maybe it's using a majority? i'm still baffled..

--frank~
 

Stella,

t just adjusts all spaces to the first one - the space between the two top objects

In my testing, that's certainly true in straightforward cases. But I've managed to find other cases where it spaces to the widest space between two objects, not necessarily the top two. And there are other inconsistencies, for example, if two of the objects overlap.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 

Possibly. I don't use "equal spacing" that often. Will try to test it when have some slack time.
 
yeah i don't really use it all too often either.. the alignment functions work well.. but when i do use the equal spacing, i always wonder how vfp does it's figuring..

this wasn't really a huge deal, i was just curious if anyone had an "inside secret" about how it worked..

thanks for the replies.

-- frank~
 
It is the distance between the first two controls (as to Y Coordinate) of the group that do not overlap (as to Y Coordinate) for Make Equal vertical spacing.

It is the distance between the first two controls (as to X Coordinate) of the group that do not overlap (as to X Coordinate) for Make Equal horizontal spacing.

However, should two controls stacked one on top of the other be split be by a control on their left for instance, VFP will attempt to split the difference in the overlap (as to Y Coordinate) of the controls by increasing or decreasing the amount of space between the first two and moving the third control (the one on the left) so that the middle of it's height lines up with the newly created or reduced space between the first two controls.

And, should two controls stacked side by side of each other be split be by a control directly beneath them for instance, VFP will attempt to split the difference in the overlap (as to X Coordinate) of the controls by increasing or decreasing the amount of space between the first two and moving the third control (the one on the bottom) so that the middle of it's width lines up with the newly created or reduced space between the first two controls..

These are the rules I believe. You just need to keep track of what the first two controls are that don't overlap (as to X or Y depending on whether is is Vertical or Horizontal Make Equal) and then add in the variable of a control that splits these first two controls that don't overlap as spoken of above.

I'm not sure knowing the rules makes them anymore clear though. [smile]

boyd.gif

SweetPotato Software Website
My Blog
 
All by experimentation... I read this dreadful thread and it was like one of those show tunes you can't get out of your head. <g> So, rather than having the question still rattling around in my head next week, I went into a form and played around until I understood what the heck was going on.

It's sort of documented now. <g>

boyd.gif

SweetPotato Software Website
My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top