Lazarus

Programming => LCL => Topic started by: Saylo_49 on May 21, 2019, 07:50:27 pm

Title: SpeedButton restrictions
Post by: Saylo_49 on May 21, 2019, 07:50:27 pm
Hello

I saw that the Speedbutton on the Laz 2.0.2 does not have Restrictions on the object inspector properties

is that mean that when I will turn it "flat=true" the button aspect will be erased and show the background form color on all platforms ?
Title: Re: SpeedButton restrictions
Post by: lucamar on May 21, 2019, 08:12:08 pm
is that mean that when I will turn it "flat=true" the button aspect will be erased and show the background form color on all platforms ?

That's not the meaning of "Flat": it's meant to select whether the button shows with a 3-D look or a flat rectangle. But yes, since TSpeedButton is a descendant of TGraphicControl,.in theory it should apply to all widgetsets.

ETA: Note that it shows in the background color when its Transparent property is set to  True, not because Flat is set to true.
Title: Re: SpeedButton restrictions
Post by: Saylo_49 on May 21, 2019, 08:19:20 pm
Oh
That's strange because on Windows 10 when I set Flat to True the button aspect disappear
Is this happening on all platforms or just in windows

(The S on the picture below are speedbuttons)
Title: Re: SpeedButton restrictions
Post by: lucamar on May 21, 2019, 09:16:49 pm
For some reason, speed buttons are created with Transparent = True. It just happens that this is ignored when Flat is false, probably to be able to build the 3D frame more easily.

Here (attached image) is the difference between styles: Flat = True/False and, when Flat = True, Transparent = True/False

Note that speed buttons are mostly intended to show an icon/glyph, so making them transparent by default means that, when flat, the icon shows over the background by itself until you hover the pointer over it. That's probably another consideration for them to be created as transparent.
Title: Re: SpeedButton restrictions
Post by: Saylo_49 on May 21, 2019, 09:51:42 pm
So
The transparent flat Speedbutton is shown like that on every platform
Title: Re: SpeedButton restrictions
Post by: lucamar on May 21, 2019, 10:22:22 pm
So
The transparent flat Speedbutton is shown like that on every platform

Well, I've not tested on every platform (only GTK and Win32) but yes, it should.
Title: Re: SpeedButton restrictions
Post by: Saylo_49 on May 21, 2019, 10:59:52 pm
Thank you very much, you saved my project  ;) ;) ;)
Title: Re: SpeedButton restrictions
Post by: lucamar on May 21, 2019, 11:04:43 pm
Glad to be of help :)
Title: Re: SpeedButton restrictions
Post by: M+AUDIO on May 24, 2019, 11:51:02 am
So
The transparent flat Speedbutton is shown like that on every platform
Unfortunately, there is a problem with this in MacOS Cocoa. and it is reported here in the bug tracker (https://bugs.freepascal.org/view.php?id=35555).
TinyPortal © 2005-2018