Re: [Lazarus] Testing Rapberry Pi 3 performance

2016-04-06 Thread Michael Schnell

[fpc-devel] Bug 29760 on FPC 3.0 Win64

-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Cant compile the IDE with the most recent fpc (3.1.1)

2016-04-06 Thread Michael Schnell

It happened to me (again) :(.

After upgrading fpc to the latest svn version, I can't compile the 
latest svn version of Lazarus.


The problem (first) occurs with RegisterFCL.

(Currently the error is "Can't find unit db used by RegisterFCL", but 
there had been other units before it did not find. For a test I moved 
two of the to the dir it in fact searches for fpc units: 
-Fu/usr/lib/fpc/3.1.1/units/i386-linux/rtl  )



Seemingly a unit search dir for some of the fpc stuff is missing.

How to tell the Lazarus make process about those  ?

thank,
-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TsWorkshetGrid isn't scrolling enough

2016-04-06 Thread Frans

Hi.

I have 96 dpi, but I use Windows classic as thema.
When  I switch to Windows 7 Basic, the grid works fine.

mvg
Frans van Leeuwen
M 06-51695390

Op 05-04-2016 om 22:21 schreef Werner Pamler:



I used Laz 1.6/FPC 3.0  on Win7. I'm not sure wich version of fps, I think 1.6.


Strange... I went back to 1.4.4, no problem there either. Maybe a high-dpi issue? What is your 
screen pixel density? Mine is 96 dpi (in Windows, this is called "100% standard").


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Testing Rapberry Pi 3 performance

2016-04-06 Thread Bo Berglund
On Wed, 06 Apr 2016 09:33:45 +0200, Michael Schnell
 wrote:

>[fpc-devel] Bug 29760 on FPC 3.0 Win64
>
OK, so it was on the devel list
I do not often check that even though it is in GMANE.

Found it now and it looks like it has something to do with operations
on variables that are double and currency. Like getting the wrong
exponent when multiplying them.

I never ever use currency variables so I guess I am good. :)

-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Printing on Raspberry Pi

2016-04-06 Thread Koenraad Lelong

Op 05-04-16 om 21:00 schreef ahiggins:

Not sure if you resolved the missed align data error (im coming to the party
late), today i have had the same problem, now below is the crude mod i did
to get it working for me, not sure if it will help your problem but worth a
try.

LR_Prntr unit. around line 1042

// screen sizes
   Pgw :=
round((PaperSize.PaperRect.PhysicalRect.Right-PaperSize.PaperRect.PhysicalRect.Left)
* kx);
   //Pgw := round(PPgw * kx);
   Pgh :=
round((PaperSize.PaperRect.PhysicalRect.Bottom-PaperSize.PaperRect.PhysicalRect.Top)
* ky);
   //Pgh := round(PPgh * ky);
   Ofx := round(PaperSize.PaperRect.WorkRect.Left * kx);
   //Ofx := round(POfx * kx);
   Ofy := round(PaperSize.PaperRect.WorkRect.Top * ky);
   //Ofy := round(POfy * ky);
   Pw  :=
round((PaperSize.PaperRect.WorkRect.Right-PaperSize.PaperRect.WorkRect.Left)
* kx);
   //Pw  := round(PPw  * kx);
   Ph  :=
round((PaperSize.PaperRect.WorkRect.Bottom-PaperSize.PaperRect.WorkRect.Top)
* ky);
   //Ph  := round(PPh  * ky);


kind regards

Tony

Hi Tony,

If you had looked at the bug-tracker, you would have found a solution 
;-) Maybe I should have posted it here also.
I used an intermediate variable, because a type-cast crashed the 
application :

//  Pgw := round(PPgw * kx);  Does not work on Pi
  tmp1:=PPgw;
  Pgw:=round(tmp1 * kx);
etc. where tmp1 is a longint.
I find my solution also a hack, but it works so I'm satisfied.

Koenraad.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Class & Method info line at top of editor

2016-04-06 Thread Graeme Geldenhuys
Hi,

I don't really know what it is called, but when I'm in a method of a
class, the top line of my editor (I call it "info line"), tells me what
class and method I am in. This is very useful information.

I have noticed today that if I work with Object types (not Class types),
then I don't see that info line. And yes, the method is longer that the
editor is high (what triggers the info line).

Is there some place where I need to activate when that info line is
displayed, or is support for Object types not implemented?

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Testing Rapberry Pi 3 performance

2016-04-06 Thread Mark Morgan Lloyd

Bo Berglund wrote:

On Wed, 06 Apr 2016 09:33:45 +0200, Michael Schnell
 wrote:


[fpc-devel] Bug 29760 on FPC 3.0 Win64


OK, so it was on the devel list
I do not often check that even though it is in GMANE.

Found it now and it looks like it has something to do with operations
on variables that are double and currency. Like getting the wrong
exponent when multiplying them.

I never ever use currency variables so I guess I am good. :)


Don't guess. You're not that good.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Class & Method info line at top of editor

2016-04-06 Thread Martin Frb

On 06/04/2016 12:03, Graeme Geldenhuys wrote:

Hi,

I don't really know what it is called, but when I'm in a method of a
class, the top line of my editor (I call it "info line"), tells me what
class and method I am in. This is very useful information.

I have noticed today that if I work with Object types (not Class types),
then I don't see that info line. And yes, the method is longer that the
editor is high (what triggers the info line).

Is there some place where I need to activate when that info line is
displayed, or is support for Object types not implemented?


It works for me. It all depends on the HL recognizing them. Can you test 
with a simple example? Maybe there is something else that prevents it.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt  wrote:
[...]

> No, I have one of ~1Mb. But probably logical if the file is not there ?
>
> It's not quite clear what to think of your report ?
>
> For me
>
> "PDF was succefully generated"
>
> does not compute with
>
> "Unable to open file "fonts\FreeSans.ttf".
>
> :-)


Oops, I meant: "PDF was succefully generated but with some issues". :-D

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:26 PM, Graeme Geldenhuys <
mailingli...@geldenhuys.co.uk> wrote:
[...]

> On 2016-03-31 17:13, Michael Van Canneyt wrote:
>
> I had a look at your PDF. I did not extract the embedded FreeSans font
> you have embedded, so don't know the font file version, but based on its
> size (264KB) it is a very old FreeSans.ttf file. The one I tested with
> is 1.56MB in size.
>
> If I must, I can extract your embedded FreeSans font to query it further
> and see the version and glyph count it defines.


Hm... I'll try Arial instead of FreeSans.

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:17 PM, Michael Van Canneyt  wrote:
[...]

> Please, don't do {%H-} etc:
>
> procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum:
> integer;{%H-}FontDef: TFontDef);virtual;
>

{$HINTS OFF} instead of it?


> Typecasts like this should also not be done:
>
> +FontDef.FDiffs := WideString(lFontDef.Diffs);
> +FontDef.FCharWidth := WideString(lFontDef.CharWidths);
>

Because the FontDef.FCharWidth is a WideString.


> -  Arr.AddIntArray(FontDef.FCharWidth);
> +  Arr.AddIntArray(string(FontDef.FCharWidth));
>

Because Arr.AddIntArray() is AnsiString (string) and FontDef.FCharWidth
WideString.


> We need to investigate why you think this typecast is needed.
>

It just stop hints/warnings from compiler.


> The buffer initialization is good, though.
>
> I will not apply this patch, this needs deeper investigation.


It just remove unused variables and apply some cast fixes.

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt  wrote:
>
> On Thu, Mar 31, 2016 at 11:18 AM, silvioprog  wrote:
>
> [...]

> Greek: Ge?? s?? ??s
>> Polish: Witaj swiecie
>> Portuguese: Ol? mundo
>> Russian:  ???
>> Vietnamese: Xin ch?o th? gi?i
>
>
This attached patch definitely fixes this error on Windows. :-)

-- 
Silvio Clécio


0001-fix-wrong-characters.patch
Description: Binary data
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Wed, Apr 6, 2016 at 1:57 PM, silvioprog  wrote:

> On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt <
> mich...@freepascal.org> wrote:
>>
>> On Thu, Mar 31, 2016 at 11:18 AM, silvioprog 
>>> wrote:
>>
>> [...]
>
>> Greek: Ge?? s?? ??s
>>> Polish: Witaj swiecie
>>> Portuguese: Ol? mundo
>>> Russian:  ???
>>> Vietnamese: Xin ch?o th? gi?i
>>
>>
> This attached patch definitely fixes this error on Windows. :-)
>

Oops, I forgot the test using the attached patch result:

https://dl.dropboxusercontent.com/u/135304375/test.pdf

It was generated on Windows 7 (using Arial instead of FreeSans).

Thanks for this awesome and promising library!

-- 
Silvio Clécio
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 1:13 PM, Michael Van Canneyt 
wrote:

On Thu, Mar 31, 2016 at 11:18 AM, silvioprog  wrote:

[...]



Greek: Ge?? s?? ??s

Polish: Witaj swiecie
Portuguese: Ol? mundo
Russian:  ???
Vietnamese: Xin ch?o th? gi?i




This attached patch definitely fixes this error on Windows. :-)


Why is this patch needed ? It should not be needed at all ?

In each case it will not be applied, since it assumes use of lazarus, 
and that is not acceptable in the FCL.


Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 17:57, silvioprog wrote:
> This attached patch definitely fixes this error on Windows. :-)

This was already fixed (plus other changes). I simply forgot to send
Michael the email yesterday to update FPC.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Thu, Mar 31, 2016 at 1:17 PM, Michael Van Canneyt 
wrote:

[...]


Please, don't do {%H-} etc:

procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum:
integer;{%H-}FontDef: TFontDef);virtual;



{$HINTS OFF} instead of it?


No, fix the hint (if possible).


Typecasts like this should also not be done:

+FontDef.FDiffs := WideString(lFontDef.Diffs);
+FontDef.FCharWidth := WideString(lFontDef.CharWidths);



Because the FontDef.FCharWidth is a WideString.



-  Arr.AddIntArray(FontDef.FCharWidth);
+  Arr.AddIntArray(string(FontDef.FCharWidth));



Because Arr.AddIntArray() is AnsiString (string) and FontDef.FCharWidth
WideString.






We need to investigate why you think this typecast is needed.



It just stop hints/warnings from compiler.


The correct thing to do is to make sure the types are compatible. 
What you do is hide the real issue.


But we will look at it.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-01 20:16, Jesus Reyes A. wrote:
> (it seems currently is not necessary because the matrix is auto-adjusted)  
> and then ...
> 
>P.WriteUTF8Text(15, 120, 'Languages: English: Hello, World!');
>P.WriteUTF8Text(40, 130, 'Greek: -FÃåéÜ óïõ êüóìïò');
>P.WriteUTF8Text(40, 140, 'Polish: Witaj -B¶wiecie');
>P.WriteUTF8Text(40, 150, 'Portuguese: Ol-Aá mundo');
> 
> Of course, before DoUnitConversion(p1); there should be a  
> DoMatrixTransform(p1); etc.


This change has been made and will be available in FPC repo shortly.
Incidently, this drastically reduces the amount of application code and
makes it much neater. Something I like. :)


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, Graeme Geldenhuys wrote:


On 2016-04-06 17:57, silvioprog wrote:

This attached patch definitely fixes this error on Windows. :-)


This was already fixed (plus other changes). I simply forgot to send
Michael the email yesterday to update FPC.


Patch applied. Rev. 33428.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 18:18, Michael Van Canneyt wrote:
>>> >> procedure CreateTTFCIDSystemInfo(const {%H-}EmbeddedFontNum:
>>> >> integer;{%H-}FontDef: TFontDef);virtual;
>>> >>
>> >
>> > {$HINTS OFF} instead of it?
> No, fix the hint (if possible).
> 

As I "hinted" (excuse the pun) at before, any reference at TFontDef will
be removed soon. It isn't needed any more.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 18:23, Michael Van Canneyt wrote:
> Patch applied. Rev. 33428.

Thanks Michael.

Regards,
  - Graeme -


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-01 02:21, Jesus Reyes A. wrote:
>> >   // Add your custom page as follows
>> >   P := TMyPDFPage.Create(Doc);
>> >   Doc.Pages.Add(P); // global Page Object list
>> >   lSection.AddPage(P); // which Section our page belongs too
>> >
> Yes that would suffice, thanks.


This change has now been made.


Regards,
  - Graeme -


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TsWorkshetGrid isn't scrolling enough

2016-04-06 Thread Frans

Hi.

Your demo works fine, so I will change my program.
I've noticed another point: on my computer is the fontsize and the row heigth greater in my program 
than in your demo.

I've tried changing the fontsize, in the object inspector and in the code, but 
that makes no difference.

I use this code in a much bigger program where also TStringGrids are used. There too is the fontsize 
bigger for the worksheetgrid then in the StringGrids. Why? I do not know.


Thanks for your time and help.

mvg
Frans van Leeuwen
M 06-51695390

Op 06-04-2016 om 14:31 schreef Werner Pamler:



I have 96 dpi, but I use Windows classic as thema.
When  I switch to Windows 7 Basic, the grid works fine.


No luck, I switched to Win-Classic design, stll works fine. Since TsWorksheetGrid is a modified 
LCL TCustomDrawGrid and IIRC does not change anything with respect to scrolling I suspect that the 
bug is in grids.pas. Could you please run the attached demo. It is like your own demo but replaces 
the TsWorksheetGrid by a standard TStringGrid. On my system, this demo behaves correctly as well.





--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread silvioprog
On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt 
wrote:
[...]

> Why is this patch needed ? It should not be needed at all ?
>

Sorry, I sent a wrong patch, please consider this new one in attachment.

My patch just fix wrong chars in the generated PDF, eg, before the apply
it, I got:

...
English: Hello, World!
Greek: Ge?? s?? ??s
Polish: Witaj swiecie
Portuguese: Ol? mundo
...

After apply it:

...
Languages: English: Hello, World!
Greek: Γειά σου κόσμος
Polish: Witaj świecie
Portuguese: Olá mundo
...

I needed to apply it even after update my FPC to rev. 33428.

In each case it will not be applied, since it assumes use of lazarus, and
> that is not acceptable in the FCL.


Indeed.

ps. about the hints/warnings, see the compiler log below:

Compile Project, Target: testfppdf.exe: Success, Warnings: 3, Hints: 4
fppdf.pp(1049,28) Hint: Local variable "Buffer" does not seem to be
initialized
fppdf.pp(1028,3) Note: Local variable "I" not used
fppdf.pp(3194,31) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(3195,35) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(808,44) Hint: Parameter "EmbeddedFontNum" not used
fppdf.pp(808,70) Hint: Parameter "FontDef" not used
fppdf.pp(3308,37) Warning: Implicit string type conversion with potential
data loss from "WideString" to "AnsiString"

-- 
Silvio Clécio


0001-fix-wrong-chars.patch
Description: Binary data
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Wed, 6 Apr 2016, silvioprog wrote:


On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt 
wrote:
[...]


Why is this patch needed ? It should not be needed at all ?



Sorry, I sent a wrong patch, please consider this new one in attachment.

My patch just fix wrong chars in the generated PDF, eg, before the apply
it, I got:


I see. I don't understand why this patch fixes it for you.

Because it means that somewhere a conversion happens that should not happen.


ps. about the hints/warnings, see the compiler log below:

Compile Project, Target: testfppdf.exe: Success, Warnings: 3, Hints: 4
fppdf.pp(1049,28) Hint: Local variable "Buffer" does not seem to be
initialized
fppdf.pp(1028,3) Note: Local variable "I" not used
fppdf.pp(3194,31) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(3195,35) Warning: Implicit string type conversion from
"AnsiString" to "WideString"
fppdf.pp(808,44) Hint: Parameter "EmbeddedFontNum" not used
fppdf.pp(808,70) Hint: Parameter "FontDef" not used
fppdf.pp(3308,37) Warning: Implicit string type conversion with potential
data loss from "WideString" to "AnsiString"


Maybe one of these string conversion warnings are the cause of the error.
I suspect the last one, actually, line 3308.

The other ones will be fixed too, of course.

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] TsWorkshetGrid isn't scrolling enough

2016-04-06 Thread Werner Pamler

Am 06.04.2016 um 19:34 schrieb Frans:

Hi.

Your demo works fine, so I will change my program.
I've noticed another point: on my computer is the fontsize and the row 
heigth greater in my program than in your demo.
I've tried changing the fontsize, in the object inspector and in the 
code, but that makes no difference.


I use this code in a much bigger program where also TStringGrids are 
used. There too is the fontsize bigger for the worksheetgrid then in 
the StringGrids. Why? I do not know.


So you are saying that the StringGrid scrolls correctly, the 
WorksheetGrid does not? No good for the WorksheetGrid, and hard to debug 
because I cannot reproduce the error...


Font size and row heights of the WorksheetGrid are controlled by 
settings in the file, not by Grid properties. Add the following lines to 
your code in Formshow after LoadfromSpreadsheetFile:


  sWorksheetGrid1.Workbook.SetDefaultFont('Calibri', 10);   // font 
name and font size in pts.

  sWorksheetGrid1.Worksheet.DefaultRowHeight := 1.0;   // units are lines

and play with the values to see if there are combinations for with the 
scrolling issue disappears. (The currently used value are DefaultFont = 
'Arial', 10-pt and DefaultRowHeight = 1.2)


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Jesus Reyes A.
On Wed, 06 Apr 2016 12:23:12 -0500, Graeme Geldenhuys  
 wrote:



On 2016-04-01 20:16, Jesus Reyes A. wrote:
(it seems currently is not necessary because the matrix is  
auto-adjusted)

and then ...

   P.WriteUTF8Text(15, 120, 'Languages: English: Hello, World!');
   P.WriteUTF8Text(40, 130, 'Greek: %1B-FÃåéÜ óïõ êüóìïò');
   P.WriteUTF8Text(40, 140, 'Polish: Witaj %1B-B¶wiecie');
   P.WriteUTF8Text(40, 150, 'Portuguese: Ol%1B-Aá mundo');

Of course, before DoUnitConversion(p1); there should be a
DoMatrixTransform(p1); etc.



This change has been made and will be available in FPC repo shortly.
Incidently, this drastically reduces the amount of application code and
makes it much neater. Something I like. :)


Regards,
  - Graeme -



;)

Thanks.

Jesus Reyes A.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Werner Pamler
Since some time, the TurtoiseSVN overlay icons of some of the packages 
which I loaded from svn have become practically useless. It is always 
the autogenerated package unit which is marked by a red overlay icon as 
being out of date. When I open the unit I see that the line


{$warn 5023 off : no warning about unused units}

has been added to the unit header. Deleting the unit, updating it from 
the svn repository fixes it for the moment, the "no warning about unused 
units" line is gone, and the overlay icon is green. But when I open the 
package and recompile it the line comes back, and the icon turns read again.


There must be something in my Lazarus settings which inserts this line.

Could anybody give me a hint where to look?

I am having this issue with Laz trunk / fpc 3.0 on Win7.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Graeme Geldenhuys
On 2016-04-06 22:31, Werner Pamler wrote:
> There must be something in my Lazarus settings which inserts this line.
> 
> Could anybody give me a hint where to look?

I see the same thing here with Lazarus v1.7. It is annoying for the SCM,
but I think I figured out the reasoning for that line. Lazarus packages
have somewhere a setting that says the unit managing the package must
(or mustn't) be added to the program using that package. I guess it
helps with forcing FPC to compile all units in question. I always delete
that, as I like my uses clause clean.

My suggestion (and personal solution) is to shy away from using packages
at all. I used to believe they were the best feature of Lazarus after I
moved from Delphi years back. I don't think that any more.

Project templates and macros in settings have simplified my life a lot.
My hard drives have plenty of space for non-shared [between projects]
compiled units too. Lazarus simply has too many "automated
functionality" these days that simply annoy.

Regards,
  - Graeme -


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Bart
On 4/6/16, Werner Pamler  wrote:

> {$warn 5023 off : no warning about unused units}
>
> has been added to the unit header. Deleting the unit, updating it from
> the svn repository fixes it for the moment, the "no warning about unused
> units" line is gone, and the overlay icon is green. But when I open the
> package and recompile it the line comes back, and the icon turns read
> again.

Had that before.
A clean build of Lazarus then fixed it, the lines were left in.
(Well, IIRC I had to do that twice for some, inexplainable reason it
didn't work the first time)

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Maxim Ganetsky

07.04.2016 0:31, Werner Pamler пишет:

Since some time, the TurtoiseSVN overlay icons of some of the packages
which I loaded from svn have become practically useless. It is always
the autogenerated package unit which is marked by a red overlay icon as
being out of date. When I open the unit I see that the line

{$warn 5023 off : no warning about unused units}


Which file gives you this warning?

--
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Maxim Ganetsky

07.04.2016 0:53, Graeme Geldenhuys пишет:

On 2016-04-06 22:31, Werner Pamler wrote:

There must be something in my Lazarus settings which inserts this line.

Could anybody give me a hint where to look?


I see the same thing here with Lazarus v1.7. It is annoying for the SCM,
but I think I figured out the reasoning for that line. Lazarus packages
have somewhere a setting that says the unit managing the package must
(or mustn't) be added to the program using that package. I guess it
helps with forcing FPC to compile all units in question. I always delete
that, as I like my uses clause clean.

My suggestion (and personal solution) is to shy away from using packages
at all. I used to believe they were the best feature of Lazarus after I
moved from Delphi years back. I don't think that any more.

Project templates and macros in settings have simplified my life a lot.
My hard drives have plenty of space for non-shared [between projects]
compiled units too. Lazarus simply has too many "automated
functionality" these days that simply annoy.


Are you really sure that this message is useful in this thread? Please 
stop this.


--
Best regards,
 Maxim Ganetsky  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Werner Pamler


Am 07.04.2016 um 00:42 schrieb Maxim Ganetsky:

Which file gives you this warning?

It is always the package unit - I don't know if this is the correct 
name, I mean the unit which has the same name as the lkp file and which 
is autocreated, its first lines say: "This file was automatically 
created by Lazarus. Do not edit!   This source is only used to compile 
and install the package."


I wonder, since this file is autocreated, why must it be under version 
control then?


Not all packages show this warning at the moment. But I must say that I 
did have the situation that all Lazarus packages in the components 
folder were "red". I could fix this by a clean install, just like Bart 
said. Now most (or all?) of the my third-party packages still have this 
issue: bgrabitmap, zeos, luipack, lazbarcodes, lclextensions, 
virtualtreeview_new etc.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] {$warn 5023 off: No warning about unused units}

2016-04-06 Thread Vojtěch Čihák

Here:
 
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packager/packagesystem.pas?root=lazarus&r1=51771&r2=51770&pathrev=51771
 
V.
__

Od: Maxim Ganetsky 
Komu: Lazarus mailing list 
Datum: 07.04.2016 01:13
Předmět: Re: [Lazarus] {$warn 5023 off: No warning about unused units}


07.04.2016 0:31, Werner Pamler пишет:

Since some time, the TurtoiseSVN overlay icons of some of the packages
which I loaded from svn have become practically useless. It is always
the autogenerated package unit which is marked by a red overlay icon as
being out of date. When I open the unit I see that the line

{$warn 5023 off : no warning about unused units}


Which file gives you this warning?

--
Best regards,
 Maxim Ganetsky                  mailto:gan...@narod.ru

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Jesus Reyes A.
En Wed, 06 Apr 2016 13:14:49 -0500, Michael Van Canneyt  
 escribió:





On Wed, 6 Apr 2016, silvioprog wrote:

On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt  


wrote:
[...]


Why is this patch needed ? It should not be needed at all ?



Sorry, I sent a wrong patch, please consider this new one in attachment.

My patch just fix wrong chars in the generated PDF, eg, before the apply
it, I got:


I see. I don't understand why this patch fixes it for you.

Because it means that somewhere a conversion happens that should not  
happen.




Here it fixes the problem too. So I did a small investigation and this is  
what I found:


The problem starts with this code:

procedure TPDFPage.AddTextToLookupLists(AText: UTF8String);
var
  str: UnicodeString;
begin
  if AText = '' then
Exit;
  str := UTF8ToUTF16(AText);
  Document.Fonts[FFontIndex].AddTextToMappingList(str);
end;

AText (a CP_UTF8 tagged string) is passed away to UTF8ToUTF16(AText) which  
expects a mere and mundane ansistring (to be used later as a pchar), the  
assembler window shows at what point the conversion is attempted:


C:\ThePathTo\fpctrunk\packages\fcl-pdf\src\fppdf.pp:1583  str :=  
UTF8ToUTF16(AText);

00435974 8b45fc   mov-0x4(%ebp),%eax
00435977 8d4dc8   lea-0x38(%ebp),%ecx
0043597A 66ba mov$0x0,%dx
0043597E e80d3dfdff   call   0x409690 
00435983 8b45c8   mov-0x38(%ebp),%eax
00435986 8d55f4   lea-0xc(%ebp),%edx
00435989 e8a286   call   0x43e030 

fpc_ansistr_to_ansistr converts AText from the given UTF8String to  
ansistring via RawbyteString. And it converts it to whatever  
DefaultSystemCodePage says it should. Now this is a problem because in  
Windows and according to the wiki this value is "The result of the GetACP  
OS call, which returns the Windows ANSI code page". In my case, and I  
guess Silvio's too, DefaultSystemCodePage=1252 not CP_UTF8, so in our case  
if AText is 'Greek: Γειά σου κόσμος' there will be problems converting  
that to CodePage=1252 which is solved by showing the "?" in the  
problematic characters


the SetMultiByteConversionCodePage(CP_UTF8) call makes  
DefaultSystemCodePage=CP_UTF8 which matches UTF8String and so in  
fpc_ansistr_to_ansistr no conversion is performed.


And so that is why SetMultiByteConversionCodePage(CP_UTF8) is needed when  
compiling in windows

:)

Jesus Reyes A.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Sven Barth
Am 07.04.2016 07:43 schrieb "Jesus Reyes A." :
>
> En Wed, 06 Apr 2016 13:14:49 -0500, Michael Van Canneyt <
mich...@freepascal.org> escribió:
>
>>
>>
>> On Wed, 6 Apr 2016, silvioprog wrote:
>>
>>> On Wed, Apr 6, 2016 at 2:14 PM, Michael Van Canneyt <
mich...@freepascal.org>
>>> wrote:
>>> [...]
>>>
 Why is this patch needed ? It should not be needed at all ?

>>>
>>> Sorry, I sent a wrong patch, please consider this new one in attachment.
>>>
>>> My patch just fix wrong chars in the generated PDF, eg, before the apply
>>> it, I got:
>>
>>
>> I see. I don't understand why this patch fixes it for you.
>>
>> Because it means that somewhere a conversion happens that should not
happen.
>>
>
> Here it fixes the problem too. So I did a small investigation and this is
what I found:
>
> The problem starts with this code:
>
> procedure TPDFPage.AddTextToLookupLists(AText: UTF8String);
> var
>   str: UnicodeString;
> begin
>   if AText = '' then
> Exit;
>   str := UTF8ToUTF16(AText);
>   Document.Fonts[FFontIndex].AddTextToMappingList(str);
> end;
>
> AText (a CP_UTF8 tagged string) is passed away to UTF8ToUTF16(AText)
which expects a mere and mundane ansistring (to be used later as a pchar),
the assembler window shows at what point the conversion is attempted:
>
> C:\ThePathTo\fpctrunk\packages\fcl-pdf\src\fppdf.pp:1583  str :=
UTF8ToUTF16(AText);
> 00435974 8b45fc   mov-0x4(%ebp),%eax
> 00435977 8d4dc8   lea-0x38(%ebp),%ecx
> 0043597A 66ba mov$0x0,%dx
> 0043597E e80d3dfdff   call   0x409690 
> 00435983 8b45c8   mov-0x38(%ebp),%eax
> 00435986 8d55f4   lea-0xc(%ebp),%edx
> 00435989 e8a286   call   0x43e030 
>
> fpc_ansistr_to_ansistr converts AText from the given UTF8String to
ansistring via RawbyteString. And it converts it to whatever
DefaultSystemCodePage says it should. Now this is a problem because in
Windows and according to the wiki this value is "The result of the GetACP
OS call, which returns the Windows ANSI code page". In my case, and I guess
Silvio's too, DefaultSystemCodePage=1252 not CP_UTF8, so in our case if
AText is 'Greek: Γειά σου κόσμος' there will be problems converting that to
CodePage=1252 which is solved by showing the "?" in the problematic
characters
>
> the SetMultiByteConversionCodePage(CP_UTF8) call makes
DefaultSystemCodePage=CP_UTF8 which matches UTF8String and so in
fpc_ansistr_to_ansistr no conversion is performed.
>
> And so that is why SetMultiByteConversionCodePage(CP_UTF8) is needed when
compiling in windows
> :)

UTF8ToUTF16 should best take a UTF8String then. It would fit the purpose of
the function better anyway...

Regards,
Sven
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] PDF generator, try 2

2016-04-06 Thread Michael Van Canneyt



On Thu, 7 Apr 2016, Sven Barth wrote:



the SetMultiByteConversionCodePage(CP_UTF8) call makes

DefaultSystemCodePage=CP_UTF8 which matches UTF8String and so in
fpc_ansistr_to_ansistr no conversion is performed.


And so that is why SetMultiByteConversionCodePage(CP_UTF8) is needed when

compiling in windows

:)


UTF8ToUTF16 should best take a UTF8String then. It would fit the purpose of
the function better anyway...


This should not exist to begin with, I think. 
The UTF8Decode function of the system unit performs the same function.


Jesus, thank you for looking into this, we'll get to work with it !

Michael.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus