[Gambas-user] Spacing = True Question

Doriano Blengino doriano.blengino at ...1909...
Fri Jan 16 10:47:39 CET 2009


Benoit Minisini ha scritto:
> On vendredi 16 janvier 2009, richard terry wrote:
>   
>> Wonder if someone could clarify this for me.
>>
>> Previously spacing was (and the documention in the IDE still says it is)
>> the number of pixels separating child controls. If this is so, how does one
>> give this a value?
>>
>> Personally I think using spacing like this is a backwards step for gambas.
>> This little property was one of the wonderful things about the
>> gui-designer, one had absolute control over the gaps between things, which
>> when you are designing a gui with lots of objects, every pixel becomes
>> critical.
>>     

>
> This change is a way to prevent VB-like GUI with too small or random spacing 
> between widgets, *and* to make the spacing proportional to the font size.
>
> Please provide a concrete example of the usefullness of arbitrary spacing, 
> otherwise the discussion will remain theoretical.
>
> If you run out of space because you have too many widgets on the screen, maybe 
> this is a sign that your GUI should be redesigned?
>
>   
Just my 2 cents opinion.

It seems to me that this Spacing property has undergone two changes - 
but it is not clear. It was previously a container property specifying 
how much space had to be *between* children, and now instead specifies 
how much space surround a control? If it is so, then I don't see too 
much difference, but perhaps the new way is more handy.

The second change, about render the spacing proportional to font size, 
can be good or not. I prepend to think that absolute coordinates are 
bad, and so I approve this change, but I don't forget that a programmer 
should have complete freedom: if he wants two pixel, he should have 
that. Perhaps the Scaled property of a Form lets the programmer do that 
(when set to false), perhaps not. But setting Scaled=False makes a great 
(too much great) difference. There are ways to specify measurements, 
like in html: 2px, 2mm, 2whatever... soon or later someone should think 
extensively about this, and someone should implement this. For example, 
three choices could be given for measurements: pixels (absolute), 
font-relative, and screen size relative. The X coordinate of a control 
could be given like:

    10px      -> absolute pixels - very narrow in high resolution, small 
displays
    10fp       -> proportional to font, wide about a character, almost 
always reasonable
    10pt      -> (points) proportional to screen resolution, should 
display the same everywhere

Well, may be I made some error or forgot something, but the general idea 
can be understood... the scaling property of widgets should not be 
merely True or False, but one of the previous (and perhaps other) modes. 
This way one could design a GUI with reasonable spacing between controls 
(related to font), but have unscaled 1:1 GIF images, and real-size Jpg 
images or print previews. But this freedom carries also other problems: 
how to align items when different coordinate systems are used? The only 
way is to dock controls each other, and not all them inside a container.

Regards,
Doriano





More information about the User mailing list