Recent

Author Topic: Error compiling TAPrint.pas inside project...  (Read 12211 times)

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Error compiling TAPrint.pas inside project...
« on: April 28, 2011, 08:45:47 am »
Hi,

I'm using TPrinterDrawer from TAPrint in code:

Code: [Select]
procedure TForm1.Button3Click(Sender: TObject);
   const
  MARGIN = 10;
var
  r: TRect;
  d: Integer;
begin
  if not PrintDialog1.Execute then exit;
  Printer.BeginDoc;
  try
    r := Rect(0, 0, Printer.PageWidth, Printer.PageHeight );
    d := r.Right - r.Left;
    r.Left += d div MARGIN;
    r.Right -= d div MARGIN;
    d := r.Bottom - r.Top;
    r.Top += d div MARGIN;
    r.Bottom -= d div MARGIN;

    Chart1.Draw(TPrinterDrawer.Create(Printer), r);
  finally
    Printer.EndDoc;
  end;
end;                       

So I use taprint unit, but when I compile whole project, I got an error:
Quote
taprint.pas(29,39) Error: Identifier not found "TCanvasDrawer"
taprint.pas(29,39) Error: class type expected, but got "<erroneous type>"
taprint.pas(35,14) Error: There is no method in an ancestor class to be overridden: "TPrinterDrawer.Scale(LongInt):LongInt;"

Can anyone help?

Adam

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Error compiling TAPrint.pas inside project...
« Reply #1 on: April 28, 2011, 04:53:08 pm »
Please try r30496

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #2 on: April 29, 2011, 08:16:15 am »
I have update and recompile Lazarus from svn r30505 - the same Error still exist.
I don't know, ho to sync with some revision number other than newest one.
I'm using just
Code: [Select]
svn co command.
Please help.

Adam
« Last Edit: April 29, 2011, 08:28:35 am by abix_adamj_pl »

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: Error compiling TAPrint.pas inside project...
« Reply #3 on: April 29, 2011, 12:20:08 pm »
you can use
Code: [Select]
svn update -r{revisionnumber}
ie:
svn update -r30504
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Error compiling TAPrint.pas inside project...
« Reply #4 on: April 29, 2011, 01:46:19 pm »
Are you using trunk or fixes branch?
« Last Edit: April 29, 2011, 10:26:23 pm by Ask »

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #5 on: April 29, 2011, 09:08:26 pm »
I don't know, what does it mean. Sorry, forgive me, I'm just a beginner in Lazarus and things like fixes branch - it is not my world ;-)

But,, if you could say more clear or give me some command I coud execute to show, what I'm using, I'll do it.

Adam

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Error compiling TAPrint.pas inside project...
« Reply #6 on: April 29, 2011, 10:27:08 pm »
what does "svn info" say?

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #7 on: April 30, 2011, 06:35:35 pm »
It said (pl_PL):

Code: [Select]
adasiek@sea-star:~/SVN/lazarus$ svn info
Ścieżka: .
URL: http://svn.freepascal.org/svn/lazarus/trunk
Katalog główny repozytorium: http://svn.freepascal.org/svn/lazarus
UUID repozytorium: 4005530d-fff6-0310-9dd1-cebe43e6787f
Wersja: 30505
Rodzaj obiektu: katalog
Zlecenie: normalne
Autor ostatniej zmiany: maxim
Ostatnio zmieniona wersja: 30505
Data ostatniej zmiany: 2011-04-29 00:41:16 +0200 (pią)


Now I'll try to rever to r30496 - done, a lot of files updated...

Adam
« Last Edit: April 30, 2011, 06:37:32 pm by abix_adamj_pl »

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #8 on: April 30, 2011, 06:43:59 pm »
Code: [Select]
adasiek@sea-star:~/SVN/lazarus$ svn info
Ścieżka: .
URL: http://svn.freepascal.org/svn/lazarus/trunk
Katalog główny repozytorium: http://svn.freepascal.org/svn/lazarus
UUID repozytorium: 4005530d-fff6-0310-9dd1-cebe43e6787f
Wersja: 30496
Rodzaj obiektu: katalog
Zlecenie: normalne
Autor ostatniej zmiany: ask
Ostatnio zmieniona wersja: 30496
Data ostatniej zmiany: 2011-04-28 16:49:26 +0200 (czw)

The same Error: taprint.pas(29,39) Error: Identifier not found "TCanvasDrawer"

Can anyone knows maybe email to Alexander Klenin ?

Adam

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Error compiling TAPrint.pas inside project...
« Reply #9 on: April 30, 2011, 07:18:45 pm »
Ok, you seem to have the right version.

Please try the following:
1) Clear "lib" subdirectory in the printdemo, then recompile
2) If the above does not help, verify that "uses" clause of TAPrint unit
contains TADrawerCanvas unit -- TCanvasDrawer is defined there.

Quote
Can anyone knows maybe email to Alexander Klenin ?
I am Alexander Klenin. Although I do prefer email for communication,
most users seem to like the forum -- so I have given up on that :)

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #10 on: May 01, 2011, 12:00:07 am »
Thanks a lot, I'll try this after 5 days, because I'm going for little vacation.

Adam

abix_adamj_pl

  • New Member
  • *
  • Posts: 18
Re: Error compiling TAPrint.pas inside project...
« Reply #11 on: May 01, 2011, 01:06:48 pm »
Dear ask,

works perfectly, when I add in uses:   taprint and tadrawercanvas.

But I've some other question - I need to copy   taprint.pas and tadrawercanvas.pas to directory, in wich I have source of my app. I've been trying to add in uses some kind of path, like:
a) components/tachart/taprint
b) /home/adasiek/SVN/lazarus/components/tachart/taprint

but both does not work. Is there any possibility to use modules without need to copy theme every time I will update SVN ?

Adam

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Error compiling TAPrint.pas inside project...
« Reply #12 on: May 02, 2011, 11:20:14 am »
Since r30525, you can add TAChartPrint package to your project's dependencies,
and everything should work.
(Just remember to clear object files before first recompilation).

 

TinyPortal © 2005-2018