Recent

Author Topic: Creating my first Lazarus component  (Read 5318 times)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 747
Creating my first Lazarus component
« on: August 18, 2011, 05:24:40 pm »
I'm just learning to use Lazarus, and want to create my first LCL component so I can get a handle on the basics. 
Can anyone recommend a -really- simple component example that I might follow?   (I've built a package with one component as described in the Lazarus tutorial already, and tried a few Delphi-to-LCL conversions (with no success so far)). 

I'd like to build a component that descends from TPanel and changes color when clicked.  Very simple, but should illustrate all of the elements involved and give me an idea of where I'm going wrong with my conversion efforts.

Recommendations/suggestions appreciated.

Thanks!



Leledumbo

  • Hero Member
  • *****
  • Posts: 8836
  • Programming + Glam Metal + Tae Kwon Do = Me

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 747
Re: Creating my first Lazarus component
« Reply #2 on: August 18, 2011, 06:18:05 pm »
That is exactly what I was looking for -- thank you so much!

I don't see the link you gave me in the documentation index at

         http://wiki.lazarus.freepascal.org/Lazarus_Documentation

But that could just be me not looking in the right place.  Could you add your link to this index?  I'm sure others would find it helpful.

Thanks again! 


Added note:  Yes, that documentation and example did the trick.  Just managed to convert and test my first Delphi component.

« Last Edit: August 18, 2011, 06:39:12 pm by Curt Carpenter »

eny

  • Hero Member
  • *****
  • Posts: 1665
Re: Creating my first Lazarus component
« Reply #3 on: August 18, 2011, 09:48:21 pm »
As a general rule Google has a better search engine than the Wiki.
When searching for 'creating lazarus component' with Google it's the first hit...
All posts based on: Win11; stable Lazarus 4_4  (x64) 2026-02-12 (unless specified otherwise...)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 747
Re: Creating my first Lazarus component
« Reply #4 on: August 19, 2011, 07:28:30 pm »
I added the link to "how to create a component" to the lazarus docs index page -- not sure I did it right, but it's there :)

Thanks for the tip on google -- I'll remember that.  Right now, I'm trying to learn my way around, and don't mind hunting since it's a good way to stumble on things.

Thanks to all for the help.  Now have two component working!

 

TinyPortal © 2005-2018