Sign in Join

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

Mailing lists / lazarus / 2008-10

external tools

13 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Benito van der Zander

Hi,
is there a way to execute a external tool for every unit of the project directly from Lazarus?
So without creating other files like makefiles...

Benito

Reply by email

Mattias Gaertner
to Benito van der Zander
Hi, is there a way to execute a external tool for every unit of the project directly from Lazarus? So without creating other files like makefiles...

There are several ways:
a) write a script or program and use external tool b) write an IDE plugin

If you can give some more hints what do you want to do, you will get more hints.

Mattias

Reply by email

Benito van der Zander
Why not simply parse all .rst files? Or enable i18n and read the .po files?

Because I use the program to create the rst files in the first place. Normally you have to declare a variable for every string to translate, with the program you can just write tr['string to translate'] and nothing more.
The only problem is how to call it elegant.

Benito

Reply by email

Mattias Gaertner
to Benito van der Zander
Show quoted text 6 lines
> Why not simply parse all .rst files? > Or enable i18n and read the .po files? > Because I use the program to create the rst files in the first place. Normally you have to declare a variable for every string to translate,

... which is pretty simple in lazarus. I press my shortcut, press enter and have my resourcestring.

with the program you can just write tr['string to translate'] and nothing more.

What can tr[] do better than resourcestrings?

The only problem is how to call it elegant.

Resourcestrings are elegant and flexible, because you can distinguish resourcestring sections. In lazarus every package/project has its own set of resourcestrings.

Mattias

Reply by email

Benito van der Zander
... which is pretty simple in lazarus. I press my shortcut, press enter and have my resourcestring.

which shortcut? I didn't find one.

What can tr[] do better than resourcestrings?

You don't have to create another variable and don't have to look somewhere else for the text in the base language.

Benito

Reply by email

Graeme Geldenhuys
to Benito van der Zander
Benito van der Zander wrote
> which shortcut? I didn't find one.

When you setup external tools, you can set a keyboard shortcut to launch that tool. I do the same for my external tools.

The only problem is, I can't seem to launch the fpGUI UI Designer when I press F12. It seems the IDE's F12 (built-in form designer) takes preference. :-(

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Benito van der Zander: which shortcut? I didn't find one. You don't have to create another variable and don't…

2008/10/18, Benito van der Zander :

Show quoted text 12 lines
> ... which is pretty simple in lazarus. I press my shortcut, press > enter and have my resourcestring. > > which shortcut? I didn't find one. > What can tr[] do better than resourcestrings? You don't have to create another variable and don't have to look somewhere else for the text in the base language.

I guess Mattias means, that he has assigned a shortcut to Tools -> Make resourcestring and that he presses that.

Vincent

Reply by email

Mattias Gaertner
to Vincent Snijders
Show quoted text 16 lines
2008/10/18, Benito van der Zander : > > > ... which is pretty simple in lazarus. I press my shortcut, press > > enter and have my resourcestring. > > > > > > which shortcut? I didn't find one. > > > What can tr[] do better than resourcestrings? > > You don't have to create another variable and don't have to look > somewhere else for the text in the base language. I guess Mattias means, that he has assigned a shortcut to Tools -> Make resourcestring and that he presses that.

Yes. :)

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Fri, 17 Oct 2008 22:26:20 +0200 ... which is pretty simple in lazarus. I press my…
Mattias Gaertner wrote 8 lines
> > Why not simply parse all .rst files? > > Or enable i18n and read the .po files? > > > Because I use the program to create the rst files in the first place. > Normally you have to declare a variable for every string to translate, ... which is pretty simple in lazarus. I press my shortcut, press enter and have my resourcestring.

Please note the bug in External Tools. The Parameters and Working Directory information is never stored. So you can't pass information like $EdPath() to the external tool. :-(

http://bugs.freepascal.org/view.php?id=12436

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys: On Sat, Oct 18, 2008 at 7:34 PM, Benito van der Zander When you setup external tools, you…
Show quoted text 11 lines
On Sat, Oct 18, 2008 at 7:34 PM, Benito van der Zander wrote: >> > which shortcut? I didn't find one. When you setup external tools, you can set a keyboard shortcut to launch that tool. I do the same for my external tools. The only problem is, I can't seem to launch the fpGUI UI Designer when I press F12. It seems the IDE's F12 (built-in form designer) takes preference. :-(

Have you checked your keymapping for consistency?

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote 5 lines
> The only problem is, I can't seem to launch the fpGUI UI Designer when > I press F12. It seems the IDE's F12 (built-in form designer) takes > preference. :-( Have you checked your keymapping for consistency?

Yes, it reports "no errors in key mapping found".

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys: On Fri, Oct 17, 2008 at 11:15 PM, Mattias Gaertner Please note the bug in External Tools.…
Graeme Geldenhuys wrote 9 lines
> > ... which is pretty simple in lazarus. I press my shortcut, press > enter and have my resourcestring. Please note the bug in External Tools. The Parameters and Working Directory information is never stored. So you can't pass information like $EdPath() to the external tool. :-( http://bugs.freepascal.org/view.php?id=12436

I think I found the problem. I attached a patch to that bug report. The External Tools Edit dialog was the cause. It's OK button's OnClick event handler was never assigned!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Benito van der Zander
I guess Mattias means, that he has assigned a shortcut to Tools -> Make resourcestring and that he presses that.

Thanks, I seem to have overlooked it.
The funny thing is, it crashed Lazarus when I clicked on it for the first time.

When you setup external tools, you can set a keyboard shortcut to launch that tool. I do the same for my external tools.

Yes, but than it still isn't called for every unit.

Please note the bug in External Tools. The Parameters and Working Directory information is never stored. So you can't pass information like $EdPath() to the external tool. :-(

At least $EdFile() worked in r16947.

Benito

Reply by email