any ideas to make buttons "prettier"? lazarus / 39-Graphics ---------------------------------------------------------------------- Blue1987 · 2011-09-17 14:29 hi guys... I was thinking to use what learned here http://www.lazarus.freepascal.org/index.php/topic,14492.msg76769.html# msg76769 to override the paint procedure of the buttons (they are all bitbtn, but I am using them as they were simply tbuttons) I used in the design of the form, in order to make them "prettier"... I really do not know what I am exactly looking for... maybe something with transparency, or some smooth shape... or shadows... or ... dunno!!! any idea? ---------------------------------------------------------------------- Arbee · 2011-09-17 16:50 http://wiki.lazarus.freepascal.org/BGRAControls ---------------------------------------------------------------------- Zoran · 2011-09-17 17:12 See BGRAButton gallery: http://wiki.lazarus.freepascal.org/BGRAButton_Gallery ---------------------------------------------------------------------- lainz · 2011-09-17 19:57 See testbgracontrols (when you download BGRAControls of course). ---------------------------------------------------------------------- Blue1987 · 2011-09-18 14:19 by the way... Tlabel has "paint" procedure, which is the equivalent procedure for a Tbutton? (or Tbitbtn)?? so that I just override the paint procedure (without substituting all the bitbtns I've already placed in the form)... ---------------------------------------------------------------------- lainz · 2011-09-18 14:47 Quote from: Blue1987 on September 18, 2011, 04:19:03 pmby the way... Tlabel has "paint" procedure, which is the equivalent procedure for a Tbutton? (or Tbitbtn)?? so that I just override the paint procedure (without substituting all the bitbtns I've already placed in the form)... Right clic on the button > Change class > select TBGRAButton in 'New class' > then click on 'Remove all invalid properties'. ---------------------------------------------------------------------- Blue1987 · 2011-09-18 17:36 Quote from: lainz on September 18, 2011, 04:47:21 pmQuote from: Blue1987 on September 18, 2011, 04:19:03 pmby the way... Tlabel has "paint" procedure, which is the equivalent procedure for a Tbutton? (or Tbitbtn)?? so that I just override the paint procedure (without substituting all the bitbtns I've already placed in the form)... Right clic on the button > Change class > select TBGRAButton in 'New class' > then click on 'Remove all invalid properties'. ehr, I haven't well explained what I meant. I have thousends bitbtns already in the form, I cannot do it thousands times So I would simply override the "paint" procedure for all Tbitbtn in the form... ---------------------------------------------------------------------- CaptBill · 2011-09-18 18:19 Quote from: Blue1987 on September 18, 2011, 07:36:45 pmQuote from: lainz on September 18, 2011, 04:47:21 pmQuote from: Blue1987 on September 18, 2011, 04:19:03 pmby the way... Tlabel has "paint" procedure, which is the equivalent procedure for a Tbutton? (or Tbitbtn)?? so that I just override the paint procedure (without substituting all the bitbtns I've already placed in the form)... Right clic on the button > Change class > select TBGRAButton in 'New class' > then click on 'Remove all invalid properties'. ehr, I haven't well explained what I meant. I have thousends bitbtns already in the form, I cannot do it thousands times So I would simply override the "paint" procedure for all Tbitbtn in the form... You only need to change the OnPaint  procedure of your base TButton, assuming you want the same style/paint routine. Get one button going like you like and just change the class definition of each button in the .lfm to preserve your other properties, is one approach. Code: [Select]xButton =TButton // change to  xButton=TMyButton. ---------------------------------------------------------------------- felipemdc · 2011-09-18 18:44 Quote from: Blue1987 on September 17, 2011, 04:29:17 pmto override the paint procedure of the buttons (they are all bitbtn, never override the paint event of tbutton, tbitbtn or in general any lcl standard windowed native control.  this may work in Windows bit will not work in any other platform. Lazarus provides a series of non- native equivalents for standard controls here: wiki.lazarus.freepascal.org/Lazarus_Custom_Drawn_Controls ---------------------------------------------------------------------- Blue1987 · 2011-09-19 18:10 Quote from: felipemdc on September 18, 2011, 08:44:44 pmQuote from: Blue1987 on September 17, 2011, 04:29:17 pmto override the paint procedure of the buttons (they are all bitbtn, never override the paint event of tbutton, tbitbtn or in general any lcl standard windowed native control.  this may work in Windows bit will not work in any other platform. Lazarus provides a series of non- native equivalents for standard controls here: wiki.lazarus.freepascal.org/Lazarus_Custom_Drawn_Controls thank you... btw, how can I say to lazarus (somewhere in the unit1, I guess): "all bitbtn in the form are not tbitbtn anymore but become customdrawn_button"? or bgra_buttons? ---------------------------------------------------------------------- lainz · 2011-09-20 01:29 Quote from: Blue1987 on September 19, 2011, 08:10:24 pmQuote from: felipemdc on September 18, 2011, 08:44:44 pmQuote from: Blue1987 on September 17, 2011, 04:29:17 pmto override the paint procedure of the buttons (they are all bitbtn, never override the paint event of tbutton, tbitbtn or in general any lcl standard windowed native control.  this may work in Windows bit will not work in any other platform. Lazarus provides a series of non- native equivalents for standard controls here: wiki.lazarus.freepascal.org/Lazarus_Custom_Drawn_Controls thank you... btw, how can I say to lazarus (somewhere in the unit1, I guess): "all bitbtn in the form are not tbitbtn anymore but become customdrawn_button"? or bgra_buttons? Try to open the .lfm with a text editor and replace 'TButton' with 'TBGRAButton' or 'TCDButton'. Depending on the new button properties when you open the form you will need to press the 'remove unused prop..' for each button. ---------------------------------------------------------------------- Zoran · 2011-09-20 06:37 Quote from: lainz on September 20, 2011, 03:29:15 am Try to open the .lfm with a text editor and replace 'TButton' with 'TBGRAButton' or 'TCDButton'. Depending on the new button properties when you open the form you will need to press the 'remove unused prop..' for each button. Also, for each .lfm, you must do the same in .pas file.