Recent

Author Topic: Button with 2 lines (diferentes font size) (SOLVED)  (Read 2558 times)

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Button with 2 lines (diferentes font size) (SOLVED)
« on: September 06, 2016, 12:04:33 am »
Hi Circular/Lainz, is posible use TBCButton like the attachment.

Thanks!!!
« Last Edit: September 06, 2016, 01:01:25 am by esvignolo »

lainz

  • Hero Member
  • *****
  • Posts: 4473
    • https://lainz.github.io/
Re: Button with 2 lines (diferentes font size)
« Reply #1 on: September 06, 2016, 12:17:06 am »
You can try to use the event OnAfterRenderBCButton.

Set the property ShowCaption to False. Then you can draw two texts by using that event:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.BCButton1AfterRenderBCButton(Sender: TObject;
  2.   const ABGRA: TBGRABitmap; AState: TBCButtonState; ARect: TRect);
  3. begin
  4.   // draw your text here for each state
  5. end;
  6.  

If you mean the style, exactly looking this control can't :)

You can see the controls in BCImageButton unit, the class TBCXButton and how you can create your own button control.

Or you can create a Drawer for BGRA Custom Drawn controls, see that units too.

Edit: of course AutoSize will not work
« Last Edit: September 06, 2016, 12:42:57 am by lainz »

esvignolo

  • Full Member
  • ***
  • Posts: 159
  • Using FPC in Windows, Linux, Macos
Re: Button with 2 lines (diferentes font size)
« Reply #2 on: September 06, 2016, 01:00:54 am »
Thanks!!

You can try to use the event OnAfterRenderBCButton.

Set the property ShowCaption to False. Then you can draw two texts by using that event:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.BCButton1AfterRenderBCButton(Sender: TObject;
  2.   const ABGRA: TBGRABitmap; AState: TBCButtonState; ARect: TRect);
  3. begin
  4.   // draw your text here for each state
  5. end;
  6.  

If you mean the style, exactly looking this control can't :)

You can see the controls in BCImageButton unit, the class TBCXButton and how you can create your own button control.

Or you can create a Drawer for BGRA Custom Drawn controls, see that units too.

Edit: of course AutoSize will not work

 

TinyPortal © 2005-2018