[Lazarus] help plz

Phil Hess macpgmr at fastermac.net
Sun Nov 15 20:45:56 CET 2009


Alexander,

I would agree with the other posters that maybe an XUL widgetset (interface) would not be the way to start because of LCL overhead and behavior that may be problematic for a client/server type app.

However, you can certainly use a great deal of existing Lazarus IDE functionality in your project. Here's an example of how the IDE can be used:

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPToolkitStatus.html

In this project I'm using almost all aspects of the IDE, just not using LCL at runtime. The .lfm file structure is simply used as a repository of information about the UI and is not used at runtime either. Take a look at the form-to-ExtPascal converter. This converter is run every time you compile or run the ExtPascal app in the IDE. It checks to see if any changes have been made in any form and if so creates new .inc files that contain the actual ExtPascal code that sets up and initializes the window (form) UI. It also adds any event handlers to the app's appthread unit - events are handles by the current thread and then passed along to the UI.

(A form's auto-generated .inc file is analogous to an LCL auto-generated .lrs file.)

I'm using the LCL TCustom ancestors for my "design controls". This helps me meet one requirement for this project, which is to write as little code as possible. Of course the design controls don't look much like Ext JS runtime controls, but that's not the point. The point is to have a way of graphically designing the app.

Example using the MultiSelect (TListBox) control:

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_MultiSelect_in_IDE.jpg

http://web.fastermac.net/~MacPgmr/ExtPascal/ExtPascal_MultiSelect_at_Runtime.jpg

Source is included with the ExtPascal SVN or as a .zip:

http://code.google.com/p/extpascal/

http://web.fastermac.net/~MacPgmr/ExtPascal/

You might start with a simple LCL form and write an XUL equivalent, then look at commonalities between them. Then start thinking about how best to use Lazarus as a designer. When I was creating my design control package for Lazarus, it was as though the IDE developers had anticipated everything I would ever need. The only problem was the lack of documentation - just follow my extp_proj package to avoid entering a lot of cul-de-sacs.

Thanks.

-Phil



----- "Alexander Kaupp" <tanila at tanila.org> wrote:

> Hi Mattias,
> 
> 
> Am Samstag, den 14.11.2009, 16:27 +0100 schrieb Mattias Gaertner:
> > On Sat, 14 Nov 2009 15:44:37 +0100
> > Alexander Kaupp <tanila at tanila.org> wrote:
> > 
> > > Hello,
> > > 
> > > I had the idea to try to make it possible to transform an
> existing
> > > lazarus-project to a XUL/XPCOM-Gui application.
> > 
> > Do you mean you want to write a converter tool to convert LCL
> > apps into XUL/XPCOM-Gui apps?
> > Or do you want to extend the IDE to create XUL/XPCOM-Gui apps?
> > 
> 
> Hmm I am not shure what is the better/easier way to start. Would be
> great to have it as a new LCL-Interface.
> 





More information about the Lazarus mailing list