Recent

Author Topic: pl_BGRAueControls  (Read 6839 times)

seghele0

  • Full Member
  • ***
  • Posts: 106
pl_BGRAueControls
« on: December 08, 2021, 05:11:21 pm »
Got a program from a friend, made with CodeTyphon.
The component pl_bgrauecontrols is used insite.
Is there a way to solve this in Lazarus?
I've the CT component in "ctpkg" format.
 8)
Would like to convert this program to Lazarus, if possible.



wp

  • Hero Member
  • *****
  • Posts: 9158
Re: pl_BGRAueControls
« Reply #1 on: December 08, 2021, 05:25:12 pm »
I think this is the CodeTyphon version of the ueControls which have their original site at https://github.com/mriscoc/uEControls. Could be, because they also build upon BGRA. So, please try the original site which is for Lazarus.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #2 on: December 08, 2021, 05:56:08 pm »
Thank you for the support.
 ;)

winni

  • Hero Member
  • *****
  • Posts: 2850
Re: pl_BGRAueControls
« Reply #3 on: December 08, 2021, 07:18:14 pm »
Hi!

If you want to get rid off the Code-Typhon stuff then replace it with the original ueControls:


https://sourceforge.net/projects/uecontrols/

Winni

PS.: In 1972 there was a song by the New Seekers: "Beg, Steal and Borrow". Should be dedicated to Code Typhon
« Last Edit: December 08, 2021, 07:21:05 pm by winni »

wp

  • Hero Member
  • *****
  • Posts: 9158
Re: pl_BGRAueControls
« Reply #4 on: December 08, 2021, 07:33:14 pm »
They moved to github (see link in my post above) where there is version 6.5 while the sourceforge version is 6.1.x only.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

avra

  • Hero Member
  • *****
  • Posts: 2291
    • Additional info
Re: pl_BGRAueControls
« Reply #5 on: December 09, 2021, 12:47:14 am »
ct2laz from my signature should ease your project conversion process to Lazarus and ueControls.
More info: https://forum.lazarus.freepascal.org/index.php/topic,28897.0.html

I would always vote for conversion to ueControls, but if there is any reason you want to use pl_BGRAueControls, you can use ct4laz to build Lazarus version of that one and depending packages that CT team has repacked.
More info: https://forum.lazarus.freepascal.org/index.php/topic,39508.0.html
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #6 on: December 09, 2021, 09:19:56 am »
Thanks everyone.
 ;)
Give me a moment (a few days) to check everything.
I'll certainly share the result.


seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #7 on: December 09, 2021, 03:08:11 pm »
Was able to start 'ct2laz.exe' with 'Replacements.csv'.
Please explain more about the 'settings'.
First line: Download / Extract / Project.
Then a list from 1) to 6) and maybe more, but not visible.
Which checkboxes should I activate (all)?
 :-[



seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #8 on: December 10, 2021, 04:19:10 pm »
Have been able to perform the conversion of three CT programs to Lazaus.

But, I don't get an "lpr" but a "pas" !!!

The compiler works, and the 'exe' is OK.
 ;)
The CT2LAZ program is a wonderful tool.
I'm staying with Lazarus now.
THANK YOU.
 :)

avra

  • Hero Member
  • *****
  • Posts: 2291
    • Additional info
Re: pl_BGRAueControls
« Reply #9 on: December 12, 2021, 12:26:23 pm »
I don't get an "lpr" but a "pas" !!!
If you have found an unexpected behavior then please report it either in forum topic or on bitbucket. I need detailed steps to reproduce the bug, or an example project where it shows (if it is not always reproducible).

The CT2LAZ program is a wonderful tool.
I'm staying with Lazarus now.
THANK YOU.
 :)
I'm glad it helped. Have fun!
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

wp

  • Hero Member
  • *****
  • Posts: 9158
Re: pl_BGRAueControls
« Reply #10 on: December 12, 2021, 12:58:31 pm »
But, I don't get an "lpr" but a "pas" !!!
Giving the "program" file ("program" in the first line) the .lpr extension is only a Lazarus convention; it can be .pas or .pp or .p equally well.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #11 on: December 12, 2021, 04:35:44 pm »
Hero Member.
First part.

seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #12 on: December 12, 2021, 04:42:56 pm »
Hero Member.
Part 2 : DBData and Sqlite3.ddl are to big for attachment.
 :(

wp

  • Hero Member
  • *****
  • Posts: 9158
Re: pl_BGRAueControls
« Reply #13 on: December 12, 2021, 05:34:12 pm »
The files in your temp.zip seem to belong to a CodeTyphon project. I never worked with avra's conversion program, he certainly can help you with that. I can only give you ideas how to convert the project manually:
  • Looking into DBdata64T.ctpr using an external editor, I see something which looks like a Lazarus lpi file - so, rename it to DBdata64T.lpi
  • DBdata64T.ctps is the session file. It is not needed at all to run a foreign project - ignore it, it will not be used by Lazarus (or delete it).
  • DBdata64T.pas is the program file (see the first line?). Since Lazarus is happy with pas program files, keep its name (If you'd change it you'd have to adapt the lpi file). There is one problem, though: it mentions unit lz_datetimectrls in the uses clause - this is not a Lazarus unit. But it is not needed by the program file anyway, so there is no need to have it here. --> comment lz_datetimectrls out.
  • The *.lrf files seem to belong to LazReport. I don't have much experience with it, but I think it is not harmful for a first start to have them here even if something's wrong with them --> keep them unchanged.
  • There is probably still an issue with form files which are renamed by CodeTyphon to have extension .frm rather than .lfm. But maybe it is a good point now to try to load the project into Lazarus and to see what happens. Hmmm, there is a list of packages which are not found: lz_datetimectrls, pl_fortesreport, lz_rtticontrols, lz_printers, lz_report, lz_sqlite3, adFCL, lz_sqldb, adLCL. To fix these open the lpi file in an external editor and scroll down to the node "RequiredPackages" and make the following replacements in the "PackageName" nodes:
      - lz_datetimectrls --> datetimectrls
      - pl_fortesreport --> fortes324laz
      - lz_rtticontrols --> runtimetypeinfocontrols
      - lz_printers --> printer4lazarus
      - lz_report --> lazreport
      - lz_sqlite3  --> sqlite3laz
      - adFCL --> FCL
      - lz_sqldb --> sqldblaz
      - adLCL --> LCL
    I found the replacement names by looking at the menu "Package" > "Install/Uninstall packages" and at the Online-Package-Manager. After these changes, the project can be loaded into Lazarus successfully.
  • Trying to compile... Error: "udata.pas(77,1) Error: Error while compiling resources -> Compile with -vd for more details. Check for duplicates." To be honest, I don't understand what is meant here, but mentioning "resources" is a hint that Lazarus does not like the .frm extension which CodeTyphon uses for Lazarus forms (instead of .lfm). So, rename all .frm file to extension .lfm, and in the associated .pas files find the line {$R *.frm} and replace it by {$R *.lfm}.
  • After these changes the project compiles. There is a run-time error for me, probably because not all files are included in the zip, or I am missing some lib (never worked with FortesReport, so far). But at least this is a point where you can continue yourself.
I am attaching the files that I modified. But I urge you to follow the steps that I wrote down for you and to see yourself what happens. It's a good learning experience for the files used by Lazarus.

« Last Edit: December 12, 2021, 05:38:13 pm by wp »
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

seghele0

  • Full Member
  • ***
  • Posts: 106
Re: pl_BGRAueControls
« Reply #14 on: December 12, 2021, 06:26:58 pm »
WP
Thank you very, very sincerely for your explanation.
The 'dll' and 'db' are to large foor attachment.
It's a lot of work for my level, but I'll definitely try it out.
But, learning is always a noble fact.
Will let you know the result....
 ;)

 

TinyPortal © 2005-2018