You've already forked lazarus-ccr
20080301 release: Minor adjustments to converters; expanded notes to help users who are new to Lazarus.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@366 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -14,6 +14,13 @@ program CvtHelp;
|
|||||||
License: Modified LGPL.
|
License: Modified LGPL.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
Classes;
|
Classes;
|
||||||
|
@ -13,6 +13,10 @@ unit RtfDoc;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
RtfPars;
|
RtfPars;
|
||||||
|
@ -4,6 +4,13 @@ program TestRtfDoc;
|
|||||||
Test program for RtfDoc unit.
|
Test program for RtfDoc unit.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
RtfPars, {Free Pascal unit with TRtfParser class and rtf constants}
|
RtfPars, {Free Pascal unit with TRtfParser class and rtf constants}
|
||||||
|
@ -15,6 +15,10 @@ unit ViewDoc;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
Classes,
|
Classes,
|
||||||
|
@ -4,6 +4,13 @@ program ViewWith;
|
|||||||
Test program for ViewDoc unit.
|
Test program for ViewDoc unit.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
ViewDoc;
|
ViewDoc;
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
<HR>
|
<HR>
|
||||||
<H3>Contents</H3>
|
<H3>Contents</H3>
|
||||||
|
<A HREF="#Whats_New">What's New</A><BR>
|
||||||
<A HREF="#Introduction">Introduction</A><BR>
|
<A HREF="#Introduction">Introduction</A><BR>
|
||||||
<A HREF="#Installation">Installation</A><BR>
|
<A HREF="#Installation">Installation</A><BR>
|
||||||
<A HREF="#CodeConverters">MakePasX & DfmToLfm: Delphi converters</A><BR>
|
<A HREF="#CodeConverters">MakePasX & DfmToLfm: Delphi converters</A><BR>
|
||||||
@ -27,6 +28,17 @@
|
|||||||
<A HREF="#To_Do">To Do</A><BR>
|
<A HREF="#To_Do">To Do</A><BR>
|
||||||
<A HREF="#Other_Resources">Other Resources</A><P>
|
<A HREF="#Other_Resources">Other Resources</A><P>
|
||||||
|
|
||||||
|
<HR>
|
||||||
|
<A name="Whats_New"></A><H3>What's New</H3>
|
||||||
|
|
||||||
|
<UL>
|
||||||
|
<LI>20080301 release:
|
||||||
|
<UL>
|
||||||
|
<LI>Expanded notes to help users who are new to Lazarus.
|
||||||
|
<LI>Minor adjustments to converters to keep pace with latest Lazarus.
|
||||||
|
</UL>
|
||||||
|
</UL>
|
||||||
|
|
||||||
<HR>
|
<HR>
|
||||||
<A name="Introduction"></A><H3>Introduction</H3>
|
<A name="Introduction"></A><H3>Introduction</H3>
|
||||||
|
|
||||||
@ -42,6 +54,12 @@ and suggestions to be seen by the entire Lazarus community.<P>
|
|||||||
|
|
||||||
The XDev Toolkit source code is here: <A HREF="http://web.fastermac.net/~MacPgmr/XDev/downloads">http://web.fastermac.net/~MacPgmr/XDev/downloads</A><P>
|
The XDev Toolkit source code is here: <A HREF="http://web.fastermac.net/~MacPgmr/XDev/downloads">http://web.fastermac.net/~MacPgmr/XDev/downloads</A><P>
|
||||||
|
|
||||||
|
You can also download the XDev Toolkit files via Subversion:<P>
|
||||||
|
|
||||||
|
svn co https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/xdev_toolkit [local dir]<P>
|
||||||
|
|
||||||
|
Substitute your local directory where you want the files downloaded for "[local dir]".<P>
|
||||||
|
|
||||||
All source code included in the XDev Toolkit is released under the Modified LGPL license.
|
All source code included in the XDev Toolkit is released under the Modified LGPL license.
|
||||||
|
|
||||||
<HR>
|
<HR>
|
||||||
@ -49,15 +67,23 @@ All source code included in the XDev Toolkit is released under the Modified LGPL
|
|||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
<LI>Unzip the source files into their own folder.<P>
|
<LI>Unzip the source files into their own folder.<P>
|
||||||
<LI>Open a terminal window and compile each utility and test program with FPC.
|
<LI>Open a terminal window and change to this folder, then compile each utility and test program with FPC.
|
||||||
For example:<P>
|
For example:<P>
|
||||||
|
|
||||||
fpc -Sd DfmToLfm.pas
|
With Free Pascal:<P>
|
||||||
|
|
||||||
|
fpc dfmtolfm<P>
|
||||||
|
|
||||||
|
With Delphi:<P>
|
||||||
|
|
||||||
|
dcc32 dfmtolfm<P>
|
||||||
|
|
||||||
<LI>To see a utility's syntax, simply run it in a terminal window
|
<LI>To see a utility's syntax, simply run it in a terminal window
|
||||||
without any parameters or switches. For example:<P>
|
without any parameters or switches. For example:<P>
|
||||||
|
With Windows:<P>
|
||||||
dfmtolfm
|
dfmtolfm<P>
|
||||||
|
With OS X and Linux:<P>
|
||||||
|
./dfmtolfm
|
||||||
|
|
||||||
</OL>
|
</OL>
|
||||||
|
|
||||||
@ -73,23 +99,59 @@ and .pas). The DfmToLfm utility is used to create Lazarus form design files
|
|||||||
Once you've converted a Delphi app to Lazarus you can continue to
|
Once you've converted a Delphi app to Lazarus you can continue to
|
||||||
develop the app with Delphi on Windows and use Lazarus to compile
|
develop the app with Delphi on Windows and use Lazarus to compile
|
||||||
the app on other platforms. This type of app can provide the best of both
|
the app on other platforms. This type of app can provide the best of both
|
||||||
worlds: taking advantage of the Windows-specific features of Delphi while
|
worlds: taking advantage of the speed, stability and Windows-specific features
|
||||||
utilizing Free Pascal and Lazarus to add cross-platform capability to the app.
|
of Delphi while utilizing Free Pascal and Lazarus to add cross-platform capability
|
||||||
|
to the app.
|
||||||
|
|
||||||
<OL>
|
<OL>
|
||||||
|
<LI>Make a copy of the Delphi files you want to convert in a different directory
|
||||||
|
since MakePasX will alter the source code files.<P>
|
||||||
|
|
||||||
<LI>Use the MakePasX utility to make the Delphi project file (.dpr) and form
|
<LI>Use the MakePasX utility to make the Delphi project file (.dpr) and form
|
||||||
code files (.pas) cross-platform. This is a one-time conversion that results
|
code files (.pas) cross-platform. This is a one-time conversion that results
|
||||||
in a set of source files that can be compiled by both Delphi and Lazarus.<P>
|
in a set of source files that can be compiled by both Delphi and Lazarus.
|
||||||
<LI>Use the DfmToLfm utility to create Lazarus form files (.lfm) from the Delphi
|
Examples:<P>
|
||||||
form files (.dfm).<P>
|
makepasx myprogram.dpr<BR>
|
||||||
<LI>Use the Lazarus lazres utility to create the Lazarus resource file (.lrs)
|
makepasx myform.pas<P>
|
||||||
from the form file (.lfm) Repeat steps 2 and 3 whenever you make changes
|
MakePasX tries to insert the conditionals needed to compile with Lazarus, while
|
||||||
to the Delphi form files. If your project has a number of forms, run these
|
retaining compatibility with Delphi. After converting you can test to see that
|
||||||
utilities for each form in a batch or shell file to automate the conversion.<P>
|
the files can still be compiled by Delphi. You may have to make minor manual adjustments
|
||||||
<LI>Compile the resulting files with Lazarus on Windows
|
if the converter couldn't figure out your code. Also, you can look at the source
|
||||||
|
code of the converter to see what it's doing.<P>
|
||||||
|
|
||||||
|
<LI>Use the DfmToLfm utility to create a Lazarus form file (.lfm) from each Delphi
|
||||||
|
form file (.dfm). Example:<P>
|
||||||
|
dfmtolfm myform.dfm<P>
|
||||||
|
This creates an .lfm file that should be compatible with Lazarus. With Linux you
|
||||||
|
can use the -d switch to delete the font names from the .lfm file. This generally
|
||||||
|
makes for a better look on Linux, which doesn't have the same TrueType fonts that
|
||||||
|
Windows and OS X have. Default fonts will be substituted at runtime. With Windows
|
||||||
|
you can use the -p switch to add a parent's font to controls with no font,
|
||||||
|
which generally makes for a better look on Windows.<P>
|
||||||
|
Important! Make sure your .dfm files are text files. If not, save them as text
|
||||||
|
files with Delphi before attempting to convert them.<P>
|
||||||
|
|
||||||
|
<LI>Use the Lazarus LazRes utility to create a Lazarus resource file (.lrs)
|
||||||
|
from each form file (.lfm). Example:<P>
|
||||||
|
lazres myform.lrs myform.lfm<P>
|
||||||
|
Note: The lazres source code is located in the Lazarus tools folder. Open
|
||||||
|
project file lazres.lpi in Lazarus and compile it in the IDE.<P>
|
||||||
|
|
||||||
|
<LI>Repeat steps 3 and 4 whenever you make changes to the Delphi form files.
|
||||||
|
If your project has a number of forms, run DfmToLfm and LazRes
|
||||||
|
for each form in a batch or shell file to automate the conversion.<P>
|
||||||
|
|
||||||
|
<LI>Open the converted .dpr file with Lazarus and allow it to create a project
|
||||||
|
file (.lpi), then compile the project with Lazarus
|
||||||
to test the converted code and form files.<P>
|
to test the converted code and form files.<P>
|
||||||
<LI>Move the Lazarus project's files over to OS X or Linux and compile and
|
|
||||||
test them there with that platform's version of Lazarus.
|
Tip: If you run your Lazarus-compiled app and get an error message about an unknown
|
||||||
|
property, that probably means you need to add this property to the [DeleteProps]
|
||||||
|
section of dfmtolfm.ini file and rerun DfmToLfm on the .dfm file. Not all VCL components
|
||||||
|
have been tested with DfmToLfm.<P>
|
||||||
|
|
||||||
|
<LI>Move the Lazarus project's files over to other platforms and compile and
|
||||||
|
test them there with those platforms' version of Lazarus.
|
||||||
</OL>
|
</OL>
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +247,8 @@ which introduces a TRtfParser descendant, TRtfDoc, which can be used
|
|||||||
to create RTF files without knowing how TRtfParser works. For information
|
to create RTF files without knowing how TRtfParser works. For information
|
||||||
on how to use it, look at the RtfDoc.pas file and TestRtfDoc.pas example
|
on how to use it, look at the RtfDoc.pas file and TestRtfDoc.pas example
|
||||||
program. You'll also want to look at the Free Pascal rtfdata.inc file for
|
program. You'll also want to look at the Free Pascal rtfdata.inc file for
|
||||||
a list of constants that you'll need to use with TRtfDoc.<P>
|
a list of constants that you'll need to use with TRtfDoc (rtfdata.inc is
|
||||||
|
in Free Pascal's /packages/fcl-base/src/inc folder).<P>
|
||||||
|
|
||||||
For more information on the RTF specification, refer to Microsoft's documentation.<P>
|
For more information on the RTF specification, refer to Microsoft's documentation.<P>
|
||||||
|
|
||||||
@ -278,7 +341,7 @@ also be able to output version information to a Lazarus .lpi file.<P>
|
|||||||
<A HREF="http://wiki.lazarus.freepascal.org/Deploying_Your_Application">http://wiki.lazarus.freepascal.org/Deploying_Your_Application</A><P>
|
<A HREF="http://wiki.lazarus.freepascal.org/Deploying_Your_Application">http://wiki.lazarus.freepascal.org/Deploying_Your_Application</A><P>
|
||||||
<P>
|
<P>
|
||||||
<HR>
|
<HR>
|
||||||
Last updated: April 15, 2007
|
Last updated: March 1, 2008
|
||||||
<P>
|
<P>
|
||||||
|
|
||||||
</BODY>
|
</BODY>
|
||||||
|
@ -24,6 +24,7 @@ HideSelection=
|
|||||||
ImeMode=
|
ImeMode=
|
||||||
ImeName=
|
ImeName=
|
||||||
OEMConvert=
|
OEMConvert=
|
||||||
|
TextHeight=
|
||||||
TRadioGroup.TabOrder=
|
TRadioGroup.TabOrder=
|
||||||
TBitBtn.ParentFont=
|
TBitBtn.ParentFont=
|
||||||
TCheckBox.Font.Charset=
|
TCheckBox.Font.Charset=
|
||||||
@ -105,3 +106,4 @@ TOvcTCCheckBox=
|
|||||||
TOvcTCBitmap=
|
TOvcTCBitmap=
|
||||||
TOvcTCGlyphs=
|
TOvcTCGlyphs=
|
||||||
TOvcTCIcon=
|
TOvcTCIcon=
|
||||||
|
TWPRichText=
|
@ -19,13 +19,20 @@ program DfmToLfm;
|
|||||||
License: Modified LGPL.
|
License: Modified LGPL.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
IniFiles;
|
IniFiles;
|
||||||
|
|
||||||
const
|
const
|
||||||
ProgramName = 'DfmToLfm';
|
ProgramName = 'DfmToLfm';
|
||||||
ProgramVersion = '0.01';
|
ProgramVersion = '0.02';
|
||||||
|
|
||||||
DfmFileExt = '.dfm'; {Delphi form file extension}
|
DfmFileExt = '.dfm'; {Delphi form file extension}
|
||||||
LfmFileExt = '.lfm'; {Lazarus form file extension}
|
LfmFileExt = '.lfm'; {Lazarus form file extension}
|
||||||
@ -70,7 +77,8 @@ var
|
|||||||
begin
|
begin
|
||||||
|
|
||||||
{Base configuration file name on program file location and program name}
|
{Base configuration file name on program file location and program name}
|
||||||
CfgFileName := ExtractFilePath(ParamStr(0)) + ProgramName + CfgFileExt;
|
CfgFileName :=
|
||||||
|
ExtractFilePath(ParamStr(0)) + LowerCase(ProgramName) + CfgFileExt;
|
||||||
{$IFNDEF FPC}
|
{$IFNDEF FPC}
|
||||||
CfgFileName := ExpandFileNameCase(CfgFileName, MatchFound);
|
CfgFileName := ExpandFileNameCase(CfgFileName, MatchFound);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -84,7 +92,7 @@ begin
|
|||||||
WriteLn(' -p Add parent''s font to controls with no font ',
|
WriteLn(' -p Add parent''s font to controls with no font ',
|
||||||
'(useful with Windows).');
|
'(useful with Windows).');
|
||||||
WriteLn(' -d Delete font name from controls ',
|
WriteLn(' -d Delete font name from controls ',
|
||||||
'(useful with OS X and Linux).');
|
'(useful with GTK and GTK2).');
|
||||||
WriteLn('Looks for configuration data in file ', CfgFileName);
|
WriteLn('Looks for configuration data in file ', CfgFileName);
|
||||||
Halt;
|
Halt;
|
||||||
end;
|
end;
|
||||||
@ -261,6 +269,7 @@ begin
|
|||||||
Copy(InStr, 1, Succ(Pos('=', InStr))),
|
Copy(InStr, 1, Succ(Pos('=', InStr))),
|
||||||
IntToStr(StrToInt(Copy(StripStr, 5, MaxInt)) - 16))
|
IntToStr(StrToInt(Copy(StripStr, 5, MaxInt)) - 16))
|
||||||
|
|
||||||
|
(* This incorrect swapping has been fixed in FPC 2.2 based Lazarus releases.
|
||||||
{Lazarus IDE appears to swap Top and Left properties for non-visual
|
{Lazarus IDE appears to swap Top and Left properties for non-visual
|
||||||
controls, so swap them for Orpheus table cell controls.}
|
controls, so swap them for Orpheus table cell controls.}
|
||||||
else if ((CompareText('Top=', Copy(StripStr, 1, 4)) = 0) or
|
else if ((CompareText('Top=', Copy(StripStr, 1, 4)) = 0) or
|
||||||
@ -279,6 +288,7 @@ begin
|
|||||||
WriteLn(LfmFileVar,
|
WriteLn(LfmFileVar,
|
||||||
StringReplace(InStr, 'Left', 'Top', [rfIgnoreCase]));
|
StringReplace(InStr, 'Left', 'Top', [rfIgnoreCase]));
|
||||||
end
|
end
|
||||||
|
*)
|
||||||
|
|
||||||
else {No change to property}
|
else {No change to property}
|
||||||
WriteLn(LfmFileVar, InStr);
|
WriteLn(LfmFileVar, InStr);
|
@ -12,12 +12,19 @@ program MakePasX;
|
|||||||
License: Modified LGPL.
|
License: Modified LGPL.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils;
|
SysUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
ProgramName = 'MakePasX';
|
ProgramName = 'MakePasX';
|
||||||
ProgramVersion = '0.01';
|
ProgramVersion = '0.02';
|
||||||
|
|
||||||
PasFileExt = '.pas'; {Pascal code file extension}
|
PasFileExt = '.pas'; {Pascal code file extension}
|
||||||
DelProjFileExt = '.dpr'; {Delphi project file extension}
|
DelProjFileExt = '.dpr'; {Delphi project file extension}
|
@ -8,6 +8,13 @@ program MakeVer;
|
|||||||
License: Modified LGPL.
|
License: Modified LGPL.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{$IFDEF FPC}
|
||||||
|
{$MODE Delphi}
|
||||||
|
{$ELSE}
|
||||||
|
{$APPTYPE CONSOLE}
|
||||||
|
{$ENDIF}
|
||||||
|
{$R+,Q+}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils,
|
SysUtils,
|
||||||
Classes,
|
Classes,
|
||||||
@ -15,7 +22,7 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
ProgramName = 'MakeVer';
|
ProgramName = 'MakeVer';
|
||||||
ProgramVersion = '0.01';
|
ProgramVersion = '0.02';
|
||||||
|
|
||||||
DofFileExt = '.dof'; {Delphi project options file extension}
|
DofFileExt = '.dof'; {Delphi project options file extension}
|
||||||
VerFileExt = '.version'; {Linux/Mac version info file extension}
|
VerFileExt = '.version'; {Linux/Mac version info file extension}
|
Reference in New Issue
Block a user