Many Kylix topics will be integrated into existing Delphi Reference Library pages because Kylix is Delphi for Linux in many ways.  


Contents

A.  Kylix Projects
B.  Kylix Info
C.  Delphi-to-Kylix Conversion Notes
D.  Kylix Links
E.  Miscellaneous

A.  Kylix Projects

Page Description
Color Mask Delphi (D7) and Kylix (K3) project showing selected bits of 24-bit color image. (Feb 2003)
Hershey's Font Delphi (D3..D7) and Kylix (K1..K3) project showing the characters in Hershey's font.  Download section.  Separate VCL and CLX versions.  newspin.gif (8666 bytes)
SimpleBarChart D3/D4/D5/D6 and Kylix project showing how to create a simple bar chart in a device-independent way.  Separate VCL and CLX versions.   newspin.gif (8666 bytes)
Deployment Kylix Deployment Notes for "Hello World" (Oct 2002)
VMware Kylix Under VMware (Nov 2002)
CRC Converted old VCL project to a CLX project:  CRC Calculator application (Dec 2002)  newspin.gif (8666 bytes)
CLX Form Portability Discusses problems with CLX form portability, especially when using the default form properties. (Dec 2002) 

 


B.  Kylix Info

Page Description
Magnifier Added link:  Dr. Chris Rorden's Kylix magnifier example
www.psychology.nottingham.ac.uk/staff/cr1/kylix.html 
Math Info Added summary of changes to the math unit introduced in Kylix to Section A of the Math Info page.
Scanline efg's UseNet Post with Kylix pf32bit example.  This supplements the existing pf32bit PixelFormat info in the Scanline Tech Note.  Added list of Kylix PixelFormats to introduction.

Kylix Graphics Notes


C.  Delphi-to-Kylix Conversion Notes

Also see:  

- Chapter 10, "Using CLX for cross-platform development," in Delphi 6 Developer's Guide
- Chapter 10, "Developing cross-platform applications," in Kylix Developer's Guide
Migrating Your Delphi 5 Projects to Kylix
Kylix for Delphi programmers

 

Topic Subtopic Description
DWORD   DWORD from Delphi's Windows.pas is defined as a  LongWord in the Types unit.
RGB function   The RGB function from the Delphi Windows unit is missing in Kylix for defining colors.  Just supply your own:

FUNCTION RGB(r, g, b: BYTE): TColor;
BEGIN
  Result   :=   (r OR (g SHL 8) OR (b SHL 16))
END {RGB};

TForm Application icon The Application icon must be set as a Form property in Kylix.  In Delphi this also works but I had learned to set it in Delphi via Project | Options | Application | Icon.
AutoScroll Conventional wisdom from Delphi is to use Scaled=TRUE and AutoScroll=FALSE.  I prefer Scaled=FALSE and AutoScroll=FALSE.  See CLX Form Portability.  I suggest NEVER using AutoScroll=TRUE.  Also see PixelsPerInch.
BorderIcons I had problems getting Kylix to honor the Border Icons (maximize = FALSE) and Border Style ("single"), but they worked after resetting them a several times. 
Constraints In Kylix set the Constraints at run time to prevent a form from being resize.  For example, put this in the FormCreate handler:

WITH FormName.Constraints DO
BEGIN
  MaxHeight := Height;
  MaxWidth := Width;
  MinHeight := Height;
  MinWidth := Width;
END

PixelsPerInch See comments by James R. Knowles under "FORMS" as part of his "Adventures in Kylix":  www.ifm-services.com/people/jamesk/kylix/adv_in_kylix-4.html 

Specify the DPI for your X-Server in these ways:
1.  Specify -dpi with startx (Red Hat 7.2):

startx  --  -dpi 96

2.  As root create an /etc/X11/xinit/xserverrc file like this (Red Hat 7.2 or Mandrake 9.0):

#! /bin/sh
exec /usr/bin/X11/X -dpi 75 -nolisten tcp

3.   In Red Hat 8.0, select Red Hat | System Settings | Display | <root password>.  On the Display tabsheet specify resolution and color depth, while on the Advance tabsheet specify monitor type and DPI.  

This command

xrdb -q | grep dpi

shows 

Xft.dpi:  96

Note:  Delphi in Windows usually defaults to 96 DPI with "Small Fonts" (Right click on desk top | Properties | Settings | Advanced | General | Display)

Scaled Conventional wisdom from Delphi is to use Scaled=TRUE and AutoScroll=FALSE.  I prefer Scaled=FALSE and AutoScroll=FALSE.  See CLX Form Portability.  Also see PixelsPerInch.
TListBox OnDrawItem Change in function header for TListBox OnDrawItem.  See the conversion section in the Hershey's Font project.
TSpinEdit OnChange The OnChange of the TSpinEdit did not survive the transfer from Delphi to Kylix.  I had to re-establish this method.
TSavePictureDialog   This does not exist in Kylix.  Use TSaveDialog instead.

1.  Versions of Delphi and Kylix

Marc Hoffman's UseNet Post with eDefines.inc for Kylix 1.0 through 3.0 defines.

Lasse Vågsæther Karlsen's Versions.INC (updated for Delphi and Kylix) is quite useful for creating IFDEFs for version-sensitive code.  Updated for D7 by Jim McKeeth.

2.  Case Sensitivity Considerations:  Project Files

When you create a new Delphi/Kylix project, the project file Project1.dpr is automatically created.  The $R statement included in this Project1.dpr file varies by version of Delphi/Kylix:

Version Project Filename $R statement in .dpr file Resource File
Kylix Project1.dpr {$R *.res} Project1.res
D6 Project1.dpr {$R *.res} Project1.res
D2-D5 Project1.dpr {$R *.RES} Project1.res
D1 project1.dpr {$R *.RES} PROJECT1.RES

See SimpleBarChart project for IFDEFs used to maintain VCL/CLX compatibility.

3.  Case Sensitivity Considerations:  Forms

 

Version Source Code File Form File $R statement in .pas file Option to Store Form as Text*
Kylix Unit1.pas Unit1.xfm {$R *.xfm} Yes
D6 Unit1.pas Unit1.dfm {$R *.dfm} Yes
D5 Unit1.pas Unit1.dfm {$R *.DFM} Yes
D2-D4 Unit1.pas Unit1.dfm {$R *.DFM} No
D1 unit1.pas UNIT1.DFM {$R *.DFM} No

* Right click on form and select check box to store as text

Before converting to Kylix from Delphi 4 or before, open the form in D5 or later and select "Text DFM" -- but this may not always be needed.  For example, this was not needed in the  SimpleBarChart project.

See SimpleBarChart project for IFDEFs used to maintain D3/D4/D5/D6 VCL compatibility with Kylix CLX.  This was possible since the components that were used were in one set of units or the other.

See comments by James R. Knowles under "FORMS" as part of his "Adventures in Kylix":  www.ifm-services.com/people/jamesk/kylix/adv_in_kylix-4.html 


D.  Kylix Links

Adventures in Kylix
www.ifm-services.com/people/jamesk/kylix 
Kylix page by Association d'entraide des développeurs Francophones
www.developpez.com/kylix/index.htm 
Kylix Technotes by Matthias Thoma
PNG Graphics with Delphi and Kylix
www.psychology.nottingham.ac.uk/staff/cr1/png.html 
Flicker in Kylix graphics. RAPware has come up with a nice solution to the flickering of QT graphics.  Dr. Chris Rorden outlines the solution on this page::
www.psychology.nottingham.ac.uk/staff/cr1/kylix.html

E.  Miscellaenous

Kylix Under VMware (Nov 2002) 

  
US
  UK  DE  FR

Author's Page -- Jon Shemitz


Updated 25 Feb 2003


since 1 Jul 2001