Autore Topic: Le proprietà HBox.Margin e HBox.Padding non sono cumulabili ?  (Letto 696 volte)

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.723
  • Ne mors quidem nos iunget
    • Mostra profilo
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
»
« Ultima modifica: 24 Maggio 2013, 17:44:12 da vuott »
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »

Offline vuott

  • Moderatore globale
  • Senatore Gambero
  • *****
  • Post: 11.723
  • Ne mors quidem nos iunget
    • Mostra profilo
Re: Le proprietà HBox.Margin e HBox.Padding non sono cumulabili ?
« Risposta #1 il: 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
»
« Chiunque, non ricorrendo lo stato di necessità, nel proprio progetto Gambas fa uso delle istruzioni Shell o Exec, è punito con la sanzione pecuniaria da euro 20,00 a euro 60,00. »