Kylix预览
日期:2007年5月18日 作者: 查看:[大字体 中字体 小字体]-
Cross-platform Controls
From Windows to Linux, and Back
These are exciting times for Borland. Not since the first whisper of Delphi has there been this mUCh excitement about a Borland product. I'm talking, of course, about Kylix, the project to bring C++Builder and Delphi to the Linux operating system. The Delphi version will be available first, so for the rest of this article, Kylix refers to Delphi for Linux.
We're developing a new VCL that will work with the Windows and Linux versions of Delphi. This means you can write an application in Windows, then move the source to a Linux box and recompile it - or vice versa. This new VCL is named CLX, for Component Library Cross-Platform. CLX encompasses the entire cross-platform library distributed with Kylix. There are a few sub-categories, which, as of this writing, break down as follows:
- BaseCLX is the RTL, up to, and including, Classes.pas.
- VisualCLX includes the user interface classes, i.e. the usual controls.
- DataCLX comprises the cross-platform database components.
- NetCLX includes the Internet stuff, e.g. Apache, etc.
At the time of this writing [early May 2000], the first Field Test for Kylix is just beginning. By the time you read this, there will be a big difference between the Kylix I'm using and working on, and the version you'll see when it's available. This makes my job all that more difficult. It would be easy to talk in generalities, waxing eloquent about the underlying architecture. I'd much rather discuss the details, however, so you can get a head start producing CLX controls. Just keep in mind that it's likely some of the particulars discussed in this article will have changed by the time you read it.
No One Else Comes Close
This article is a primer on writing custom VisualCLX controls. Essentially, the VisualCLX is what you know and love about the VCL. When you think about it, Visual Component Library is a bit of a misnomer; there's a lot more to it than the visual components. In this article, however, I'm only going to write about the visual controls. The Button, Edit, ListBox, PageControl, StatusBar, ProgressBar, etc. controls, have all been re-implemented to be cross-platform. How did we do this when the current VCL relies so much on Windows? In brief, we ripped out all the Windows stuff, and replaced it with another toolkit.
In Linux, there are a number of toolkits that contain the standard windowing controls, such as Buttons. They're called widgets, and GTK and Qt (pronounced "cute") are two of the more popular. Qt is a Linux widget toolkit that works on Windows and Linux. Because it aligned most closely with our goals, Qt was chosen as the basis for CLX. In other Words, Qt is to CLX what the Windows API and common controls are to the VCL. Qt has some definite positives for the Delphi custom component developer on Linux:
- It's a prevalent Linux widget set, used by the popular KDE desktop.
- It's similar to the Windows API style of development.
- Its graphics model is close to the VCL's graphics model.
- Its classes look very much like VCL components.
- It introduces many standard widgets, and handles the message loop.
This begs two questions: Does this mean that Kylix supports only KDE, and no other desktops, such as Gnome? And how does using Qt as the basis of CLX affect me? The answer to the first question is that Kylix applications will run under any Linux desktop - particularly Gnome and KDE. The rest of this article answers the second question.
Don't Want You Back
The goal is to make it easy for developers to port their applications to Linux with the least amount of trouble. Most of the component names are the same, and most of the properties are the same. Although a few properties will be missing from some components, and a few new ones will be added, for the most part, it should be fairly painless to port your applications.
For component writers, it's a different story. For starters, there is no Windows.pas, nor Windows API (see Figure 1). You can say good-bye to the message directive, and all of the CN and CM notifications. These have been changed to dynamics. There is also no docking, bi-directional (BiDi) methods/properties, input method editor (IME), or Asian support in the first release. Of course, there's no ActiveX, COM, or OLE support. Windows 3.1 components are also out, as I write this.
Methods
CreateParams
CreateSubClass
CreateWindowHandle
CreateWnd
DestroyWindowHandle
DestroyWnd
DoAddDockClient
DockOver
DoDockOver
DoRemoveDockClient
DoUnDock
GetDeviceContext
MainWndProc
ResetIme
ResetImeComposition
SetIme
SetImeCompositionWindow
WndProc
Properties
Ctl3D
DefWndProc
DockManager
DockSite
ImeMode
ImeName
ParentCtl3D
UseDockManager
WheelAccumulator
Figure 1: Methods and properties missing from TWidgetControl (formerly known as TWinControl).
By now I bet you're thinking, "That's not so bad; porting my components doesn't sound too difficult." But wait - there's more. At the time of this writing, the CLX unit names have all been changed to include "Q" as a prefix. So StdCtrls is now QStdCtrls, some classes have shuffled around a bit, and there are some subtle differences in the hierarchy (see Figure 2).
- [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] 下一页
-
- Kylix预览 相关文章:
- Kylix预览 相关软件
- 特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作
- 者.文章版权归文章原始作者所有.对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转
- 载的文章有版权问题请联系编辑人员,我们尽快予以更正. 转载请注明来源:http://www.hackhome.com
上一篇:Delphi中的图形显示技巧
下一篇:Form产生时的事件次序;
精品推荐
热点TOP10
- ·教你学习如何破解XP登陆密码
- ·软件注册码、安装序列号☆集锦
- ·Wap开发FAQ大全
- ·软件狗[Dongles]的加密与解密技术
- ·Magic Linux安装超清楚图解
- ·BAT批处理文件语法
- ·WINDOWS专集大集合,绝对是精品中的精品
- ·PKI技术及应用开发指南
- ·常用的网络测试命令
- ·使用WinInet编写发送短信程序
- ·黑客入门教程:telnet协议
- ·校园机房安装组建过程实战讲解
- ·检测并禁用隐藏服务
- ·在电脑上录制电视节目
- ·Kylix预览
- ·Windows操作系统另类垃圾的清理
- ·软件狗[Dongles]的加密与解密技术
- ·net命令参数详细说明
- ·解剖分析3721及上网助手
- ·WinXP服务说明及优化
特别推荐
- ·PKI技术及应用开发指南
- ·检测并禁用隐藏服务
- ·Windows操作系统另类垃圾的清理
- ·校园机房安装组建过程实战讲解
- ·收集MD5破解网站[在线搜索]
- ·在电脑上录制电视节目
- ·手工添加系统服务 整理版
- ·求助:如何知道自己是否被人限制局域网内网速!
- ·文件分配表-教你了解文件分配表的知识
- ·使用WinInet编写发送短信程序
- ·WINDOWS专集大集合,绝对是精品中的精品
- ·收藏经典:windows消息大全
- ·Magic Linux安装超清楚图解
- ·局域网监控我最行——Netrobocop
- ·全套电影播放器.插件及下载工具
- ·故障恢复控制台命令全攻略
- ·恢复IE为默认浏览器
- ·BitTorrent(BT)种子制作教程
- ·win2003 sp1 安装盘制作
- ·Regsvr32的特殊作用
