Recent

Author Topic: [SOLVED] TCButton Background.Style:=bbsColor - Doesn't work?  (Read 1529 times)

pixelink

  • Hero Member
  • *****
  • Posts: 1269
I am using the TCButton (part of the BGRA Controls set)

You can use the "Style" of the Backgorund of 3 different Values.

If you want a solid, flat look with no gradient (default)
Then according to the Object Inspector you set it to "bbsColor"

I did that in my code, but get error "Identifier Not Found"

I think I have the right values, can anyone double-check and see if I have this right.

There is NO documentation on WIKI or GITHUB for the setting. No class doc or anthing
Not on google either.

I even checked the sources main PAS file for the control, and those are supposed to be the right values... they work at design-time.

See screen below.

Thanks
« Last Edit: May 02, 2019, 03:01:02 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #1 on: May 02, 2019, 02:33:40 pm »
Here is the most simplest project, a project can be.

1 TCButton control and one line of Code

This has the line of code I am referring to above.... this doesn't work.

So, I have eliminated any other code causing the problem,

And, if you were to comment out this one line of code... the app works, the button works.
But is isn't a solid color.

DOWNLOAD TEST PROJECT:
« Last Edit: May 02, 2019, 02:35:49 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #2 on: May 02, 2019, 02:39:31 pm »
What is weird, in Design-time all 3 values work.

I just see don't any errors in my code "character-wise"
I looks like I typed it out right.

 %)
« Last Edit: May 02, 2019, 02:44:37 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #3 on: May 02, 2019, 02:46:00 pm »
Even tried it like this.
Don't work. Same error message

Code: Pascal  [Select][+][-]
  1. BCButton1.StateNormal.Background.Style:= [bbsColor]
  2.  


Also, if you use the other two properties (bbsClear & bbsGradient) you get the same error.
So, it's not just the "bbsColor" but all 3 values generate this error.
« Last Edit: May 02, 2019, 02:48:29 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

ari.laz

  • Newbie
  • Posts: 1
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #4 on: May 02, 2019, 02:57:38 pm »
I hope this is helpful:

After adding BCTypes to the uses section of your demo source, it compiled for me.

I am using Lazarus 2.0 on Windows 7 64


pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #5 on: May 02, 2019, 02:58:01 pm »
And just so everyone knows.
In the code below, EVERY property works for the TCButton except the Style... 3 lines

ADD BUTTON  CODE - Which Works (except the lines where I use Background.Style)

Code: Pascal  [Select][+][-]
  1.  
  2. For x1:= 1 to dsDataSet.dataset.RecordCount do
  3.   begin
  4.     btn1:=TBCButton.create(sbLF);
  5.     btn1.parent:=sbLF;
  6.  
  7.     if lbTheme.Caption = 'Dark Gray Theme' Then
  8.       begin
  9.         btn1.StateNormal.Background.Color:=$00333333;
  10.       end
  11.     else
  12.       begin
  13.         btn1.StateNormal.Background.Color:=clSilver;
  14.       end;
  15.  
  16.     btn1.Rounding.RoundX:=0;
  17.     btn1.Rounding.RoundY:=0;
  18.  
  19.     btn1.StateHover.Background.Color:=$000000CA;
  20.     btn1.StateClicked.Background.Color:=$000000CA;
  21.  
  22.     btn1.StateNormal.FontEx.Height:=FSL;
  23.     btn1.StateHover.FontEx.Height:=FSL;
  24.     btn1.StateClicked.FontEx.Height:=FSL;
  25.  
  26.     btn1.StateNormal.FontEx.Color:=clWhite;
  27.     btn1.StateHover.FontEx.Color:=clWhite;
  28.     btn1.StateClicked.FontEx.Color:=clWhite;
  29.  
  30.     btn1.StateNormal.Background.Style:=bbsColor;  <- ERROR - >
  31.     btn1.StateHover.Background.Style:=bbsColor;    <- ERROR - >
  32.     btn1.StateClicked.Background.Style:=bbsColor;   <- ERROR - >
  33.  
  34.     btn1.Caption:=dsDataSet.Dataset.FieldByName('Category').AsString;
  35.  
  36.     btn1.Width:=WL;
  37.     btn1.Height:=HL;
  38.     btn1.Top:=TL;
  39.     btn1.left:=LL;
  40.     btn1.OnClick := @btn1ClickEvent;
  41.     TL:=TL + 45;
  42.     sqlQuery.Next;
  43.  end;
  44.  
  45.  
« Last Edit: May 02, 2019, 03:50:35 pm by pixelink »
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

pixelink

  • Hero Member
  • *****
  • Posts: 1269
Re: TCButton Background.Style:=bbsColor - Doesn't work?
« Reply #6 on: May 02, 2019, 03:00:44 pm »
I hope this is helpful:

After adding BCTypes to the uses section of your demo source, it compiled for me.

I am using Lazarus 2.0 on Windows 7 64

PERFECT!!!
That did work.
I don't get why though... all the other properties worked fine.

THANK YOU!
Can't Type - Forgetful - Had Stroke = Forgive this old man!
LAZ 4.2.0 •  VSSTUDIO(.Net) 2022 • Win11 • 32G RAM • Nvida RTX 4070 Ti Super

 

TinyPortal © 2005-2018