Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-03

Lazarus IDE expert

7 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bogusław Brandys

Hi,

Please provide information of URL to learn how to build Lazarus expert. I have a Delphi expert which parses and modifies units of currently opened project and I want to port it into Lazarus.

I must have know how to list project sources (units), how to find project lpr file to add resource by expert.

Regards
Boguslaw

Reply by email

Mattias Gaertner
to Bogusław Brandys
Show quoted text 8 lines
Hi, Please provide information of URL to learn how to build Lazarus expert. I have a Delphi expert which parses and modifies units of currently opened project and I want to port it into Lazarus. I must have know how to list project sources (units), how to find project lpr file to add resource by expert.

There is a rudimentary start here
http://wiki.lazarus.freepascal.org/Extending_the_IDE

There were some articles in the german toolbox about various topics.

I guess this is a good chance to document some parts in the wiki and fpdoc.

Mattias

Reply by email

Bogusław Brandys
to Mattias Gaertner
Mattias Gaertner wrote 23 lines
On Wed, 05 Mar 2008 11:14:08 +0100 Bogus?aw Brandys wrote: > Hi, > > Please provide information of URL to learn how to build Lazarus > expert. I have a Delphi expert which parses and modifies units of > currently opened project and I want to port it into Lazarus. > > I must have know how to list project sources (units), how to find > project lpr file to add resource by expert. There is a rudimentary start here http://wiki.lazarus.freepascal.org/Extending_the_IDE There were some articles in the german toolbox about various topics. I guess this is a good chance to document some parts in the wiki and fpdoc. Mattias

I cannot find important information :
when looping through TSourceEditorWindowInterface.Items how can I check if unit belongs to currently opened project ?

how can I loop through all project files, not just open units in source editor ? For example I have to find a project file lpr and add or update resource there.

A workaround ?

Regards
Boguslaw

Reply by email

Mattias Gaertner
to Bogusław Brandys
Show quoted text 33 lines
Mattias Gaertner wrote: > On Wed, 05 Mar 2008 11:14:08 +0100 > Bogus?aw Brandys wrote: > >> Hi, >> >> Please provide information of URL to learn how to build Lazarus >> expert. I have a Delphi expert which parses and modifies units of >> currently opened project and I want to port it into Lazarus. >> >> I must have know how to list project sources (units), how to find >> project lpr file to add resource by expert. > > There is a rudimentary start here > http://wiki.lazarus.freepascal.org/Extending_the_IDE > > There were some articles in the german toolbox about various topics. > > I guess this is a good chance to document some parts in the wiki and > fpdoc. > > > Mattias > I cannot find important information : when looping through TSourceEditorWindowInterface.Items how can I check if unit belongs to currently opened project ? how can I loop through all project files, not just open units in source editor ?

See here:
http://wiki.lazarus.freepascal.org/Extending_the_IDE#Units_of_current_project

For example I have to find a project file lpr and add or update resource there.

I will write an example...

Mattias

Reply by email

Bogusław Brandys
to Mattias Gaertner
Mattias Gaertner wrote 18 lines
On Wed, 05 Mar 2008 20:29:39 +0100 Bogus?aw Brandys wrote: > [...] > For example I have to find a project file lpr See here http://wiki.lazarus.freepascal.org/Extending_the_IDE#The_.lpr.2C_.lpi_and_.lps_file_of_a_project > and add or update resource there. and here http://wiki.lazarus.freepascal.org/Extending_the_IDE#Adding_a_resource_directive_to_a_file Mattias

Thank you.Please explain also how to detect if unit source was changed in editor, assuming that I have only a unit filename for example. How can I register a hook called when project is changed (new project is opened) ? I need to update an IDE expert dialog contents when new project is opened...

Regards
Boguslaw

Reply by email

Mattias Gaertner
to Bogusław Brandys
Show quoted text 24 lines
Mattias Gaertner wrote: > On Wed, 05 Mar 2008 20:29:39 +0100 > Bogus?aw Brandys wrote: > >> [...] >> For example I have to find a project file lpr > > See here > http://wiki.lazarus.freepascal.org/Extending_the_IDE#The_.lpr.2C_.lpi_and_.lps_file_of_a_project > > >> and add or update resource there. > > and here > http://wiki.lazarus.freepascal.org/Extending_the_IDE#Adding_a_resource_directive_to_a_file > > > Mattias > Thank you.Please explain also how to detect if unit source was changed in editor, assuming that I have only a unit filename for example.

Keep in mind:
unit file, because a unit can contain include files.

To check if a file has changed, compare the
CodeBuffer.ChangeStep.

Each TCodeBuffer has AddChangeHook/RemoveChangeHook, but this is called many times during an update, so you can not do much in the handler.

How can I register a hook called when project is changed (new project is opened) ?

I added one. See here
http://wiki.lazarus.freepascal.org/Extending_the_IDE#Project_events

I need to update an IDE expert dialog contents when new project is opened...

Mattias

Reply by email