Re: [Lazarus] Debug library (Error on Documentation?)

2018-01-26 Thread Daniel Gaspary via Lazarus
Someone with a wiki login and better english writing skills than me
need to fix the wiki page

Anyway, thank you, Martin.

On Fri, Jan 26, 2018 at 7:03 PM, Martin Frb via Lazarus
 wrote:
> On 26/01/2018 20:06, Daniel Gaspary via Lazarus wrote:
>>
>> To debug a shared Library the wiki [1] says :
>>
>> "Go to Run/Run Parameters, enter the full path of the application that
>> uses your library in Launching Application "
>>
>> But in my case what work was to fill only the field "Host Application".
>
> Yes "host application" is correct.
>
> "launching app" should not be used together with the debugger.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Progressbar never reaches the end

2018-01-26 Thread Bart via Lazarus
On Fri, Jan 26, 2018 at 11:52 AM, frans via Lazarus
 wrote:

> Now, in the right loop, it makes a small better difference.

Or try something like this:
http://svn.code.sf.net/p/flyingsheep/code/trunk/MijnLib/fsiprogbar.pp

I wrote that, just because of the annoying behaviour of the default
progressbar on Win Vista and up.

Bart
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Debug library (Error on Documentation?)

2018-01-26 Thread Martin Frb via Lazarus

On 26/01/2018 20:06, Daniel Gaspary via Lazarus wrote:

To debug a shared Library the wiki [1] says :

"Go to Run/Run Parameters, enter the full path of the application that
uses your library in Launching Application "

But in my case what work was to fill only the field "Host Application".

Yes "host application" is correct.

"launching app" should not be used together with the debugger.

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Debug library (Error on Documentation?)

2018-01-26 Thread Daniel Gaspary via Lazarus
To debug a shared Library the wiki [1] says :

"Go to Run/Run Parameters, enter the full path of the application that
uses your library in Launching Application "

But in my case what work was to fill only the field "Host Application".

I am not sure what should be placed at the wiki.

Also, I Believe the section in question seems to be out of place in
the hierarchy.


[1] http://wiki.freepascal.org/shared_library#dllproc
   Section "Using shared libraries from FPC"
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Maxim Ganetsky via Lazarus
26.01.2018 14:24, Werner Pamler via Lazarus пишет:
> Am 26.01.2018 um 12:05 schrieb Werner Pamler via Lazarus:
>> Wouldn't it be better to have a menu command "Clean po file" which
>> just rebuilds the rsj and po files?
> 
> Ah - there's a checkbox "Force update po files after next compile" for
> this purpose. But this is not working. It requires a Run > Build instead
> of Run > Compile. I suggest it is renamed to "Force update po files
> after next build"

Done, thanks for the hint.

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Werner Pamler via Lazarus

Am 26.01.2018 um 12:05 schrieb Werner Pamler via Lazarus:
Wouldn't it be better to have a menu command "Clean po file" which 
just rebuilds the rsj and po files?


Ah - there's a checkbox "Force update po files after next compile" for 
this purpose. But this is not working. It requires a Run > Build instead 
of Run > Compile. I suggest it is renamed to "Force update po files 
after next build"

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Maxim Ganetsky via Lazarus


26.01.2018 14:05, Werner Pamler via Lazarus пишет:
> 
> Am 26.01.2018 um 11:33 schrieb Maxim Ganetsky via Lazarus:
>> 26.01.2018 12:54, Werner Pamler via Lazarus пишет:
>> Maybe you can use adapted copies of translations.pas unit (from
>> LazUtils) and lcltranslator.pas unit (from LCL). They will need to be
>> ported for Delphi, though.
> 
> Hmm... A lot of work for just a demo. No other way? Can't gnugettext be
> configured to use the Lazarus structure?

Don't know, TBH.

>>> BTW: Working with the i18n options again I noticed that there are now
>>> two boxes "Excluded" > "Identifiers", "Originals" in the i18n project
>>> options. What can be put in there? Which effect does it have? Does it
>>> solve the issue that the same strings enter the po files again and
>>> again?
>> PO file consists of entries. Each entry consists of (at least)
>> identifier name, original string value and translated string value. By
>> default IDE collects all captions from components on form. If you use
>> resource strings for translation at the same time you may want in some
>> cases to filter some strings.
>>
>> For example, you have a form with caption 'Form1' and with some labels
>> in it. Then you translate this caption via resource string and all
>> labels by IDE means. In this case you will have in PO file 'Form1' entry
>> and entry for resource string which effectively replaces it. Obviously
>> you don't want to burden translators with 'Form1' entry. That is where
>> the filters are useful.
> 
> Thanks for the explanation. It motivated me to play with these two
> boxes: If I don't want to  have the auto-generated entry 'Form1' to be
> in the po file I must enter this string in the box "Originals".
> Alternatively I can use the identifier of the caption in the box
> "identifiers" - it must be entered in the po syntax: "tform1.caption",
> or "tform1.button1.caption" for a button named TButton. What was
> confusing me is that the ignored entries remain in the master po and
> translated po files after these modifications. Only after "Clean up and
> Build" they do disappear. This, however, takes a long time because all
> required units are recompiled. Wouldn't it be better to have a menu
> command "Clean po file" which just rebuilds the rsj and po files?

You have for this:

1. 'Project Options' -> 'i18n' -> 'Force PO files update on next
compilation' check box at the bottom of the page.

2. 'Project' -> 'Resave forms with enabled i18n' in main Lazarus menu to
regenerate all .lrj files in project.

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Werner Pamler via Lazarus


Am 26.01.2018 um 11:33 schrieb Maxim Ganetsky via Lazarus:

26.01.2018 12:54, Werner Pamler via Lazarus пишет:
Maybe you can use adapted copies of translations.pas unit (from
LazUtils) and lcltranslator.pas unit (from LCL). They will need to be
ported for Delphi, though.


Hmm... A lot of work for just a demo. No other way? Can't gnugettext be 
configured to use the Lazarus structure?




BTW: Working with the i18n options again I noticed that there are now
two boxes "Excluded" > "Identifiers", "Originals" in the i18n project
options. What can be put in there? Which effect does it have? Does it
solve the issue that the same strings enter the po files again and again?

PO file consists of entries. Each entry consists of (at least)
identifier name, original string value and translated string value. By
default IDE collects all captions from components on form. If you use
resource strings for translation at the same time you may want in some
cases to filter some strings.

For example, you have a form with caption 'Form1' and with some labels
in it. Then you translate this caption via resource string and all
labels by IDE means. In this case you will have in PO file 'Form1' entry
and entry for resource string which effectively replaces it. Obviously
you don't want to burden translators with 'Form1' entry. That is where
the filters are useful.


Thanks for the explanation. It motivated me to play with these two 
boxes: If I don't want to  have the auto-generated entry 'Form1' to be 
in the po file I must enter this string in the box "Originals". 
Alternatively I can use the identifier of the caption in the box 
"identifiers" - it must be entered in the po syntax: "tform1.caption", 
or "tform1.button1.caption" for a button named TButton. What was 
confusing me is that the ignored entries remain in the master po and 
translated po files after these modifications. Only after "Clean up and 
Build" they do disappear. This, however, takes a long time because all 
required units are recompiled. Wouldn't it be better to have a menu 
command "Clean po file" which just rebuilds the rsj and po files?

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Progressbar never reaches the end

2018-01-26 Thread frans via Lazarus

Hi Bart.
Forget my previous mail, I placed the Increment command in teh wrong loop.
Now, in the right loop, it makes a small better difference.
Thx.

mvg
Frans van Leeuwen
M 06-51695390

Op 25-1-2018 om 19:36 schreef Bart via Lazarus:

On Thu, Jan 25, 2018 at 7:27 PM, frans via Lazarus
 wrote:

The
progressbar functions fine but when position=max, the progressbar visualy
never reaches the end.

Thank Uncle Bill for that.
The progressbar animates to the position you set it to.
This takes time.

If you do ProgressBar1.Position := ProgressBar1.Max and the
(physically) wait a while, it will get to full 100%.

The trick to get an immediate update is to decrement the position: no
animation, no waiting time.
Unfortunately this cannot be done for the 100% value.

I have some code in one of my apps like this to get rid of the animation:

   {$ifdef windows}
   if Value > 0 then
   begin
 //trick modern Windows to draw the position at once, otherwise you
never see the 100%
 ProgressBar.Position := Value - 1;
 ProgressBar.Repaint;
 ProgressBar.Position := Value;
 ProgressBar.Repaint;
   end;
   {$endif}


If it bothers you, there are plenty of customdrawn progressbars out
there (or switch of themes, to get the old behaviour back).

Bart



---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Maxim Ganetsky via Lazarus


26.01.2018 12:54, Werner Pamler via Lazarus пишет:
> Currently I am porting the component TMoon to Lazarus
> (https://github.com/Ahoerstemeier/delphimoon). A goal is to be able to
> compile package and demo with Lazarus AND Delphi. The original demo is a
> multi-language application which achieves translation using resource
> strings in a (I guess) Delphi1-like, windows-specific way. Using the
> Lazarus system of po files really is very easy and much more versatile
> compared to that.
> 
> But now I am faced with the problem how to bring this back into the
> Delphi version. I know that the Lazarus translation system is based on
> gnugettext. I can add the unit gnugettext to the Delphi project. But how
> to continue? The original gnugettext requires the language to be
> specified as the name of a subfolder between "locale" and "LC_MESSAGES"
> (e.g., "locale/de/LC_MESSAGES/default.mo" for German), but Lazarus puts
> the language code into the po/mo file name (e.g., "project.de.po"). And
> I also don't get the point how to switch languages at runtime.

Maybe you can use adapted copies of translations.pas unit (from
LazUtils) and lcltranslator.pas unit (from LCL). They will need to be
ported for Delphi, though.

> Does anybody have experience with a similar project? I mean: how to use
> the po files for both Lazarus and Delphi.
> 
> BTW: Working with the i18n options again I noticed that there are now
> two boxes "Excluded" > "Identifiers", "Originals" in the i18n project
> options. What can be put in there? Which effect does it have? Does it
> solve the issue that the same strings enter the po files again and again?

PO file consists of entries. Each entry consists of (at least)
identifier name, original string value and translated string value. By
default IDE collects all captions from components on form. If you use
resource strings for translation at the same time you may want in some
cases to filter some strings.

For example, you have a form with caption 'Form1' and with some labels
in it. Then you translate this caption via resource string and all
labels by IDE means. In this case you will have in PO file 'Form1' entry
and entry for resource string which effectively replaces it. Obviously
you don't want to burden translators with 'Form1' entry. That is where
the filters are useful.

-- 
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Progressbar never reaches the end

2018-01-26 Thread frans via Lazarus

Thx Bart for the reply.
But where stands Value for?
I tried a recordcounter, but that was even worse.

mvg
Frans van Leeuwen
M 06-51695390

Op 25-1-2018 om 19:36 schreef Bart via Lazarus:

On Thu, Jan 25, 2018 at 7:27 PM, frans via Lazarus
 wrote:

The
progressbar functions fine but when position=max, the progressbar visualy
never reaches the end.

Thank Uncle Bill for that.
The progressbar animates to the position you set it to.
This takes time.

If you do ProgressBar1.Position := ProgressBar1.Max and the
(physically) wait a while, it will get to full 100%.

The trick to get an immediate update is to decrement the position: no
animation, no waiting time.
Unfortunately this cannot be done for the 100% value.

I have some code in one of my apps like this to get rid of the animation:

   {$ifdef windows}
   if Value > 0 then
   begin
 //trick modern Windows to draw the position at once, otherwise you
never see the 100%
 ProgressBar.Position := Value - 1;
 ProgressBar.Repaint;
 ProgressBar.Position := Value;
 ProgressBar.Repaint;
   end;
   {$endif}


If it bothers you, there are plenty of customdrawn progressbars out
there (or switch of themes, to get the old behaviour back).

Bart



---
Deze e-mail is gecontroleerd op virussen door AVG.
http://www.avg.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Sharing translations between Lazarus and Delphi versions of the same project

2018-01-26 Thread Werner Pamler via Lazarus
Currently I am porting the component TMoon to Lazarus 
(https://github.com/Ahoerstemeier/delphimoon). A goal is to be able to 
compile package and demo with Lazarus AND Delphi. The original demo is a 
multi-language application which achieves translation using resource 
strings in a (I guess) Delphi1-like, windows-specific way. Using the 
Lazarus system of po files really is very easy and much more versatile 
compared to that.


But now I am faced with the problem how to bring this back into the 
Delphi version. I know that the Lazarus translation system is based on 
gnugettext. I can add the unit gnugettext to the Delphi project. But how 
to continue? The original gnugettext requires the language to be 
specified as the name of a subfolder between "locale" and "LC_MESSAGES" 
(e.g., "locale/de/LC_MESSAGES/default.mo" for German), but Lazarus puts 
the language code into the po/mo file name (e.g., "project.de.po"). And 
I also don't get the point how to switch languages at runtime.


Does anybody have experience with a similar project? I mean: how to use 
the po files for both Lazarus and Delphi.


BTW: Working with the i18n options again I noticed that there are now 
two boxes "Excluded" > "Identifiers", "Originals" in the i18n project 
options. What can be put in there? Which effect does it have? Does it 
solve the issue that the same strings enter the po files again and again?


Werner

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus