1. Home
  2. Computing & Technology
  3. Delphi Programming
RTL reference|Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link To
 
A first look at Kylix
Page 3: New...Application; Porting issues
 More of this Feature
• Page 1: Inside the Box
• Page 2: Installation

Printer friendly versionPrinter friendly version
 Join the Discussion
"Post your questions, concerns, views and comments to this article..."
Discuss!
 Related Resources
• What is Kylix?
• More Kylix articles
 From Other Guides
• About Linux
 Elsewhere on the Web
• Konto
• Borland Kylix home page
• Getting to know Linux
• Kylix review - for non Delphi developers

   New...Application
When you start Kylix, a new project is opened. Just like in Delphi. This automatically creates a new empty form on which you can drop various visible and non-visible components - again just like in Delphi. Let's see what's different.

Inside the .pas file
Unit source files contain most of the code in an application. In the unit's interface section the uses part for the newly created form, on Kylix, looks like:

uses SysUtils, Types, Classes,
     QGraphics, QControls, QForms,
     QDialogs;

note the lack of Windows and Messages in the list; also the letter Q is added to CLX version of some of the standard units.

Down in the implementation section the {$R *.xfm} line tells us that, on Kylix, form files (.dfm in Delphi) are saved with the .xfm extension.

CLX
Kylix, as Delphi, comes with a class library made up of objects (components and controls), that you use when writing code. This class hierarchy, is called the Borland Component Library for Cross Platform (CLX - pronounced clicks). Actually, both Kylix and the new Delphi 6 share a common component-based framework. Prior to CLX, the Visual Component Library (VCL) was the backbone of Borland's IDE. Like CLX, the VCL handled text, I/O, date and time functions, file management, visual presentation, graphics, data access, networking, and so on. The big difference between CLX and the VCL is that the VCL relied heavily on the Windows API and CLX does not.

Kylix includes BaseCLX, VisualCLX, DataCLX, and NetCLX components.

The visual portion of the CLX is named VisualCLX; it uses the Qt runtime library as its graphics and GUI engine. The Qt runtime is based on a C++ class library developed by a company named Trolltech. Kylix uses the QT toolkit and Object Pascal to provide a full-featured Rapid Application Development (RAD) environment.

Kylix IDE

   Database development

DB app in Kylix
CLX uses dbExpress, a new technology for connecting to many different SQL databases, including mySQL and Interbase, as well as Oracle and DB2. Of interest to Web developers is the fact that CLX also provides Internet support for direct socket access, TCP, FTP, and HTTP. It also provides full support for native database-driven Apache Server applications in Kylix, as well as a future release of Delphi for Windows. With DataCLX you save time not having to code to the database APIs because DataCLX is a pre-coded database access layer. Developing a data-driven application in Kylix is merely a matter of dropping icons for data source and display, filling in properties, and visually constructing data display and navigation tools. Familiar.

   Porting issues
The question is: will Delphi applications simply recompile on Kylix? No. Changes will be required if there are direct API calls, or if you are using a third party tool not yet ported to Kylix/Linux.

In the case of migrating VCL code into Kylix, conversion of code may be necessary, but only where code has fundamentally assumed a Windows environment – for instance, direct calls to the Windows API. Code written to CLX is immediately transportable, while code written to VCL requires little modification. In most cases, you can simply load your Delphi applications into the new environment, change a few uses clauses, compile the code and immediately see the Delphi app running on KDE, Gnome, or whatever happens to be your favorite X-window desktop.

When VisualCLX is available to Windows programmers in Delphi 6, all GUI applications written in Kylix can be ported easily to Windows. And if Delphi for Mac, and Delphi for Palm are launched, your applications will port to these platforms as well.

The Windows-specific features that will not port easily from Delphi to Kylix; things like COM, ADO, and ActiveX controls.

For now, Kylix produces only Intel x86 machine code. No commitments for other platforms have been announced to date. Borland has stated that they'll move to another platform when they feel that the market will bear the cost of porting to a new processor.

   This is Kylix 1.0, after all
This article is meant to be just a short trip to new Delphi for Linux, Kylix. If you plan on writing cross-platform applications (and you have some experience with Pascal) than Kylix is simply the best solution you have right now.

Don't forget to post your questions, concerns, views and comments to this article on the Delphi Programming Forum.

First page > Inside the Box > Page 1, 2, 3

All graphics (if any) in this feature created by Zarko Gajic.

 More Delphi
· Learn another routine every day - RTL Quick Reference.
· Download free source code applications and components.
· Talk about Delphi Programming, real time.
· Link to the Delphi Programming site from your Web pages.
· Tutorials, articles, tech. tips by date: 2001|2000|1999|1998 or by TOPIC.
· NEXT ARTICLE: ISAPI Tutorial for Delphi developers.
A brief introduction to web-broker technology; Web Actions; The first ISAPI application; TWebRequestObject; TPageProducers; Database enabled applications, and more.
 Stay informed with all new and interesting things about Delphi (for free).
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

Explore Delphi Programming

More from About.com

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2008 About.com, a part of The New York Times Company.

All rights reserved.