Recent

Author Topic: [SOLVED] TBCLeaBoard and BackgroundColor White  (Read 1355 times)

rca

  • Jr. Member
  • **
  • Posts: 88
[SOLVED] TBCLeaBoard and BackgroundColor White
« on: August 09, 2024, 06:45:45 pm »
TBCLeaBoard does not take White for BackgroundColor

In the source file bcleaboard.pas

Code: Pascal  [Select][+][-]
  1.     property BackgroundColor: TColor read FBkgColor write SetBkgColor default clWhite;
  2.  

Code: Pascal  [Select][+][-]
  1. constructor TBCLeaBoard.Create(AOwner: TComponent);
  2. begin
  3.   inherited Create(AOwner);
  4.   with GetControlClassDefaultSize do
  5.     SetInitialBounds(0, 0, 200, 150);
  6.   ControlStyle := [csAcceptsControls, csReplicatable, csClickEvents];
  7.   FBitmap := TBGRABitmap.Create(Width, Height, FBkgColor);
  8.   ApplyDefaultTheme;
  9. end;
  10.  

Code: Pascal  [Select][+][-]
  1. procedure TBCLeaBoard.ApplyDefaultTheme;
  2. begin
  3.   FFrameColor := clBtnFace;
  4.   FBoardColor := clBtnFace;
  5.   FBkgColor := clBtnFace;
  6.   FFrameStyle := zsRaised;
  7.   …
  8. end;
  9.  

There is a discrepancy between the default property value and ApplyDefaultTheme

The default value should be clBtnFace:
Code: Pascal  [Select][+][-]
  1.     property BackgroundColor: TColor read FBkgColor write SetBkgColor default clBtnFace;
  2.  

Also, in Create, it may be advisable to call first ApplyDefaultTheme:
Code: Pascal  [Select][+][-]
  1. constructor TBCLeaBoard.Create(AOwner: TComponent);
  2. begin
  3.   inherited Create(AOwner);
  4.   with GetControlClassDefaultSize do
  5.     SetInitialBounds(0, 0, 200, 150);
  6.   ControlStyle := [csAcceptsControls, csReplicatable, csClickEvents];
  7.   ApplyDefaultTheme;
  8.   FBitmap := TBGRABitmap.Create(Width, Height, FBkgColor);
  9. end;
  10.  
« Last Edit: August 16, 2024, 08:20:33 pm by rca »

kirchfritz

  • Jr. Member
  • **
  • Posts: 63
  • WIN11 LAZ 2.2.4 FPC 3.2.2
Re: TBCLeaBoard and BackgroundColor White
« Reply #1 on: August 09, 2024, 08:28:54 pm »
What is TBCLeaboard? Never heard.

bobby100

  • Sr. Member
  • ****
  • Posts: 260
    • Malzilla
Re: TBCLeaBoard and BackgroundColor White
« Reply #2 on: August 09, 2024, 08:47:18 pm »
@rca - Thanks for the bug-report. I'll check it right now
@kirchfritz - It is part of BGRAControls, but just on Github for now (not released). It is a kind of panel with a frame and some 3D effects for the frame. Here is a screenshot from an early version: https://github.com/bgrabitmap/bgracontrols/discussions/185

bobby100

  • Sr. Member
  • ****
  • Posts: 260
    • Malzilla
Re: TBCLeaBoard and BackgroundColor White
« Reply #3 on: August 09, 2024, 09:04:09 pm »
@rca - is there any chance you want to change the board color, and not the background color?
Background is the part outside the frame, board is inside the frame.

Anyway, for board is just zsFlat implemented. I have no idea which kind of effect I could do for zsRaised and zsLowered for the board. I left the options there for the case I get some creative ideas, but I'll probably remove the two unused options.

rca

  • Jr. Member
  • **
  • Posts: 88
Re: TBCLeaBoard and BackgroundColor White
« Reply #4 on: August 09, 2024, 10:54:01 pm »
@rca - is there any chance you want to change the board color, and not the background color?
Background is the part outside the frame, board is inside the frame.

Anyway, for board is just zsFlat implemented. I have no idea which kind of effect I could do for zsRaised and zsLowered for the board. I left the options there for the case I get some creative ideas, but I'll probably remove the two unused options.

The white color bug occurs with the background, which is the part outside the frame.

This issue is easy to replicate:

Create a project with a Form and a BCLeaBoard.

Form1 Properties
*Color: clWhite

BCLeaBoard Properties
*BackgroundColor: clWhite
*BoardColor: clBtnFace

I attach an image of the effect it presents:

rca

  • Jr. Member
  • **
  • Posts: 88
Re: TBCLeaBoard and BackgroundColor White
« Reply #5 on: August 09, 2024, 10:59:12 pm »
With colors other than white, there is no problem.

Form1 Properties
*Color: $00FF8000

BCLeaBoard Properties
*BackgroundColor: $00FF8000
*BoardColor: clBtnFace

I attach an image with a blue background.

« Last Edit: August 09, 2024, 11:01:25 pm by rca »

rca

  • Jr. Member
  • **
  • Posts: 88
Re: TBCLeaBoard and BackgroundColor White
« Reply #6 on: August 09, 2024, 11:24:34 pm »
If you can keep the property as it is originally
Code: Pascal  [Select][+][-]
  1.     property BackgroundColor: TColor read FBkgColor write SetBkgColor default clWhite;


But it should change to clWhite in ApplyDefaultTheme
Code: Pascal  [Select][+][-]
  1. procedure TBCLeaBoard.ApplyDefaultTheme;
  2. begin
  3.   FFrameColor := clBtnFace;
  4.   FBoardColor := clBtnFace;
  5.   FBkgColor := clWhite;
  6.   FFrameStyle := zsRaised;
  7.   …
  8. end;

And now if it is displayed correctly with:
Form1 Properties
*Color: clWhite

BCLeaBoard Properties
*BackgroundColor: clWhite
*BoardColor: clBtnFace

I attach an image of the result:

bobby100

  • Sr. Member
  • ****
  • Posts: 260
    • Malzilla
Re: TBCLeaBoard and BackgroundColor White
« Reply #7 on: August 10, 2024, 05:37:57 pm »
I could not reproduce the bug you are experiencing.
I'll correct the ApplyDefaultTheme and default property to clBtnFace, to match each other. I hope this will solve the problem on your end.

rca

  • Jr. Member
  • **
  • Posts: 88
Re: [SOLVED] TBCLeaBoard and BackgroundColor White
« Reply #8 on: August 16, 2024, 08:20:53 pm »
With BGRAControls v9.0.1.6, this issue is now fixed.

Thank you

 

TinyPortal © 2005-2018