Recent

Author Topic: BGRA Toolbar not changing background color  (Read 7909 times)

rkamarowski

  • New Member
  • *
  • Posts: 40
Re: BGRA Toolbar not changing background color
« Reply #15 on: July 23, 2015, 03:04:45 pm »
It would make sense for me to explain what I'm attempting to do.

I have set the window background to black, and I want the toolbar and toolbar buttons to be black with white letters.  I tried the Lazarus toolbar and buttons, but I could never get the button text to appear white.  I read about the BGRA components and it seemed as if that would be the answer.

If there's an easier way to do this, or if I'm missing something please let me know.

lainz

  • Hero Member
  • *****
  • Posts: 3699
  • Leandro Diaz
Re: BGRA Toolbar not changing background color
« Reply #16 on: July 23, 2015, 07:35:09 pm »
With the last example I attached you have everything you need to do it.

You must assign each color property you find in the button: by code (like in the last attached example) or by object inspector.

To style the toolbar to be 100% black you can assign OnRedraw event of BCToolBar and do:

Code: [Select]
procedure TForm1.BCToolBar1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
begin
  Bitmap.Fill(BGRABlack);
end;

rkamarowski

  • New Member
  • *
  • Posts: 40
Re: BGRA Toolbar not changing background color
« Reply #17 on: July 23, 2015, 10:35:16 pm »
I'll try that.  Thanks.

rkamarowski

  • New Member
  • *
  • Posts: 40
Re: BGRA Toolbar not changing background color
« Reply #18 on: August 01, 2015, 08:28:49 pm »
I've been away for some health issues.

Getting back, I'm still unable to paint the BCbutton background black. And as I said before, the standard buttons won't display a black background with white text. lainz#007, the example you supplied couldn't be opened.

lainz

  • Hero Member
  • *****
  • Posts: 3699
  • Leandro Diaz
Re: BGRA Toolbar not changing background color
« Reply #19 on: August 01, 2015, 08:58:44 pm »
I've been away for some health issues.

Getting back, I'm still unable to paint the BCbutton background black. And as I said before, the standard buttons won't display a black background with white text. lainz#007, the example you supplied couldn't be opened.

The demo is 'colorize_final.7z'. You need 7zip to open it.

If you mean that you can't compile it, I can. With the latest lazarus release and bgrabitmap and bgracontrols trunk.

Of course you can't colorize the default buttons. (Those added when you right click the toolbar and do 'New button'). You can style TBCButton that is not the same as TToolButton.

But if you download lazarus trunk you can style TToolButton, I've provided a patch for this some time ago.

 

TinyPortal © 2005-2018