Win7 64位下Delphi7 TPageControl无法自绘,求解决

DelisPhi 2014-02-24 04:22:35
如果把一个PageControl的OwnerDraw属性置为True,style置为fsFlatButtons,并给他的OnDrawTab写下一段代码:

procedure TForm1.PageControl1DrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
begin
TPageControl(Control).Canvas.Brush.Color := clLime;
If Active Then TPageControl(Control).Canvas.Brush.Color := $00CCFFCC Else TPageControl(Control).Canvas.Brush.Color := $00EADBCB;// G_PageTabBgColor[Random(G_PageColorMaxNum)];//$00CCFFCC;//$00CEE8CA;//cllime;
TPageControl(Control).Canvas.FillRect(Rect);

//---------写字
Control.Canvas.TextRect(Rect,Rect.Left + 20, Rect.Top + 4, 'AText');

end;


编译出来的程序在32位XP,32位Win7下都可以实现改变PageControl顶部按钮的背景颜色;但是64位 Win7里面运行,就相当于OwnerDraw为False,但是没有字的情况。不知是啥问题。
...全文
424 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
DelisPhi 2014-03-03
  • 打赏
  • 举报
回复
根据bwsoft1的提示在google狂搜一顿后有了解决方法。 把以下代码另存为VCLFixes.pas,然后uses它,就搞定了,膜拜一下编写这个东东的大牛
unit VCLFixes;

interface

implementation

uses
Messages, Windows, Controls, Dialogs;

// WMDrawItem fails under WOW64, see http://qc.codegear.com/wc/qcmain.aspx?d=19859

{$IFDEF VER150} // Delphi7

function GetMethodAddress(AMessageID: Word; AClass: TClass; out MethodAddr: Pointer): Boolean;
var
DynamicTableAddress: Pointer;
MethodEntry: ^Pointer;
MessageHandlerList: PWord;
EntryCount, EntryIndex: Word;
begin
Result := False;

DynamicTableAddress := Pointer(PInteger(Integer(AClass) + vmtDynamicTable)^);
MessageHandlerList := PWord(DynamicTableAddress);
EntryCount := MessageHandlerList^;

if EntryCount > 0 then
for EntryIndex := EntryCount - 1 downto 0 do
begin
Inc(MessageHandlerList);
if (MessageHandlerList^ = AMessageID) then
begin
Inc(MessageHandlerList);
MethodEntry := Pointer(Integer(MessageHandlerList) + 2 * (2 * EntryCount - EntryIndex) - 4);
MethodAddr := MethodEntry^;
Result := True;
end;
end;
end;

function PatchInstructionByte(MethodAddress: Pointer; ExpectedOffset: Cardinal;
ExpectedValue: Byte; NewValue: Byte): Boolean;
var
BytePtr: PByte;
OldProtect: Cardinal;
begin
Result := False;

BytePtr := PByte(Cardinal(MethodAddress) + ExpectedOffset);

if BytePtr^ = NewValue then
begin
Result := True;
Exit;
end;

if BytePtr^ <> ExpectedValue then
Exit;

if VirtualProtect(BytePtr, SizeOf(BytePtr^), PAGE_EXECUTE_READWRITE, OldProtect) then
begin
try
BytePtr^ := NewValue;
Result := True;
finally
Result := Result
and VirtualProtect(BytePtr, SizeOf(BytePtr^), OldProtect, OldProtect)
and FlushInstructionCache(GetCurrentProcess, BytePtr, SizeOf(BytePtr^));
end;
end;
end;

function PatchInstructionBytes(MethodAddress: Pointer; ExpectedOffset: Cardinal;
const ExpectedValues: array of Byte; const NewValues: array of Byte;
const PatchedValues: array of Byte): Boolean;
var
BytePtr, TestPtr: PByte;
OldProtect, Index, PatchSize: Cardinal;
begin
BytePtr := PByte(Cardinal(MethodAddress) + ExpectedOffset);

Result := True;
TestPtr := BytePtr;
for Index := Low(PatchedValues) to High(PatchedValues) do
begin
if TestPtr^ <> PatchedValues[Index] then
begin
Result := False;
Break;
end;
Inc(TestPtr);
end;

if Result then
Exit;

Result := True;
TestPtr := BytePtr;
for Index := Low(ExpectedValues) to High(ExpectedValues) do
begin
if TestPtr^ <> ExpectedValues[Index] then
begin
Result := False;
Exit;
end;
Inc(TestPtr);
end;

PatchSize := Length(NewValues) * SizeOf(Byte);

if VirtualProtect(BytePtr, PatchSize, PAGE_EXECUTE_READWRITE, OldProtect) then
begin
try
TestPtr := BytePtr;
for Index := Low(NewValues) to High(NewValues) do
begin
TestPtr^ := NewValues[Index];
Inc(TestPtr);
end;
Result := True;
finally
Result := Result
and VirtualProtect(BytePtr, PatchSize, OldProtect, OldProtect)
and FlushInstructionCache(GetCurrentProcess, BytePtr, PatchSize);
end;
end;
end;

procedure PatchWinControl;
var
MethodAddress: Pointer;
begin
if not GetMethodAddress(WM_DRAWITEM, TWinControl, MethodAddress) then
begin
ShowMessage('Cannot find WM_DRAWITEM handler in TWinControl');
Exit;
end;
if (not PatchInstructionByte(MethodAddress, 13, $4, $14)) // release and package
and (not PatchInstructionByte(MethodAddress, 23, $4, $14)) then // debug
ShowMessage('Cannot patch WM_DRAWITEM');

if not GetMethodAddress(WM_COMPAREITEM, TWinControl, MethodAddress) then
begin
ShowMessage('Cannot find WM_COMPAREITEM handler in TWinControl');
Exit;
end;
if (not PatchInstructionByte(MethodAddress, 13, $04, $8)) // release and package
and (not PatchInstructionByte(MethodAddress, 23, $04, $8)) then // debug
ShowMessage('Cannot patch WM_COMPAREITEM handler');

if not GetMethodAddress(WM_DELETEITEM, TWinControl, MethodAddress) then
begin
ShowMessage('Cannot find WM_DELETEITEM handler in TWinControl');
Exit;
end;
if (not PatchInstructionByte(MethodAddress, 13, $04, $0C)) // release and package
and (not PatchInstructionByte(MethodAddress, 23, $04, $0C)) then // debug
ShowMessage('Cannot patch WM_DELETEITEM handler');

if not GetMethodAddress(WM_MEASUREITEM, TWinControl, MethodAddress) then
begin
ShowMessage('Cannot find WM_MEASUREITEM handler in TWinControl');
Exit;
end;
if (not PatchInstructionBytes(MethodAddress, 10, [$08, $8B], [$04, $90, $90, $90], [$04, $E8])) // release and package
and (not PatchInstructionBytes(MethodAddress, 20, [$08, $8B], [$04, $90, $90, $90], [$04, $E8])) then // debug
ShowMessage('Cannot patch WM_MEASUREITEM handler');
end;

{$ENDIF}

// end of "WMDrawItem fails under WOW64" patch
initialization
{$IFDEF VER150} // Delphi7
PatchWinControl;
{$ENDIF}

end.
lyhoo163 2014-03-01
  • 打赏
  • 举报
回复
试过了,WIN7 32位完好 ,64位有问题,未画字符和颜色。
bwsoft1 2014-02-27
  • 打赏
  • 举报
回复
goole搜下,前段时间搜到过
DelisPhi 2014-02-26
  • 打赏
  • 举报
回复
自己顶一下,没人遇到过这个问题么。。
DelisPhi 2014-02-25
  • 打赏
  • 举报
回复
引用 1 楼 bwsoft1 的回复:
需要打个补丁文件,或者修改paint过程
啥补丁文件,有地址不? 如果修改Paint过程,有没有具体点的步骤或者代码,本人比较菜不大会动系统内置的东东。。在此先谢过。。
bwsoft1 2014-02-24
  • 打赏
  • 举报
回复
需要打个补丁文件,或者修改paint过程
目录 : 第0章 认识Delphi 0-1 前言 0-2 Delphi简介 0-3 进入Delphi7 0-4 退出Delphi 第1章 常用的窗口工具 1-1 窗体(Form) 1-2 代码编辑器(Code Editor) 1-3 代码浏览器(Code Explorer) 1-4 组件面板(Componet Palette) 1-5 对象检视器(Object Inspector) 1-6 快捷工具栏(Speed Menu) 1-7 项目管理器(Project Manager) 1-8 桌面工具栏(Desktops Tollbar) 1-9 图像编辑器(Image Editor) 1-10 对象浏览器(Object TreeView) 1-11 关联选项卡(Digram Page) 第2章 常用的菜单 2-1 File菜单 2-2 Edit菜单 2-3 Search菜单 2-4 View菜单 2-5 Project菜单 2-6 Run菜单 2-7 Tools菜单 2-8 Windows菜单 第3章 集成开发环境的改变 3-1 Delphi集成开民环境介绍 3-2 操作菜单方面的改进 3-2-1 外面方面的改变 3-2-2 内容方面的改变 3-3 对象检视器方面的改进 3-4 组件面板的改进 3-5 代码编辑器的改进 3-6 设计陈列室的改进 3-7 编译信息的显示 3-8 调试器方面的改进 3-8-1 Watch List改进 3-8-2 Debugger选项的改进 3-8-3 Run Parameters对话框的改进 第4章 Delphi Object Pascal的初步印象 4-1 面向对象程序概论 4-1-1 类 4-1-2 对象 4-1-3 继承 4-1-4 封装 4-1-5 信息 4-2 Delphi项目结构及窗体的建立 4-2-1 GUI模式的项目 4-2-2 Console模式的项目 4-3 Object Pascal程序结构 4-3-1 项目程序(Program)的结构 4-3-2 单元程序(Unit)的结构 4-4 如何完成一个简单的窗体程序 第5章 简单的常用指令介绍 5-1 TLabel类对象 5-1-1 Caption属性 5-2 TButton类对象 5-2-1 Caption属笥 5-2-2 OnClick事件 5-3 TEdit类对象 5-4 TCanvas类对象 5-5 Showmessage函数 5-6 InputBox函数 5-7 MessageDlg函灵敏 第6章 Delphi与Object Pascal程序的基本概念 6-1 Object Pascal Program程序结构与Delphi项目结构的关系 6-1-1 标头(Heading) 6-1-2 Uses子句 6-1-3 编译指令(Compiler directive) 6-1-4 源代码区(begin end) 6-2 Unit程序结构与窗体的关系 6-2-1 Unit代码结构 6-2-2 语句(Statement) 6-2-3 Unit间Use的状况 6-3 数据类型与定义变量 6-3-1 数据类型概论 6-3-2 不需要使用type声明的数据类型 6-3-3 必须使用type声明的数据类型 6-3-4 定义变量 6-3-5 变量的作用域 6-3-6 定义常量 6-3-7 变量的类型转换(Typecast) 6-4 Object Pascal的运算符(Operator) 6-4-1 设置运算符(assign Operator) 6-4-2 算数运算符(Arithmetic Operator) 6-4-3 关系运算符(Relational Operator) 6-4-4 布尔运算符 6-4-5 集合运算符 6-4-6 字符串运算符 6-4-7 位逻辑运算符 6-4-8 运算符优先级 6-5 流程控制 6-5-1 语句的基本概念 6-5-2 表达式语句(Expression-Statement) 6-5-3 流程控制语句 6-5-4 可视化程序与嵌套程序 6-6 数组与指针 6-6-1 数组类型 6-6-2 指针类型 6-6-3 浅谈指针与数据结构 6-7 程序与函数(Procedures and Functions) 6-7-1 函数的意义与优点 6-7-2 函数的分类与效用 6-7-3 自定义函数使用方法概述 6-7-4 函数的声明、定义及其实现 6-7-5 参数传递方式 6-7-6 声明修

中文名称:Delphi 7完美经典

http://www.huachu.com.cn/photo/2003/BB04672130c.jpg

出版社 : 中国铁道出版社
作者  : 江义华/
出版日期: 2003年7月
综合评价:
国标编号:ISBN 7-113-05241-X/TP.931
条形码 :9787113052416
字数  :989千字  
印张  :41.75
印数  :1-5000   
页数  :654
开本  :787*1092 1/16
版别版次:2003年7月第一版第一次印刷
内容简介:
本书特色
层次清晰、语言通俗、语法简练、以实用性为第一位。
深入剖析了Object Pascal程序语言,包括指针、数据结构以及有关Override 和Overload函数的语法等。
对面向对象的观点详述了Delphi VCL组件的属性、方法及事件,且在数据库设计方面辅以应用的范例。
实例配有光盘,快速引导您踏入Delphi程序开发领域。
适合想要深入了解Delphi程序设计的专业设计师,对一开始就想打好Delphi程序设计基础的初学者也非常适用。

目录 :
第0章 认识Delphi

0-1 前言
0-2 Delphi简介
0-3 进入Delphi7
0-4 退出Delphi

第1章 常用的窗口工具

1-1 窗体(Form)
1-2 代码编辑器(Code Editor)
1-3 代码浏览器(Code Explorer)
1-4 组件面板(Componet Palette)
1-5 对象检视器(Object Inspector)
1-6 快捷工具栏(Speed Menu)
1-7 项目管理器(Project Manager)
1-8 桌面工具栏(Desktops Tollbar)
1-9 图像编辑器(Image Editor)
1-10 对象浏览器(Object TreeView)
1-11 关联选项卡(Digram Page)

第2章 常用的菜单

2-1 File菜单
2-2 Edit菜单
2-3 Search菜单
2-4 View菜单
2-5 Project菜单
2-6 Run菜单
2-7 Tools菜单
2-8 Windows菜单

第3章 集成开发环境的改变

3-1 Delphi集成开民环境介绍
3-2 操作菜单方面的改进
3-2-1 外面方面的改变
3-2-2 内容方面的改变
3-3 对象检视器方面的改进
3-4 组件面板的改进
3-5 代码编辑器的改进
3-6 设计陈列室的改进
3-7 编译信息的显示
3-8 调试器方面的改进
3-8-1 Watch List改进
3-8-2 Debugger选项的改进
3-8-3 Run Parameters对话框的改进

第4章 Delphi Object Pascal的初步印象

4-1 面向对象程序概论
4-1-1 类
4-1-2 对象
4-1-3 继承
4-1-4 封装
4-1-5 信息
4-2 Delphi项目结构及窗体的建立
4-2-1 GUI模式的项目
4-2-2 Console模式的项目
4-3 Object Pascal程序结构
4-3-1 项目程序(Program)的结构
4-3-2 单元程序(Unit)的结构
4-4 如何完成一个简单的窗体程序

第5章 简单的常用指令介绍

5-1 TLabel类对象
5-1-1 Caption属性
5-2 TButton类对象
5-2-1 Caption属笥
5-2-2 OnClick事件
5-3 TEdit类对象
5-4 TCanvas类对象
5-5 Showmessage函数
5-6 InputBox函数
5-7 MessageDlg函灵敏

第6章 Delphi与Object Pascal程序的基本概念

6-1 Object Pascal Program程序结构与Delphi项目结构的关系
6-1-1 标头(Heading)
6-1-2 Uses子句
6-1-3 编译指令(Compiler directive)
6-1-4 源代码区(begin end)
6-2 Unit程序结构与窗体的关系
6-2-1 Unit代码结构
6-2-2 语句(Statement)
6-2-3 Unit间Use的状况
6-3 数据类型与定义变量
6-3-1 数据类型概论
6-3-2 不需要使用type声明的数据类型
6-3-3 必须使用type声明的数据类型
6-3-4 定义变量
6-3-5 变量的作用域
6-3-6 定义常量
6-3-7 变量的类型转换(Typecast)
6-4 Object Pascal的运算符(Operator)
6-4-1 设置运算符(assign Operator)
6-4-2 算数运算符(Arithmetic Operator)
6-4-3 关系运算符(Relational Operator)
6-4-4 布尔运算符
6-4-5 集合运算符
6-4-6 字符串运算符
6-4-7 位逻辑运算符
6-4-8 运算符优先级
6-5 流程控制
6-5-1 语句的基本概念
6-5-2 表达式语句(Expression-Statement)
6-5-3 流程控制语句
6-5-4 可视化程序与嵌套程序
6-6 数组与指针
6-6-1 数组类型
6-6-2 指针类型
6-6-3 浅谈指针与数据结构
6-7 程序与函数(Procedures and Functions)
6-7-1 函数的意义与优点
6-7-2 函数的分类与效用
6-7-3 自定义函数使用方法概述
6-7-4 函数的声明、定义及其实现
6-7-5 参数传递方式
6-7-6 声明修饰字
6-7-7 常用的内建函数

第7章 Object Pascal面向对象设计

7-1 类和对象
7-1-1 类(Class)与对象(Object)的基本概念
7-1-2 对象的构造与类的关系
7-2 类的声明与对象的定义
7-2-1 类的声明与对象的实现
7-2-2 对象的构造与析构
7-3 类成员的封装等级与可见度
7-3-1 封装的意义
7-3-2 Object Pascal类成员的封装等级
7-3-3 以实例说明类成员封装等级的可见度
7-3-4 开头不加保留字的类成员
7-3-5 成员封装等级的变更法则
7-4 类成员的定义与实现
7-4-1 字段(Field)与对象引用(Object Reference)的实现
7-4-2 方法(Method)
7-4-3 属性(Property)
7-5 类的继承
7-5-1 继承的意义与优点
7-5-2 子类成员的存在方式
7-6 成员函数的Override及 Overload
7-6-1 Override 适用的情况——Virtual与 Dynamic的成员函数
7-6-2 Override成员函数的定义语法
7-6-3 Virtual成员函数与动态绑定(Dynamic Binding)
7-6-4 覆盖(Overriding)与隐藏(Hiding)的差别
7-6-5 Override与OVerload的差别
7-7 Abstract成员函数与多态(Polymorphic)
7-7-1 一般纯虚函数的多态实现概念
7-7-2 纯虚函数的定义语法及实现
7-8 Self、AS、is、Sender、Parent、owner、inerited
7-8-1 Self变量
7-8-2 AS运算符
7-8-3 is运算符
7-8-4 Sender
7-8-5 Parent
7-8-6 owner
7-8-7 inerited保留字
7-9 静态成员方法——Class Methods

第8章 异常处理

8-1 异常处理存在的目的
8-2 Object Pascal异常的种类
8-2-1 Delphi内建的异常类
8-2-2 自定义异常类
8-3 触发异常的方法
8-3-1 由程序系统自动触发
8-3-2 使用Raise指令触发
8-4 处理异常情况
8-4-1 try…finally…end语法说明
8-4-2 ty…except…end语法说明

第9章 Delphi用户接口设计详述

9-1 基本概念
9-2 TForm的属性
9-2-1 由TComponent继承而来的属性
9-2-2 由TControl继承而来的属性
9-2-3 由TWinControl继承而来的属性
9-2-4 由TScrollingWindControl继承而来的属性
9-2-5 由TCustomForm继承而来的属性
9-3 TForm的方法
9-3-1 由TObject继承而来的属性
9-3-2 由TPersistent继承而来的属性
9-3-3 由TComponent继承而来的属性
9-3-4 由TControl继承而来的属性
9-3-5 由WinControl继承而来的属性
9-3-6 由TScrollingWinControl继承而来的属性
9-3-7 由TCustomForm继承而来的属性
9-3-8 由TForm继承而来的属性
9-4 TForm的事件
9-4-1 由TControl继承而来的属性
9-4-2 由TWinControl继承而来的属性
9-4-3 由TCustomForm继承而来的属性
9-5 TLabel的类成员
9-5-1 TLabel的属性
9-5-2 TLabel的方法

第10章 标准组件介绍及实作范例

10-1 Frames组件
10-2 MainMenu组件
10-3 PopuMenu组件
10-4 Label组件
10-5 Edit组件
10-6 Memo组件
10-7 Button组件
10-8 CheckBox组件
10-9 RadioButton组件
10-10 ListBox组件
10-11 ComboBox组件
10-12 ScrollBar组件
10-13 GroupBox组件
10-14 RadioGroup组件
10-15 Panel组件
10-16 ActionList组件

第11章 TApplication与TScreen类介绍及应用

11-1 TApplication类
11-1-1 TApplication类对象常用的属性
11-1-2 TApplication类对象常用的方法
11-2 TScreen类

第12章 高级组件介绍

12-1 Additional选项卡中的常用组件
12-1-1 TBitBtn组件
12-1-2 TMaskEdit组件
12-1-3 TImage组件
12-1-4 TShape组件
12-2 Win32选项卡中的常用组件
12-2-1 TPageControl组件
12-2-2 TImageList组件
12-2-3 TRichEdit组件
12-2-4 TDateTimePicker组件
12-2-5 TStatusBar组件
12-3 System选项卡中的常用组件
12-3-1 TTimer组件
12-4 Dialogs选项卡中的常用组件
12-4-1 TOpenDialog组件
12-4-2 FTontDialog组件
12-4-3 TColorDialog组件

第13章 封装Delphi7开发的应用程序

13-1 安装Borland的InstallShiled程序
13-2 利用InstallShield封装 Delphi7开发的程序
13-2-1 InstallShield环境界面简介
13-2-2 封装一个简单的Delphi项目

第14章 数据库概念及SQL指令介绍

14-1 数据库基本概念
14-1-1 数据库结构
14-1-2 开放数据库连接协议(ODBC)
14-1-3 SQL Explorer
14-2 结构化查询语言SQL
14-2-1 CREATE语句
14-2-2 ALTER TABLE语句
14-2-3 DROP语句
14-2-4 SELECT语句
14-2-5 INSERT、UPDATE语句
14-2-6 DELETE语句
14-3 SQL指令高级使用
14-3-1 UNION运算
14-3-2 JOIN运算
14-3-3 特殊运算符
14-3-4 子查询(Sub Query)

第15章 Delphi数据库程序基础

15-1 Delphi各种数据库连接设置
15-1-1 建立dBase、Paradox连接
15-1-2 建立Access连接
15-1-3 建立MSSQL连接
15-1-4 建立MySQL连接
15-2 Delphi的Database Desktop使用方法
15-2-1 字段定义
15-2-2 输入数据
15-2-3 设置BDE数据库别名与连接数据库

第16章 Delphi数据库程序设计——使用BDE组件

16-1 TDataSet组件
16-1-1 TDataSet组件常用的属性
16-1-2 TDataSet组件常用的方法
16-1-3 TDataSet组件常用的事件
16-2 TTable组件
16-2-1 TTable组件常用的属性
16-2-2 TTable组件常用的方法
16-3 TQuery组件
16-3-1 TQuery组件常用的属性
16-3-2 TQuery组件常用的方法
16-4 TDataModule组件
16-5 TDatabase组件
16-5-1 TDatabase组件常用的属性
16-5-2 TDatabase组件常用的方法
16-5-3 TDatabase组件常用的事件
16-6 综合范例
16-6-1 员工管理系统——使用TTable组件
16-6-2 员工管理系统——使用TQuery组件
16-6-3 订单管理系统——使用TTable组件
16-6-4 订单系统——使用TQuery组件

第17章 数据程序设计——使用Delphi组件

17-1 TADOConnection组件
17-1-1 TADOConnection组件常用的属性
17-1-2 TADOConnection组件常用的方法
17-1-3 TADOConnection组件常用的事件
17-2 TADOCommand组件
17-2-1 TADOCommand组件常用的属性
17-2-2 TADOCommand组件常用的方法
17-3 TADODataSet组件
17-3-1 TADODataSet组件常用的属性
17-3-2 TADODataSet组件常用的方法
17-3-3 TADODataSet组件常用的事件
17-4 TADOTable组件
17-4-1 TADOTable组件常用的属性
17-4-2 TADOTable组件常用的方法
17-5 TADOQuery组件
17-6 综合范例
17-6-1 客户管理系统——使用TADODataSet组件
17-6-2 客户管理系统——使用TADOTable组件
17-6-3 客户管理系统——使用TADOQuery组件
17-6-4 订单管理系统——使用TADOTable组件
17-6-5 订单系统——使用TADOQuery组件

第18章 数据感知组件

18-1 TDBText组件
18-2 TDBEdit组件
18-3 TDBMemo组件
18-4 TDBImage组件
18-5 TDBListBox组件
18-6 TDBComboBox组件
18-7 TDBLookupListBox与TDBLookupComboBox组件
18-8 TDBNavigator组件
18-9 TDBGrid组件

第19章 设计Delphi数据库报表

19-1 设计报表的基本观念
19-1-1 报表的组成
19-1-2 报表的主体组件——TquickRep
19-1-3 建立第一个报表程序
19-2 QuickReport中可打印出组件
19-2-1 TQR系列组件介绍
19-2-2 TQRDB系列组件介绍
19-3 综合范例
19-3-1 一般表达报表范例
19-3-2 标签式报表范例
19-3-3 主/明细报表范例
19-3-4 一般表达式附图片报表范例
19-3-5 分组式报表范例——打印多色报表
19-3-6 报表输出及输出范例

附录 Kylix程序安装及转换

http://lib.verycd.com/2005/02/07/0000038314.html
Delphi VCLSkin 5.30 website : http://www.link-rank.com email : info@link-rank.com VCLSkin is a component to create skinnable user interface for Delphi/C++Builder application, It is easy to use, just put one component on mainform, Vclskin will skin whole application without source code modification. Vclskin is leader in this field, Vclskin support most third-part controls in market, there isn't a competitor was able to support 3rd-part controls as many as Vclskin. VclSkin automatically skin kinds of windows in application, include Delphi forms,MDIform and common Windows dialogs (MsgBox,Open/Save,Font,Print), even the Exception MsgBox. Vclskin not only support Delphi standard controls, but also support many third-party component, such as TMS Grid pack, EnLib Grid, Developer Express QuantumGrid. It is an excellent choice for those wanting to skin existing applications. The cool thing is that it uses existing VCL components. -Install Run install.exe to install. You also get help in help.chm -Demo The demo package download at: http://www.link-rank.com/download.htm Demo version adds a string 'VclSkin demo' on form caption, but allows to test all available functions. -History News In 5.30 05/20/2009 *Fix bugs in windows 7. News In 5.25 04/14/2009 *Add xoCaptionButtonHint in skindata.options to hide hint of caption button, to upgrade new version: 1 run uninstall.exe in demo package. 2 compile and install new version. News In 5.20 03/05/2009 *fix problem on hint on caption button. News In 5.14 11/04/2008 *fix unicode problem in delphi 2009 News In 5.12 11/04/2008 *fix bug in hint for caption button News In 5.11 11/03/2008 *support hint for caption button News In 5.10 09/17/2008 *support delphi 2009 News In 5.04 08/16/2008 *fix bug in BCB2007. News In 5.1 05/29/2008 *fix bug in TBitbtn. News In 4.99 05/07/2008 *fix bug in Tprogressbar. News In 4.98 04/23/2008 *fix bug in Tbutton. News In 4.97 04/20/2008 *fix bug in Tlistview. News In 4.96 03/25/2008 *fix bug in Tlistview. News In 4.95 03/13/2008 *fix bug in dll forms. News In 4.94 11/13/2007 *Skip to skin control in Skindata.OnSkinControl event. News In 4.93 11/13/2007 *Support PNGspeedbutton. News In 4.92 11/06/2007 *Fix combobox button problem when form is scaled. News In 4.91 10/02/2007 *Support QuantumGrid 6. News In 4.90 09/03/2007 *Support C++builder 2006, c++builder 2007. News In 4.89 07/26/2007 *Fix problem with Multilizer . News In 4.88 07/18/2007 *Fix form icon problem . News In 4.87 07/10/2007 *Fix problem in Form Caption News In 4.86 06/13/2007 *Fix problem in TDateTimePicker News In 4.85 06/06/2007 *Fix problem in TDateTimePicker News In 4.83 05/18/2007 *Fix problem in Dev Dbtreeview. News In 4.82 05/11/2007 *Improve image quality of form icon. News In 4.81 04/30/2007 *Fix menu border problem. News In 4.80 04/20/2007 *Fix menu border problem in windows2000. News In 4.76 04/11/2007 *Support application Icon updated at runtime. News In 4.75 04/04/2007 *Fix default button problem. News In 4.72 02/27/2007 *Fix form paint problem when cpation changed. News In 4.60 02/09/2007 *Support Help button in form system button. News in 4.55 01/31/2007 *Fix problem that right click caption on Dll form. News in 4.53 01/22/2007 *Fix problem on multi-lines caption header in Listview. News in 4.52 01/11/2007 *Fix problem in DatetimePicker when it resize. News in 4.50 01/03/2007 *Fix problem work with Billenium Effects. News in 4.42 12/06/2006 *skindata.skincontrols option work in window common dialog. News in 4.41 11/13/2006 *fix problem in TImageEnOpendialog. News in 4.40 11/09/2006 *fix problem with Billenium Effects. News in 4.36 10/21/2006 *Fix popupmenu problem in win98 . News in 4.35 10/20/2006 *Fix problem when combobox right-to-left . News in 4.33 10/11/2006 *Fix problem when checkbox and radiobutton is right-to-left reading . News in 4.32 10/03/2006 *Fix problem of button shortcut. News in 4.31 9/25/2006 *Support Toolbarwindow32 in Opendialog. News in 4.30 9/7/2006 *Fix Caption problem in bidiRighttoLeft form. News in 4.25 9/5/2006 *Fix Mainmenu problem in MDIform with bidiRighttoLeft. News in 4.22 8/28/2006 *Fix problem when Menuitem text is right-to-left reading . News in 4.21 8/21/2006 *Fix problem when form caption is right-to-left reading . News in 4.20 8/18/2006 *Fix problem when form Max/Min button is disable. *Change skin file format. News in 4.13 8/14/2006 *unskin dialog when download file in webbrowser. News in 4.12 7/30/2006 *Fix problem when form Max/Min button is disable. News in 4.11 6/25/2006 *Change Grid.fixedcolor when skin file changed. News in 4.10 6/14/2006 *Add BeforeFormSkin and AfterFormSkin event. News in 4.09 6/07/2006 *fix bug in MDIchild when form create and change form caption. News in 4.08 5/25/2006 *(5/26)Fix bug in TSkinControl.GetParentColor . *Change Tabcontrol background color. News in 4.07 5/10/2006 *Fix problem TScrollbar control. News in 4.07 5/5/2006 *Fix problem in Mainmenu. News in 4.06 4/19/2006 *Fix combobox scrollbar problem. News in 4.05 4/18/2006 *Fix scrollbar problem when grid is disable. *Fix Mainmenu problem in Windows95 News in 4.04 4/10/2006 *Fix Mainmenu problem in MDIform. *Fix Menu merge problem in Win98. News in 4.03 4/01/2006 *Fix problem in TCheckbox and TRadiobutton when BiDimode=bdRighttoLeft. *Fix problem when Menuitems have Actions. News in 4.02 3/28/2006 *Fix problem in TSpeedbutton when size is zero. *Support scrollbar in drop-down of combobox. News in 4.01 3/16/2006 *fix problem with trackbar when skin active *support TCategoryButtons in delphi2006 News in 4.0. 3/9/2006 *Fix problem when skin file do not have checkbox image. *Fix bug when click button and move mouse. *Fix bug with TVirtualTreeview. News in 3.99 3/3/2006 *Fix bug when skindata.skinformtype=sfOnlyThisForm *Fix bug in TcxRadioGroup *Fix bug in TDateTimePicker *Fix bug in TMediaPlayer. News in 3.98 2/24/2006 * Support TPageControl with tsButton style. * Fix problem on Mainmenu with ActionList. News in 3.97 2/16/2006 * Fix problem when Groupbox in ScrollBox. *Fix problem with newest TNTcontrol. News in 3.96 2/6/2006 * Fix problem with TTrayIcon. * Fix problem bug with TMainmenu. News in 3.95 1/25/2006 * Fix flicker problem about TSpeedbutton. * Fix flicker problem when form caption change. News in 3.94 1/25/2006 * Fix bug in TPopupMenu. add 'xoMenuBG' in skindata.options to support menuitem with mbBarBreak. News in 3.93 1/18/2006 * Fix bug in TDateTime. News in 3.92 1/12/2006 * Fix paint bug in TTabcontrol. * Fix paint bug in Checkbox and radiobutton without caption . News in 3.91 1/8/2006 * Fix bug in Mainmenur. News in 3.90 1/1/2006 * Fix bug in TrackBar. News in 3.89 12/31/2005 * Fix bug in form with BorderStyle=bsNone. *Fix mainmenu bug in MDIForm. News in 3.88 12/26/2005 *Fix bug in THeaderControl. *Support TcxTreeList, TcxNavigator in Dev express controls. News in 3.87 12/22/2005 *Paint minimized form. *Fix bug in TPageControl. News in 3.85 12/13/2005 *Fix a crush bug. News in 3.84 12/5/2005 *Support TPnbBitBtn. *fix flicker in Tpagecontrol. *Fix GDI leak problem. News in 3.83 12/2/2005 *Fix problem that toolbar Backbround is too dark . News in 3.82 12/1/2005 *Fix bug when form maximize. News in 3.81 11/29/2005 *Support TMediaPlayer control. News in 3.80 11/20/2005 *Fix some skin files. *Fix bug on ImageEn SaveImageEnDialog. News in 3.72 11/10/2005 *Fix bug in TScrollbar when its min is negative. *Fix bug in Tmainmenu. News in 3.71 11/5/2005 *change caption text color to gray when checkbox or radiobutton is disable. *Fix paint problem in Tbitbtn when caption is empty. *Fix bug of changing skin file when Skindata.SkinFormtype = sfOnlyThisForm. News in 3.70 10/27/2005 *Support TAdvPageControl. *Support TRzMenuButton, TcxButton with cxbkDropDownButton. *work with RECREATEWND message for skined control has scrollbar. *Fix a memory leak bug. *Fix paint bug for TPagecontrol in win95. News in 3.65 10/21/2005 *Add TSkindata.Options.xoMDIChildBorder which do not skin MDIChild form's border. News in 3.64 10/19/2005 *Fix problem when skindata.skincontrols.xcMainMenu is flase. News in 3.63 10/15/2005 *Support THeaderControl. News in 3.62 10/13/2005 *fix bug in SystemMenu. News in 3.61 10/11/2005 *fix bug in TcxDbCheckbox. *fix paint problem in Tcheckbox when Alignment is taLeftJustify. News in 3.60 10/10/2005 *Vclskin can run in Win95. News in 3.52 10/6/2005 *Fix paint problem of form border. News in 3.51 10/4/2005 *Fix paint problem in checkbox with big image. News in 3.50 9/25/2005 *Support Mouse Hover in Scrollbar. *Add Mouse thumb gripper in Scrollbar. News in 3.41 *Fix some problem in Button when mouse move. News in 3.40 2005.9.21 *Support Hover state in Header control. *Improve on TrackBar *Fix problem to unskin radiogroup. News in 3.38 2005.9.13 *Fix icon problme in MDIChild. News in 3.37 2005.9.12 *Fix font color problem in TButton when button is focused. News in 3.36 2005.9.9 *Fix font color problem in Tgroupbox,radiobutton,checkbox. News in 3.35 2005.9.5 *Support TGroupbox font color. News in 3.34 2005.8.31 *Fix paint problem in Trackbar when skin file change. News in 3.33 2005.8.29 *Fix problem in TcxDBCheckbox. News in 3.32 2005.8.25 *Add close button on TPageControl. News in 3.31 *fix problem when righ click form caption that BorderIcons:=[] News in 3.30 *fix problem that show normal window border when windows first show. *fix resize problem when form border is bsSingle. News in 3.29 *System menu is NOT only English.It support Language in windows. *Fix some problem in DLL applicaton. News in 3.28 * fix paint bug in checkbox and radiobutton in windows common dialog. News in 3.27 *fix bug in TTntDateTimePicker. *fix paint problem in TPageControl. News in 3.26 *Support Popupmenu in TFrame. News in 3.25 * fix Icon problem in MDIChild form. * fix caption paint problem in MDIForm. News in 3.24 * Fix Icon problem in MDIChild form. * fix paint problem in Tbitbtn. * Add feature that Skin file Preview image saved in skin-builder. * Add xcTrackbar and xcSpin. News in 3.23 * Support wordwrap in Bitbtn and speedbutton. * Fix scrollbar problem in TImageScrollBox. News in 3.22 * fix transparent problem in button. News in 3.21 * Fix paint problem in TSpidEdit. * Support owner-MeasureItem event in Popupmenu. News in 3.20 * support toolbar background. * support workwrap in checkbox and radiobutton. News in 3.14 *fix mainmenu merge problem . *fix flicker problem in transparent background . News in 3.13 *fix scrollbar problem when form move. *fix bug in DLL form. *fix Edit control focus problem in MDIChild. *fix formresize problem when skin file change. News in 3.12 * Add Focus border on checkbox,radiobutton,button. * Support Transparent Background on Checkbox,Radiobutton,Groupbox. * Support WS_EX_APPWINDOW style. * fix MDIchild problem in TBX. * improve on RzRadiobutton. News in 3.11 *Support runtime package. *support ALT,ALT-Space. *support hint for scrollbar control *fix Z-order problem when skin change. *fix shortcut problem. News in 3.10 *Support TBX. *Support TNT MDIChild Form. *Support more FastReprt button control. News in 3.08 *Fix problem in TOpenImageEnDialog. *Paint Border in scrollbar control. *Fix checkbox paint problem in Dibiright *Fix Tscrollbox problem. *Support LMD Elpack. *Fix problem that Control without parent. *Fix bug in skin file change. News in 3.07 *Fix problem when BiDiRight Mainmenu popup. *Fix bug in 3.06,3.05 when skin remove at runtime. News in 3.06 *Fix bug in C++Builder. *Fix bug in scrollbar resize. *Fix bug in Delphi7 XPmanifest component. News in 3.05 *Fix bug when move controls in different forms. *Fix problem in TStatusbar that is simple and DiBiRight. News in 3.04 *Fix Tscrollbox problem in delphi5. *Fix Mainmenu display problem in BIDIRight. *Fix font color problem in TSpeedbutton when it is disable. *Fix bug in TntCombobox. *Fix skinfile mxskin59.skn when form is maximized. News in 3.03 *Fix bug in dockable form. *Support Tbutton onMouseDown event. News in 3.02 *Fix Combobx problem in BIDIRight. *Fix MOUSE WHEEL problem in Tlistbox. *Fix Scrollbar problem when control is invisible. News in 3.01 *Fix problem in Inherited-MDIchild. News in 3.0 *Scrollbar flicker problem fixed. *Redundant separator bars in menu are automatically removed. *Add xoMDIScrollbar to show scrollbar in MDIClient area. News in 2.77 * Support TspinButton. * Support TRzDBCheckbox. * Fix paint problem when MDIform lost focus. * Fix AV bug in application close; * Fix bug when change skin file in multi-skins application. * Fix problem about skin delay. News in 2.76 * 4 new skin file released. * fix some bug in Opendialog. News in 2.75 * Fix bugs in IP4000 combobox * Add install.exe and uninstall.exe * Add "embedscrollbar" in Skindata.skin3rd to support TAdvpanelGroup's scrollbar. * Fix Colorpicker Popupmenu problem in WwRichEdit form. * Support SpinEdit now. * Fix TScrollbox problem in delphi5 or c++builder5. News in 2.74 * Delphi 2005 support. * Enable/Disable skin control at runtime. * Fix bug in MDIForm menu merge. * Add "xcMenuitem" in skincontrols property. * skip to skin QuickReport preivew form. News in 2.73 * Fix bugs in MDIForm when MDIChild is maximized. * Fix bug of form Caption in Chinese. News in 2.72 * Support TNT Unicode Controls . * Support menu in Tookbar2000 . * fix bug in MDIform close. * fix bug in TScrollbar control. * fix bug in TDateTimePicker when TDateTimePicker.kind is dtkTime. News in 2.71 * fix bugs of MDIChild form. * support progressbar with pbVertical style. * support preset color in skin file. * support speedbutton in skin3rd property. News in 2.70 * fix bug in embeded form. * fix bug of MDIform with Expressbar. * fix bug of form caption refresh when skin change. * fix trackbar refresh bug when skin change. * fix Quickreport , reprotbuilder preview form problem. * Support Raize TRzbitbtn with ImageList. * Support TComboboxex. News in 2.69 *Support Raize TRzbitbtn with glyph. *Support TMS TAdvMemo. *Fix bug of mainmenu shortcut in MDIform. News in 2.68 *Fix bugs in mainmenu. *Fix Icon bug in dialog. News in 2.67 *Fix DBEdit paint bug. *Fix Icon paint bug. News in 2.66 *Use Memory Inifile. *Fixed bug in multiskin demo. *Fixed MDIform Tile and Cascade problem. *Fixed bugs in default button and disable button. *Add LMD tools 7.0 demo. News in 2.65 *Paint with gray glyph when Speendbtn is disable. *Fixed Topendialog resize problem *Fixed shortcut problem in menuitem. *Add Raized component demo. *Add QuantumGrid4 demo. *Add IP4000 demo. News in 2.62 *Paint TGroupbox with new style. *Fixed bug in painting TSpeedbutton pictures. *Fixed bug in application closed. News in 2.60 *Support Arabic language, BiDiMode is righttoleft. *Fixed some bugs when application closed. News in 2.55 *Fixed bug that Tspeedbutton destory at runtime. *Improve performance when change menutitem at runtime. *Fixed OpenDialog bug. News in 2.50 *Support LMD tools. *Fixed bug of checkbox that is disabled . *Add TSkindata.Skin3rd property to add 3rd control easily. News in 2.45 *Some bugs fixed. *Improve compatibility with Billenium effects. News in 2.4 *Support to skin an application but keep the menu bar and title bar the default Windows standard. *DBCheckbox bug fixed. *Fixed bug in cascade,tile command in MIDform. *Bug with minimized state when form created. *Suport ReportBuilder News in 2.3 *Support TUpDown and TSpinEdit. *Support TrackBar. *Restore form size when remove skin. *Fix more bugs. News in 2.25 *Fix bug with QuickReport and FastReport. *Fix bug in Tstatusbar. *Fix bug in Application. News in 2.20 *Support Header control in TlistView. *Fix Menuitem ShortCut bug. *Fix bug that change windows Z-Order when skin change at runtime. *Support Tframe created at runtime. News in 2.10 *Fix Scrollbar drag thumb problem. News in 2.05 *Support multi-skindata in application,Mainform and messagebox can use different skindate. *Nested form support. *Fixed Title flicker problem when form resize. *Support Mainmenu change at runtime. News in 2.0 *skin kinds of windows in your project, Delphi forms,MDIform and common Windows dialogs (MsgBox,Open/Save,Font,Print), even the Exception MsgBox. *Enable/Disable skin at runtime. *fixed many bugs in MDIform. *system menu enchanced.
Delphi VCLSkin 3.81 官方试用版-HistoryNews in 3.81 11/29/2005*Support TMediaPlayer control.News in 3.80 11/20/2005*Fix some skin files.*Fix bug on ImageEn SaveImageEnDialog.News in 3.72 11/10/2005*Fix bug in TScrollbar when its min is negative.*Fix bug in Tmainmenu.News in 3.71 11/5/2005*change caption text color to gray when checkbox or radiobutton is disable.*Fix paint problem in Tbitbtn when caption is empty.*Fix bug of changing skin file when Skindata.SkinFormtype = sfOnlyThisForm.News in 3.70 10/27/2005*Support TAdvPageControl.*Support TRzMenuButton, TcxButton with cxbkDropDownButton.*work with RECREATEWND message for skined control has scrollbar.*Fix a memory leak bug.*Fix paint bug for TPagecontrol in win95.News in 3.65 10/21/2005*Add TSkindata.Options.xoMDIChildBorder which do not skin MDIChild form's border.News in 3.64 10/19/2005*Fix problem when skindata.skincontrols.xcMainMenu is flase.News in 3.63 10/15/2005*Support THeaderControl.News in 3.62 10/13/2005*fix bug in SystemMenu.News in 3.61 10/11/2005*fix bug in TcxDbCheckbox.*fix paint problem in Tcheckbox when Alignment is taLeftJustify.News in 3.60 10/10/2005*Vclskin can run in Win95.News in 3.52 10/6/2005*Fix paint problem of form border.News in 3.51 10/4/2005*Fix paint problem in checkbox with big image.News in 3.50 9/25/2005*Support Mouse Hover in Scrollbar.*Add Mouse thumb gripper in Scrollbar.News in 3.41*Fix some problem in Button when mouse move.News in 3.40 2005.9.21*Support Hover state in Header control.*Improve on TrackBar*Fix problem to unskin radiogroup.News in 3.38 2005.9.13*Fix icon problme in MDIChild.News in 3.37 2005.9.12*Fix font color problem in TButton when button is focused.News in 3.36 2005.9.9*Fix font color problem in Tgroupbox,radiobutton,checkbox.News in 3.35 2005.9.5*Support TGroupbox font color.News in 3.34 2005.8.31*Fix paint problem in Trackbar when skin file change.News in 3.33 2005.8.29*Fix problem in TcxDBCheckbox.News in 3.32 2005.8.25*Add close button on TPageControl.News in 3.31*fix problem when righ click form caption that BorderIcons:=[]News in 3.30*fix problem that show normal window border when windows first show.*fix resize problem when form border is bsSingle.News in 3.29*System menu is NOT only English.It support Language in windows.*Fix some problem in DLL applicaton.News in 3.28* fix paint bug in checkbox and radiobutton in windows common dialog.News in 3.27*fix bug in TTntDateTimePicker.*fix paint problem in TPageControl.News in 3.26*Support Popupmenu in TFrame.News in 3.25* fix Icon problem in MDIChild form.* fix caption paint problem in MDIForm.News in 3.24* Fix Icon problem in MDIChild form.* fix paint problem in Tbitbtn.* Add feature that Skin file Preview image saved in skin-builder.* Add xcTrackbar and xcSpin.News in 3.23* Support wordwrap in Bitbtn and speedbutton.* Fix scrollbar problem in TImageScrollBox.News in 3.22* fix transparent problem in button.News in 3.21* Fix paint problem in TSpidEdit.* Support owner-MeasureItem event in Popupmenu.News in 3.20* support toolbar background.* support workwrap in checkbox and radiobutton.News in 3.14*fix mainmenu merge problem .*fix flicker problem in transparent background .News in 3.13*fix scrollbar problem when form move.*fix bug in DLL form.*fix Edit control focus problem in MDIChild.*fix formresize problem when skin file change.News in 3.12* Add Focus border on checkbox,radiobutton,button.* Support Transparent Background on Checkbox,Radiobutton,Groupbox.* Support WS_EX_APPWINDOW style.* fix MDIchild problem in TBX.* improve on RzRadiobutton.News in 3.11*Support runtime package.*support ALT,ALT-Space.*support hint for scrollbar control*fix Z-order problem when skin change.*fix shortcut problem.News in 3.10*Support TBX.*Support TNT MDIChild Form.*Support more FastReprt button control.News in 3.08*Fix problem in TOpenImageEnDialog.*Paint Border in scrollbar control.*Fix checkbox paint problem in Dibiright*Fix Tscrollbox problem.*Support LMD Elpack.*Fix problem that Control without parent.*Fix bug in skin file change.News in 3.07*Fix problem when BiDiRight Mainmenu popup. *Fix bug in 3.06,3.05 when skin remove at runtime. News in 3.06*Fix bug in C++Builder.*Fix bug in scrollbar resize.*Fix bug in Delphi7 XPmanifest component.News in 3.05*Fix bug when move controls in different forms.*Fix problem in TStatusbar that is simple and DiBiRight.News in 3.04*Fix Tscrollbox problem in delphi5.*Fix Mainmenu display problem in BIDIRight.*Fix font color problem in TSpeedbutton when it is disable.*Fix bug in TntCombobox.*Fix skinfile mxskin59.skn when form is maximized.News in 3.03*Fix bug in dockable form.*Support Tbutton onMouseDown event.News in 3.02*Fix Combobx problem in BIDIRight.*Fix MOUSE WHEEL problem in Tlistbox.*Fix Scrollbar problem when control is invisible.News in 3.01*Fix problem in Inherited-MDIchild.News in 3.0*Scrollbar flicker problem fixed.*Redundant separator bars in menu are automatically removed.*Add xoMDIScrollbar to show scrollbar in MDIClient area.
第1 章 Delphi 集成开发环境..........1 1.1 Delphi 6.0 简介............................................ 1 1.2 Delphi 可视化开发环境简介...................... 2 1.2.1 对象编辑器(Object Inspector)....3 1.2.2 工程管理器(Project Manager)....5 1.2.3 代码编辑器......................................5 1.2.4 CPU 观察窗口.................................6 1.2.5 对象浏览器......................................7 1.3.1 编程环境设置..................................7 1.3.2 自定义工具栏..................................9 1.3.3 编辑环境设置................................10 1.3.4 工程设置........................................11 1.4 一个简单的Delphi 程序........................... 12 1.5 本章小结.................................................... 13 第2 章 Object Pascal 语言..........14 2.1 Object Pascal 语言基础............................. 14 2.1.1 Object Pascal 入门.........................14 2.1.2 注释语句........................................15 2.1.3 标识符(Identifier) .....................16 2.1.4 保留字(Reserved Word)和指令字 (Directive) ..........................................16 2.1.5 数据类型........................................17 2.1.6 运算符(Operators)..........................27 2.1.7 语句................................................31 2.1.8 过程与函数....................................35 2.1.9 作用范围........................................42 2.1.10 规范化命名..................................43 2.2 Object Pascal 语言的面向对象技术......... 43 2.2.1 对象和类的概念............................44 2.2.2 Object Pascal 中类的定义.............46 2.2.3 方法...............................................51 2.2.4 多态性...........................................54 2.2.5 类运算符.......................................57 2.2.6 类方法和类引用............................58 2.2.7 单元文件.......................................61 2.2.8 TObject:所有对象的祖先...........63 2.3 结构化异常处理........................................64 2.3.1 try...except 语句和try...finally 语句 ................................................................65 2.3.2 raise 语句.......................................67 2.3.3 异常类...........................................67 2.4 方法与技巧................................................67 2.4.1 设置代码模板................................67 2.4.2 设置提示信息................................68 2.5 本章小结....................................................69 第3 章 常见组件编程............... 70 3.1 窗体和组件................................................70 3.1.1 概述...............................................70 3.1.2 窗体(Form)...............................71 3.1.3 组件(Component) .....................74 3.1.4 组件的使用....................................75 3.2 文本输入类组件........................................78 3.2.1 TEdit 组件.....................................78 3.2.2 TMemo 组件..................................78 3.2.3 TMaskEdit 组件.............................78 3.2.4 TRichEdit.......................................79 3.2.5 TLabel 组件...................................79 ·ii· 3.2.6 TStaticText .....................................79 3.2.7 几点说明..........................................80 3.3 按钮类组件................................................ 80 3.3.1 TButton 组件..................................81 3.3.2 TBitBtn 组件..................................81 3.3.3 TSpeedButton 组件........................81 3.3.4 TCheckBox 组件组件....................81 3.3.5 TRadioButton 组件........................82 3.4 列表类组件................................................ 82 3.4.1 TListBox 组件................................82 3.4.2 TComboBox 组件..........................83 3.4.3 TTreeView 组件.............................83 3.4.4 TListView 组件..............................84 3.4.5 TImageList 组件............................85 3.4.6 TCheckListBox 组件......................85 3.4.7 TDateTimePicker 组件...................85 3.5 表格类组件................................................ 85 3.5.1 TDrawGrid 组件............................85 3.5.2 TStringGrid 组件...........................86 3.5.3 TDBGrid 组件................................86 3.6 刻度和进度类组件.................................... 86 3.6.1 TProgressBar 组件.........................87 3.6.2 TStatusBar......................................87 3.7 分组组件.................................................... 87 3.7.1 TGroupBox 组件............................87 3.7.2 TRadioGroup 组件.........................87 3.7.3 TPanel 组件....................................87 3.7.4 TScrollBox 组件............................87 3.7.5 TTabControl 组件..........................88 3.7.6 TPageControl 组件.........................88 3.7.7 THeaderControl 组件.....................88 3.7.8 容器组件组件................................89 3.8 特殊输入组件............................................ 89 3.8.1 TScrollBar 组件.............................89 3.8.2 TTrackBar 组件..............................90 3.8.3 TUpDown 组件..............................91 3.8.4 THotKey 组件................................91 3.9 菜单的使用................................................ 91 3.9.1 主菜单............................................92 3.9.2 鼠标右键弹出式菜单....................93 3.9.3 使用菜单模板................................93 3.10 工具栏和状态栏......................................94 3.10.1 ToolBar 组件................................94 3.10.2 TCoolBar 组件.............................94 3.10.3 TControlBar 组件........................95 3.10.4 TStatusBar 组件...........................95 3.11 编程实例..................................................95 3.11.1 小型计算器..................................95 3.11.2 文本编辑器的实现....................108 3.12 本章小结................................................ 116 第4 章 键盘和鼠标事件............ 117 4.1 事件概述.................................................. 117 4.2 键盘事件处理.......................................... 117 4.2.1 常用的键盘事件.......................... 117 4.2.2 特殊的键盘事件.......................... 119 4.3 鼠标事件处理..........................................121 4.3.1 常用鼠标事件..............................121 4.3.2 拖曳事件.....................................122 4.4 本章小结..................................................124 第5 章 打印...................... 125 5.1 TPrinter 对象............................................125 5.2 打印操作常用函数..................................126 5.3 打印操作..................................................128 5.3.1 打印文本.....................................128 5.3.2 打印位图.....................................129 5.3.3 打印TMemo 组件中的内容.......130 5.3.4 打印RTF 格式的文本................131 5.4 打印技巧..................................................131 5.4.1 获取显示当前打印机的分辨率..131 5.4.2 尽量不要使用AssignPrn ............131 5.4.3 用打印机的点数做度量单位......131 5.4.4 将打印结果直接送到打印机......132 5.4.5 获取默认打印机的信息..............132 5.5 本章小结..................................................132 第6 章 文件管理.................. 133 6.1 文件类型和标准过程...............................133 6.1.1 文本文件(text file).......................133 6.1.2 类型文件(typed file)....................134 ·iii· 6.1.3 无类型文件..................................136 6.1.4 文件对话框组件..........................137 6.1.5 Win3.1 相关组件.........................139 6.2 文件管理常用函数和过程.......................139 6.2.1 文件操作常用函数和过程..........139 6.2.2 目录操作常用函数和过程..........143 6.2.3 驱动器操作常用函数..................146 6.2.4 文件名操作常用函数..................148 6.3 本章小结...................................................150 第7 章 图形与图像................151 7.1 常用图形对象及简单应用.......................151 7.1.1 画布对象(TCanvas Object) ....151 7.1.2 画笔对象(TPen Object) ..........154 7.1.3 画刷对象(TBrush Object).......158 7.1.4 颜色类型(TColor type)...........160 7.1.5 其它属性......................................161 7.2 基本图形的绘制.......................................162 7.2.1 直线的绘制..................................162 7.2.2 矩形的绘制..................................163 7.2.3 椭圆的绘制..................................164 7.2.4 弧线的绘制..................................164 7.2.5 多边形的绘制..............................165 7.2.6 文本的输出..................................166 7.2.7 插入图像......................................167 7.3 画板程序开发...........................................168 7.3.1 窗体设计......................................168 7.3.2 代码设计......................................172 7.3.3 菜单代码设计..............................177 7.4 动画绘图效果...........................................182 7.5 常用图像对象...........................................185 7.5.1 TGraphics 类................................185 7.5.2 TPicture 类...................................185 7.5.3 位图对象(TBitmap Object) ....186 7.5.4 TImage 组件................................187 7.6 简单图像浏览器的实现...........................188 7.7 本章小结...................................................195 第8 章 多媒体编程技术............196 8.1 多媒体技术简介.......................................196 8.2 图像格式的处理.......................................199 8.2.1 位图.............................................199 8.2.2 JPEG 文件...................................201 8.3 特殊图像显示效果的实现.......................203 8.3.1 基本原理.....................................204 8.3.2 调用BitBlt...................................204 8.3.3 调用CopyRect.............................205 8.3.4 效果与算法实现..........................206 8.4 利用图像控件实现动画效果...................233 8.4.1 TImage 组件变换法....................234 8.4.2 TPanel 组件变换法.....................235 8.4.3 Canvas 画面变换法.....................235 8.5 音频和视频文件的播放...........................236 8.5.1 WAV 与MIDI 文件简介.............236 8.5.2 什么是AVI..................................238 8.5.3 TMediaPlayer 控件的使用..........240 8.6 媒体播放器的实现..................................243 8.7 本章小结..................................................248 第9 章 OpenGL 开发三维图形....... 250 9.1 OpenGL 的基础.......................................250 9.1.1 OpenGL 的功能...........................250 9.1.2 创建OpenGL 应用程序的方法..251 9.1.3 OpenGL 变量和函数的约定.......256 9.1.4 OpenGL 的初始化.......................257 9.2 OpenGL 基本图形的绘制........................260 9.2.1 图形的颜色..................................261 9.2.2 简单图形的绘制..........................262 9.2.3 简单二次曲面..............................268 9.3 OpenGL 中的变换...................................273 9.3.1 矩阵操作过程................................273 9.3.2 投影变换.....................................274 9.3.3 几何变换矩阵..............................277 9.4 光照和纹理..............................................281 9.4.1 光照和光源过程及应用..............281 9.4.2 材质和光照模型..........................282 9.4.3 纹理.............................................284 9.5 本章小结..................................................290 第10 章 多线程应用程序........... 291 10.1 进程与线程..............................................291 10.1.1 进程和线程的概念....................291 ·iv· 10.1.2 线程调度....................................292 10.2 TThread 对象..........................................292 10.2.1 Tthread 类的属性.......................292 10.2.2 TThread 类的方法.....................293 10.2.3 TThread 类的事件.....................294 10.2.4 创建线程类................................294 10.2.5 线程的初始化操作....................295 10.2.6 实现线程对象的功能................295 10.3 线程的同步.............................................296 10.4 线程的优先级.........................................302 10.5 本章小结.................................................302 第11 章 动态链接库...............303 11.1 概述.........................................................303 11.1.1 DLL 的概念...............................303 11.1.2 静态链接与动态链接................304 11.1.3 使用DLL 的目的......................305 11.2 创建动态链接库.....................................306 11.3 使用动态链接库.....................................309 11.4 本章小结.................................................310 第12 章 Delphi 数据库的基本概念...311 12.1 数据库系统概述.....................................311 12.1.1 使用数据库................................311 12.1.2 数据库管理系统(DBMS).....311 12.1.3 数据库应用程序........................312 12.2 Delphi 的数据库特性及功能简介.........313 12.2.1 Delphi 的数据库特性................314 12.2.2 Delphi 可以访问的数据源 (DataSource) ....................................315 12.2.3 本地数据库和远程数据库........316 12.3 Delphi 数据库应用程序的体系结构.....317 12.3.1 选择合适的体系结构................318 12.3.2 可伸缩性....................................319 12.3.3 单层的数据库应用程序..........320 12.3.4 两层的数据库应用程序............320 12.3.5 多层的数据库应用程序............321 12.3.6 数据访问组件............................321 12.3.7 数据控制组件............................323 12.4 Delphi 数据库应用程序的开发方法和步骤324 12.4.1 概述............................................324 12.4.2 数据库应用程序的开发步骤....325 12.4.3 交付数据库应用程序................326 12.4.4 安装BDE ..................................327 12.4.5 安装SQL Link...........................328 12.5 本章小结................................................330 第13 章 简单数据库应用程序的创建. 331 13.1 简单的基于单表的数据库应用.............331 13.1.1 选择相关的组件........................331 13.1.2 设置组件的属性........................331 13.1.3 运行程序...................................333 13.2 利用TDBNavigator 组件创建存取程序334 13.2.1 创建应用程序窗体....................334 13.2.2 使用TDBNavigator 组件移动记录 指针......................................................335 13.2.3 定制TDBNavigator 组件..........336 13.3 创建主要──明细数据库应用程序.....336 13.3.1 一对多关系的主要──明细型数据 库应用程序...........................................337 13.3.2 一对多——多关系的数据库应用 ..............................................................338 13.4 字段对象的使用......................................339 13.4.1 字段对象的类型........................340 13.4.2 创建永久性的字段对象............340 13.4.3 字段对象的属性设置................341 13.4.4 字段对象的访问........................343 13.4.5 设定字段对象的显示格式........346 13.4.6 自定义字段以及计算字段对象的创 建..........................................................347 13.5 查询数据库中的记录.............................350 13.5.1 使用GotoKey 方法查找数据记录 ..............................................................350 13.5.2 使用FindKey 方法查找数据库中的 记录......................................................352 13.5.3 利用GotoNearest 和FindNearest 执 行不精确查找.......................................353 13.6 修改数据库中的记录.............................354 13.6.1 Edit 方法Post 方法...................355 13.6.2 实现异常保护的try...finally 语句356 13.7 插入和删除记录....................................359 ·v· 13.7.1 逐步插入方法............................360 13.7.2 调用InsertRecord 插入记录......360 13.8 输入数据的有效性验证.........................363 13.9 本章小结.................................................366 第14 章 数据交换.................367 14.1 Windows 剪贴板及其应用.....................367 14.1.1 概述............................................367 14.1.2 TClipboard 的属性和方法.........367 14.1.3 文本与Windows 剪贴板...........370 14.1.4 图形与剪贴板............................373 14.2 数据的动态交换.....................................374 14.2.1 DDE 概述...................................374 14.2.2 DDE 客户端应用程序...............375 14.2.3 服务端应用程序........................381 14.3 对象的链接与嵌入.................................383 14.3.1 OLE 技术概述...........................383 14.3.2 TOleContainer 的属性...............385 14.3.3 TOleContainer 的方法...............387 14.4 多格式文件浏览器.................................389 14.4.1 OLE 服务器的菜单和工具栏...389 14.4.2 浏览器设计................................391 14.5 本章小结.................................................395 第15 章 应用程序的分发和包装.....396 15.1 应用程序包装技巧.................................396 15.1.1 计算机的关机或重新启动........396 15.1.2 禁止应用程序的第二实例启动397 15.1.3 封面窗口...................................398 15.1.4 椭圆窗口启动封面....................399 15.1.5 读写Windows 95 注册文件......399 15.1.6 创建应用程序组和图标............400 15.2 应用程序的分发....................................401 15.3 本章小结................................................403 第16 章 其它编程技巧............. 404 16.1 获取Windows 版本信息.......................404 16.2 获取CPU 信息.......................................405 16.3 启动屏幕保护........................................407 16.4 使窗口标题栏闪烁................................407 16.5 获取窗口标题栏中的文字.....................408 16.6 使窗口背景颜色渐变.............................409 16.7 将WAV 文件做到EXE 文件里...........410 16.8 按字段为TDBGrid 着色....................... 411 16.9 使用资源文件........................................413 16.10 具有不同字体的对话框.......................417 16.11 显示旋转字体.......................................418 16.12 本章小结..............................................419 附录1 Inprise Delphi 属性、函数、事 件参考.................... 420 附录2 Delphi 站点整理............ 429 附录3 Delphi 问题集.............. 431 附录4 Delphi 编译错误信息中英文 对照...................... 435

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧