Messages posted here can also be received as emails: information pre-print options:     

Templot Club Home list recently active topics
  Search  Image Gallery  My Account  Members  Help       

Forums and resources for users of Templot track design software about Templot Club

Please click: important information for new members and first-time visitors.
quick links: files, photos and messages archive on Yahoo
A single message from topic:  Making sense of program code in Lazarus   in forum:  Off track
main Templot web site

Single message by Martin Wynne       Topic: Making sense of program code in Lazarus
Posted: 14 Mar 2020 16:21
 PM  Reply with quote  Reply blank  Go to topic 
Martin Wynne
West Of The Severn, United Kingdom

view images in gallery
view images as slides
DerekStuart wrote: I notice using TSpeedButton the background colour still remains grey, as per the normal button. This isn't an issue as it can be overlaid with 100% bitmap anyway.Hi Derek,

I see in Lazarus (but not in Delphi5) that TSpeedButton does have a Color property -- but to make it work you must also set Transparent to False.

The default background colour is actually clBtnFace, which is the current colour set in Windows, so that it matches other Windows applications and ordinary TButtons. If the user were to change their Windows desktop theme, the SpeedButtons would change accordingly.

All TGraphicControls have an accessible Canvas property. You can therefore draw whatever you want on the button in any colour. For example on a large SpeedButton you could draw the entire Templot trackplan. :)

To do such things you need to add a handler in the SpeedButton's Paint event (in the events column on the Object Inspector):

procedure Tmy_form.my_speedbuttonPaint(Sender:TObject);

  with my_speedbutton.Canvas do begin


    TextOut(0,0,'click me');



which would make the button colour yellow all over with the text click me on it in red, in Arial size 12, at the top-left of the button.

Note that once you do this sort of thing, you make yourself responsible for all the other built-in functions, such as drawing the borders, latched-down appearance, etc.



A single message from topic:  Making sense of program code in Lazarus   in forum:  Off track
about Templot Club

list recently active topics Templot Companion live online chat Please click: important information for new members and first-time visitors.

Please read this important note about copyright: Unless stated otherwise, all the files submitted to this web site are copyright and the property of the respective contributor. You are welcome to use them for your own personal non-commercial purposes. If you want to re-publish any of this material or use it commercially, you must first obtain the owner's permission to do so.

The small print: All material submitted to this web site is the responsibility of the respective contributor. By submitting material to this web site you acknowledge that you accept full responsibility for the material submitted. The owner of this web site is not responsible for any content displayed here other than his own contributions. The owner of this web site may edit, modify or remove any content at any time without giving notice or reason.
Problems with this web site? Contact
Powered by UltraBB - © 2009 Data 1 Systems