Re: [Lazarus] Converting all code to use UnicodeString

2017-09-27 Thread Graeme Geldenhuys via Lazarus

On 2017-09-27 03:51, Marcos Douglas B. Santos via Lazarus wrote:

A constant that
can change...



Yeah, that concept still blows my mind. [figuratively speaking] They 
should shoot the developer that came up with that idea - and the team 
leader that approved it.


Regards,
  Graeme

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


Re: [Lazarus] Converting all code to use UnicodeString

2017-09-27 Thread Juha Manninen via Lazarus
On Tue, Sep 26, 2017 at 10:52 PM, Marcos Douglas B. Santos via Lazarus
 wrote:
> So we can say that Lazarus code do not use XPath to work with XML, right?

No I cannot say much about the issue. I didn't try it myself.
I understood Mattias and Michael V.C. have plans to migrate the XML
units to FCL sources. Maybe they can elaborate.

> I don't use it. (Windows codepages)

Ok, then I misunderstood.  :)

About the string constant concatenation, just use variables when it is proper:
const
  V1: string = 'a';
var
  S1: String;
... later in code ...
  S1 := V1 + 'b';

String literals can be assigned without problems as long as your
variables are "String".
The big table in the wiki page is intimidating, in reality the issue
is not so complex.


On Tue, Sep 26, 2017 at 7:29 PM, zeljko  wrote:
> POS receipt printers :)

Ok maybe. I don't have one, difficult to say.

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


Re: [Lazarus] fpReport - can not render pagefooter

2017-09-27 Thread Graeme Geldenhuys via Lazarus

On 2017-09-27 09:38, Andreas Frieß via Lazarus wrote:

What is my mistake of understanding ?


You made a couple of mistakes and highlighted a bug in the PDF exporter.

Mistakes:

1.  You never registered the standard page sizes with:
 PaperManager.RegisterStandardSizes;

2.  Your report used LiberationSans font. Make sure you added
the search paths to the font cache. eg:

  {$IFDEF UNIX}
gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/');

gTTFontCache.SearchPath.Add('/data/devel/Wisa/fonts/Liberation/');
  {$ENDIF}

3.  You positioned a lot of reporting elements overlapping each
other. Correct positioning will help you see things better. ;-)


Bug:

   The PDF exporter didn't handle Page.Orientation of Landscape
   correctly, and rendered such pages from the bottom upwards.
   I supplied a patch to FPC's Mantis so hopefully Michael or
   somebody could commit that soon.

  https://bugs.freepascal.org/view.php?id=32478


After all that, the report renders just fine.


ps:
  Note that I compiled your project using the latest fpReport from
  FPC Trunk. I simply set the correct Unit Source Path in the project.
  You don't need to use FPC Trunk compiler - I used FPC 2.6.4.


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-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] fpReport - can not render pagefooter

2017-09-27 Thread Michael Van Canneyt via Lazarus



On Wed, 27 Sep 2017, Graeme Geldenhuys via Lazarus wrote:


On 2017-09-27 09:38, Andreas Frieß via Lazarus wrote:

What is my mistake of understanding ?


You made a couple of mistakes and highlighted a bug in the PDF exporter.

Mistakes:

1.  You never registered the standard page sizes with:
 PaperManager.RegisterStandardSizes;

2.  Your report used LiberationSans font. Make sure you added
the search paths to the font cache. eg:

  {$IFDEF UNIX}
gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/');

gTTFontCache.SearchPath.Add('/data/devel/Wisa/fonts/Liberation/');
  {$ENDIF}

3.  You positioned a lot of reporting elements overlapping each
other. Correct positioning will help you see things better. ;-)


Bug:

   The PDF exporter didn't handle Page.Orientation of Landscape
   correctly, and rendered such pages from the bottom upwards.
   I supplied a patch to FPC's Mantis so hopefully Michael or
   somebody could commit that soon.

  https://bugs.freepascal.org/view.php?id=32478


After all that, the report renders just fine.


Patch Applied, thanks for the fix!

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


Re: [Lazarus] fpReport - can not render pagefooter

2017-09-27 Thread Andreas Frieß via Lazarus

THX Graeme

In windows this is possible and running: -> I have my sample extended

procedure TForm1.FormActivate(Sender: TObject);
begin
  if not FInit then begin
    gTTFontCache.ReadStandardFonts;
    gTTFontCache.BuildFontCache;
    if PaperManager.PaperCount=0 then
  PaperManager.RegisterStandardSizes;
    FInit:= true;
  end;
end;

The problem with fontcache, is not (maybe direct) visible in the demo on 
FPReport Usage.


BTW: point 3 -> the code is copied direct from the 'designer' :-) not 
made on my own - lol.


Bugreport for the designer problem with orientation is 32470, i will 
check this and close if running.


Andreas


Am 27.09.2017 um 12:50 schrieb Graeme Geldenhuys via Lazarus:

On 2017-09-27 09:38, Andreas Frieß via Lazarus wrote:

What is my mistake of understanding ?


You made a couple of mistakes and highlighted a bug in the PDF exporter.

Mistakes:

1.  You never registered the standard page sizes with:
 PaperManager.RegisterStandardSizes;

2.  Your report used LiberationSans font. Make sure you added
    the search paths to the font cache. eg:

  {$IFDEF UNIX}
    gTTFontCache.SearchPath.Add(GetUserDir + '.fonts/');

gTTFontCache.SearchPath.Add('/data/devel/Wisa/fonts/Liberation/');
  {$ENDIF}

3.  You positioned a lot of reporting elements overlapping each
    other. Correct positioning will help you see things better. ;-)


Bug:

   The PDF exporter didn't handle Page.Orientation of Landscape
   correctly, and rendered such pages from the bottom upwards.
   I supplied a patch to FPC's Mantis so hopefully Michael or
   somebody could commit that soon.

  https://bugs.freepascal.org/view.php?id=32478


After all that, the report renders just fine.


ps:
  Note that I compiled your project using the latest fpReport from
  FPC Trunk. I simply set the correct Unit Source Path in the project.
  You don't need to use FPC Trunk compiler - I used FPC 2.6.4.


Regards,
  Graeme



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


Re: [Lazarus] Converting all code to use UnicodeString

2017-09-27 Thread Marcos Douglas B. Santos via Lazarus
On Wed, Sep 27, 2017 at 5:16 AM, Graeme Geldenhuys via Lazarus
 wrote:
> On 2017-09-27 03:51, Marcos Douglas B. Santos via Lazarus wrote:
>>
>> A constant that
>> can change...
>
>
>
> Yeah, that concept still blows my mind. [figuratively speaking] They should
> shoot the developer that came up with that idea - and the team leader that
> approved it.

Everybody has crazy ideias... the problem is who sign them saying
"yeah, go ahead!" :)

Regards,
Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Converting all code to use UnicodeString

2017-09-27 Thread Marcos Douglas B. Santos via Lazarus
On Wed, Sep 27, 2017 at 7:05 AM, Juha Manninen via Lazarus
 wrote:
> On Tue, Sep 26, 2017 at 10:52 PM, Marcos Douglas B. Santos via Lazarus
> [...]
> About the string constant concatenation, just use variables when it is proper:
> const
>   V1: string = 'a';
> var
>   S1: String;
> ... later in code ...
>   S1 := V1 + 'b';
>
> String literals can be assigned without problems as long as your
> variables are "String".
> The big table in the wiki page is intimidating, in reality the issue
> is not so complex.

I'm already doing that.
This not perfect, but is better than have problems. Thanks.

Best regards,
Marcos Douglas
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus