Recent

Author Topic: General question about lazarus component creation  (Read 13749 times)

AllRound

  • Newbie
  • Posts: 4
General question about lazarus component creation
« on: January 14, 2005, 01:02:29 pm »
Hey, I just found out about lazarus and I really really like this. I would really like to help out with this project and contribute to this.

What I don't really understand is the exact reason why (visual) delphi components don't work with lazarus. There are some really great open source ones like VCL and Turbopower components.

My question is, what is the reason that they don't work with lazarus? What needs to be changed in these components to make them work with lazarus? Because I don't know where to start...

Lightning

  • Sr. Member
  • ****
  • Posts: 422
General question about lazarus component creation
« Reply #1 on: January 16, 2005, 11:33:31 am »
Well Lazarus is natively crosplatform unlike Delphi wich uses some strange stuff in the CLX and Kylix to achieve this, Lazarus doesn't support win32 resources, you should use Lazarus resources, the extensions are different, the classes are not identical, mainly look at the files included, Delphian stuff, check the Lazarus-CCR website, etc.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

AllRound

  • Newbie
  • Posts: 4
General question about lazarus component creation
« Reply #2 on: January 16, 2005, 02:56:17 pm »
So it's not really easy to make lazarus versions out of delphi components?

Lightning

  • Sr. Member
  • ****
  • Posts: 422
General question about lazarus component creation
« Reply #3 on: January 17, 2005, 10:57:47 am »
For some components it's easy, even easier if you only want them on windows.
I managed to port my own components, the source editor (Synedit) was ported by the Lazarus team, etc.
You should try and see how hard it is for you...
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
General question about lazarus component creation
« Reply #4 on: January 18, 2005, 06:45:29 pm »
Quote from: "AllRound"
So it's not really easy to make lazarus versions out of delphi components?


It depends on how many win32 specific calls the component relies.

For porting SynEdit we have added a lot of WinApi functions to mimic win32 behaviour, but in some cases this is not possible.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
General question about lazarus component creation
« Reply #5 on: January 25, 2005, 05:27:15 am »
It sure was reassuring to see a lot of Windows messages ported to Lazarus. It'd however be much more appreciated if you could provide more thorough coverage of Windows messages ....

Warm regards

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
General question about lazarus component creation
« Reply #6 on: January 26, 2005, 10:59:13 am »
I don't think much more windows message are to be ported to lazarus. Only messages needed for the standard components or synedit were ported.

Lightning

  • Sr. Member
  • ****
  • Posts: 422
General question about lazarus component creation
« Reply #7 on: January 26, 2005, 12:08:51 pm »
If you need some message, you can port it yourself, i did that, maybe use some "ugly" IFDEFS.
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Anonymous

  • Guest
General question about lazarus component creation
« Reply #8 on: January 27, 2005, 11:26:46 am »
Well, if we have more messages ported , it will make it lot easier for other developers to extend the Lazarus component base. (Especially those coming form Windows background).

While it will be ok for some developers to define Windows messages themselves, it will not be standardized, as they will be working on their own implementations. Therefore a more thorough set of Windows Messages unit by Lazarus team will be lot more appreciated.

Warm regards

Lightning

  • Sr. Member
  • ****
  • Posts: 422
General question about lazarus component creation
« Reply #9 on: January 27, 2005, 06:37:37 pm »
Well i didn't have any problems using the ones already defined for win, just some structures were missing and i made those myself, since windows is different from other OSes/DMs you can't usually make crossplatform messages easy, it's much easier to use messages/signals and pass them to a proc/func in a platform independent way instead of porting the winapi to X based OSes.
I would recommend using platform independent messages or functions.
You can implement as many as you need but you must make them work crossplatform.
Then send patches to the mailing list using one of the commands bellow to make them small.
Code: [Select]
cvs -z3 diff -u | gzip > diff.txt
cvs -z3 diff -u > diff.txt
The future must be... Fast and OpenSource so...
Think Open and Lightning Fast!

Vincent Snijders

  • Administrator
  • Hero Member
  • *
  • Posts: 2661
    • My Lazarus wiki user page
General question about lazarus component creation
« Reply #10 on: January 28, 2005, 07:59:29 am »
Quote from: "Anonymous"
Well, if we have more messages ported , it will make it lot easier for other developers to extend the Lazarus component base. (Especially those coming form Windows background).


Windows message are difficult to port to other widget sets.  Therefore a design decision has been made to minimize the amount of messages to be ported.

Quote
While it will be ok for some developers to define Windows messages themselves, it will not be standardized, as they will be working on their own implementations. Therefore a more thorough set of Windows Messages unit by Lazarus team will be lot more appreciated.


I doubt it will be apreciated, if it only works for the win32 widgetset and not for the gtk, gtk2 or any other (future) widgetset suppourted by the LCL.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
General question about lazarus component creation
« Reply #11 on: February 01, 2005, 05:01:22 pm »
You can allways ask to implement a certain message or function.
On a per case basis we will decide if it makes sence to add it or not. We are not reimplementing wine.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Anonymous

  • Guest
General question about lazarus component creation
« Reply #12 on: April 21, 2005, 11:12:21 pm »
offtopic:
Do lazarus components have a CreateWindow virtual method, or initialization has to be done in the constructor  (e.g. Create)?

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
General question about lazarus component creation
« Reply #13 on: April 22, 2005, 10:32:26 am »
The similar mechanism as in Delphi is used. So there is a CreateWnd somewhere in the end of widget creation.
The TWinControl.CreateWnd calls the WidgetSet specific CreateHandle, which creates the "real" widget for that widgetset.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

 

TinyPortal © 2005-2018