Recent

Author Topic: Add OnPaint and OnDrawItem to TToolBar  (Read 5852 times)

lainz

  • Hero Member
  • *****
  • Posts: 3303
    • Lainz
Add OnPaint and OnDrawItem to TToolBar
« on: May 04, 2015, 08:17:00 pm »
Hi, please test this new feature I'm adding to TToolBar

It allow to customize the TToolBar with
- OnPaint event: change the background of the TToolBar
- OnDrawItem event: change the style of the TToolButton

Attached:
- Patch for lazarus trunc
- Screenshot
- Demo

Share your comments.
« Last Edit: May 05, 2015, 08:21:15 pm by 007 »

circular

  • Hero Member
  • *****
  • Posts: 3047
    • Personal webpage
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #1 on: May 05, 2015, 01:17:35 am »
I can't seem to be able to apply the patch. I guess it is because I have Lazarus 1.0.10.

I looked at the code and it makes sense to me.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3303
    • Lainz
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #2 on: May 05, 2015, 08:22:10 pm »
Now in bugtracker
http://bugs.freepascal.org/view.php?id=28029

Hopefully they want to add it.

circular

  • Hero Member
  • *****
  • Posts: 3047
    • Personal webpage
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #3 on: May 06, 2015, 02:31:10 am »
It seems it was added.   :)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3303
    • Lainz
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #4 on: May 06, 2015, 03:20:09 am »
It seems it was added.   :)

Yes! Feel free to use it to theme LazPaint  :)

circular

  • Hero Member
  • *****
  • Posts: 3047
    • Personal webpage
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #5 on: May 06, 2015, 11:39:58 am »
Yes. That will be in Lazarus 1.6?
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3303
    • Lainz
Re: Add OnPaint and OnDrawItem to TToolBar
« Reply #6 on: May 06, 2015, 06:20:59 pm »
Yes. That will be in Lazarus 1.6?
im not sure. there is also a fixes branch or something like that.

I've added it to the wiki, hopefully it works this way:
http://wiki.lazarus.freepascal.org/Lazarus_1.4_fixes_branch#Submitted_by_others
« Last Edit: May 06, 2015, 06:39:29 pm by 007 »