Recent

Author Topic: SpeedButton restrictions  (Read 640 times)

Saylo_49

  • New Member
  • *
  • Posts: 34
SpeedButton restrictions
« 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 ?
Lazarus 2.0.2 - FPC 3.0.4 - Win32

lucamar

  • Hero Member
  • *****
  • Posts: 2023
Re: SpeedButton restrictions
« Reply #1 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.
« Last Edit: May 21, 2019, 09:38:18 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Saylo_49

  • New Member
  • *
  • Posts: 34
Re: SpeedButton restrictions
« Reply #2 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)
« Last Edit: May 21, 2019, 08:49:22 pm by Saylo_49 »
Lazarus 2.0.2 - FPC 3.0.4 - Win32

lucamar

  • Hero Member
  • *****
  • Posts: 2023
Re: SpeedButton restrictions
« Reply #3 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.
« Last Edit: May 21, 2019, 09:21:56 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Saylo_49

  • New Member
  • *
  • Posts: 34
Re: SpeedButton restrictions
« Reply #4 on: May 21, 2019, 09:51:42 pm »
So
The transparent flat Speedbutton is shown like that on every platform
Lazarus 2.0.2 - FPC 3.0.4 - Win32

lucamar

  • Hero Member
  • *****
  • Posts: 2023
Re: SpeedButton restrictions
« Reply #5 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.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

Saylo_49

  • New Member
  • *
  • Posts: 34
Re: SpeedButton restrictions
« Reply #6 on: May 21, 2019, 10:59:52 pm »
Thank you very much, you saved my project  ;) ;) ;)
Lazarus 2.0.2 - FPC 3.0.4 - Win32

lucamar

  • Hero Member
  • *****
  • Posts: 2023
Re: SpeedButton restrictions
« Reply #7 on: May 21, 2019, 11:04:43 pm »
Glad to be of help :)
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus 2.0.2/2.0.4  - FPC 3.0.4 on:
(K|L)Ubuntu 12..16, Windows XP SP3, various DOSes.

M+AUDIO

  • New Member
  • *
  • Posts: 47
Re: SpeedButton restrictions
« Reply #8 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.