Gambas-it

Gambas3 => Domande tecniche => Topic aperto da: vuott - 24 Maggio 2013, 01:25:03

Titolo: Le proprietà HBox.Margin e HBox.Padding non sono cumulabili ?
Inserito da: vuott - 24 Maggio 2013, 01:25:03
Riporto questa discussione apparsa nella M.L.I.:

« The wiki
http://gambasdoc.org/help/comp/gb.qt4/hbox/margin?v3
says that HBox.Margin and HBox.Padding produce a cumulative margin
when both are defined. This seems to be wrong in reality.
Test project attached. Note that the first click makes HBox.Padding equal
to Desktop.Scale while HBox.Margin is set - but nothing happens. If both
properties were cumulative, shouldn't the margin then be 2*Desktop.Scale?

Regards,
Tobi
»


« When margin is set padding and spacing have the size of Margin in pixel.

Fabien Bodard
»


« This is another facet, isn't it? I was talking about Margin + Padding, when
set together, are added to make the visible margin, i.e. they are
cumulative.

However it seems to me that your statement isn't true either. If it were
like you said, then as soon as HBox.Margin is set to True, the padding (we
ignore spacing here) would be Desktop.Scale. When I click on the button the
first time, Desktop.Scale is added to HBox.Padding - but visually nothing happens.

As a consequence, Padding must have still been 0 and Margin and Padding are
*not* cumulative. Or not?

Regards,
Tobi
»
Titolo: Re: Le proprietà HBox.Margin e HBox.Padding non sono cumulabili ?
Inserito da: vuott - 25 Maggio 2013, 02:01:10
....segue....


« They are not cumulative.

if margin is set at true and padding = 0 then margin = Desktop.Scale

if margin is set at true and padding = 5 then margin = 5

if spacing is set at true and padding = 0 then spacing = Desktop.Scale

if spacing is set at true and padding = 5 then spacing = 5

padding define the space.

Fabien Bodard
»


« Alright. Then the documentation should be fixed. I don't find the right
words to explain it there. Anybody?

Regards,
Tobi
»


« I fixed the documentation (that was the old text from Gambas 2).
--
Benoît Minisini
»