|
Re: GridLayout: marginTop and marginBottom versus marginHeight [message #451366 is a reply to message #451365] |
Mon, 28 February 2005 06:09 |
Konstantin Scheglov Messages: 555 Registered: July 2009 |
Senior Member |
|
|
Rod Bailey:
I think they want to keep compatibility. In any case, this does not
hurt, and may be even good. If you want to have equal margins to left
and right, you can set just one property.
> Since 3.1 there have been four new attributes added to the GridLayout:
> marginTop, marginBottom, marginLeft and marginRight. But the pre-3.1
> attributes marginHeight and marginWidth still exist.
>
> How is marginHeight distinct from marginTop and marginBottom?
> How is marginWidth distinct from marginLeft and marginRight?
>
> Looking at the source, it appears that all six attributes take part in
> layout calculations, but the interpretation of the different attributes is
> not made clear from the javadoc. It appears that marginHeight is added to
> both marginTop and marginBottom; and that marginWidth is added to both
> marginLeft and marginRight. Why complicate matters this way?
>
> Can anyone clarify why we use six attributes to specify four margins?
>
>
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
Konstantin Scheglov,
Google, Inc.
|
|
|
Re: GridLayout: marginTop and marginBottom versus marginHeight [message #451379 is a reply to message #451366] |
Mon, 28 February 2005 19:09 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
margintop, marginBottom, margin Left and marginRight are used when you want
different sized margins on one side versus the other. In general
marginWidth and marginHeight are sufficient because you want the same margin
on both sides.
If you have both marginWidth and marginLeft set, then teh result will be the
sum of the two values:
marginLeft = 2;
marginRight = 4;
marginTop = 6;
marginBottom = 8;
marginLeft = marginHeight = 0;
-----------------------------------------
| | | |
| | | |
| | | |
| | | ||
|
|
|
|
|
|
|
|
|
|
----------------------------------------
"Konstantin Scheglov" <scheglov_ke@nlmk.ru> wrote in message
news:A9lrewVHFHA.704@fairy.ao.nlmk...
> Rod Bailey:
>
> I think they want to keep compatibility. In any case, this does not
> hurt, and may be even good. If you want to have equal margins to left and
> right, you can set just one property.
>
>> Since 3.1 there have been four new attributes added to the GridLayout:
>> marginTop, marginBottom, marginLeft and marginRight. But the pre-3.1
>> attributes marginHeight and marginWidth still exist.
>>
>> How is marginHeight distinct from marginTop and marginBottom?
>> How is marginWidth distinct from marginLeft and marginRight?
>>
>> Looking at the source, it appears that all six attributes take part in
>> layout calculations, but the interpretation of the different attributes
>> is
>> not made clear from the javadoc. It appears that marginHeight is added to
>> both marginTop and marginBottom; and that marginWidth is added to both
>> marginLeft and marginRight. Why complicate matters this way?
>>
>> Can anyone clarify why we use six attributes to specify four margins?
>>
>>
>
>
> --
> SY, Konstantin.
> Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Re: GridLayout: marginTop and marginBottom versus marginHeight [message #451380 is a reply to message #451379] |
Mon, 28 February 2005 19:11 |
Veronika Irvine Messages: 1272 Registered: July 2009 |
Senior Member |
|
|
Forget the example at the bottom -it got sent before I was done. I think an
example isn't really needed - left me know if it is.
"Veronika Irvine" <veronika_irvine@oti.com> wrote in message
news:cvvq9h$aj5$1@www.eclipse.org...
> margintop, marginBottom, margin Left and marginRight are used when you
> want different sized margins on one side versus the other. In general
> marginWidth and marginHeight are sufficient because you want the same
> margin on both sides.
>
> If you have both marginWidth and marginLeft set, then teh result will be
> the sum of the two values:
>
>
> marginLeft = 2;
> marginRight = 4;
> marginTop = 6;
> marginBottom = 8;
> marginLeft = marginHeight = 0;
>
>
> -----------------------------------------
> | | | |
> | | | |
> | | | |
> | | | ||
> |
> |
> |
> |
> |
> |
> |
> |
> |
> |
> ----------------------------------------
>
> "Konstantin Scheglov" <scheglov_ke@nlmk.ru> wrote in message
> news:A9lrewVHFHA.704@fairy.ao.nlmk...
>> Rod Bailey:
>>
>> I think they want to keep compatibility. In any case, this does not
>> hurt, and may be even good. If you want to have equal margins to left and
>> right, you can set just one property.
>>
>>> Since 3.1 there have been four new attributes added to the GridLayout:
>>> marginTop, marginBottom, marginLeft and marginRight. But the pre-3.1
>>> attributes marginHeight and marginWidth still exist.
>>>
>>> How is marginHeight distinct from marginTop and marginBottom?
>>> How is marginWidth distinct from marginLeft and marginRight?
>>>
>>> Looking at the source, it appears that all six attributes take part in
>>> layout calculations, but the interpretation of the different attributes
>>> is
>>> not made clear from the javadoc. It appears that marginHeight is added
>>> to
>>> both marginTop and marginBottom; and that marginWidth is added to both
>>> marginLeft and marginRight. Why complicate matters this way?
>>>
>>> Can anyone clarify why we use six attributes to specify four margins?
>>>
>>>
>>
>>
>> --
>> SY, Konstantin.
>> Advanced Eclipse SWT Designer (http://www.swt-designer.com)
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03505 seconds