最新修改版树形表格(treeviewgrid)控件代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
最新修改版树形表格(treeviewgrid)控件代码
unit srListview;
interface
uses
SysUtils, windows, Classes, Controls, ComCtrls, Types, messages, Graphics,
imgList, mask, forms,
stdCtrls;
type
TdataType = (dtString, dtInteger, dtFloat, dtPercentage);
Tsrlistview = class(TListView)
private
{ Private
declarations }
FhdHandle: integer;
FHdNewProc: pointer;
FHdOldProc: pointer;
FTextoffSet: integer;
FclSelected: TColor;
FclTitleEnd: TColor;
FclTitleBegin: TColor;
bmp:
TbitMap;
FclBegin:
TColor;
FclFrame:
TColor;
function
GetHeaderSectionRect(Index: Integer): TRect;
procedure
HeaderProc(var Message: TMessage);
procedure
DrawHeaderSection(Cnvs: TCanvas; Column: TListColumn; index:
integer;
Active, Pressed: Boolean; R: TRect);
procedure
WMParentNotify(var Message: TWMParentNotify); message WM_PARENTNOTIFY;
procedure
WMNCPAINT(var Message: TWMNCPAINT); message WM_NCPAINT;
procedure
SetclSelected(const Value: TColor);
procedure
SetclTitleBegin(const Value: TColor);
procedure
SetclTitleEnd(const Value: TColor);
procedure
SetTextoffSet(const Value: integer);
procedure
SetclBegin(const Value: TColor);
procedure
SetclFrame(const Value: TColor); protected
{ Protected
declarations }
procedure
Drawheader(Dc: HDc);
public
{ Public
declarations }
procedure
invalidate; override;
constructor
Create(Aowner: TComponent); override;
destructor
Destroy; override;
published
{ Published
declarations }
property
clTitleBegin: TColor read FclTitleBegin write SetclTitleBegin;
property
clTitleEnd: TColor read FclTitleEnd write SetclTitleEnd;
property
clSelected: TColor read FclSelected write SetclSelected;
property
TextoffSet: integer read FTextoffSet write SetTextoffSet;
property
clBegin: TColor read FclBegin write SetclBegin;
property
clFrame: TColor read FclFrame write SetclFrame;
end;
TcolTreeView = class;
TTreeColumn = class(TCollectionItem) private
FColWidth:
integer;
FTitle:
string;
FColor:
TColor;
FTransParent: boolean;
FAlign:
TAlignment;
FTextoffset:
integer;
FCharCase: TEditCharCase;
FallowSort:
boolean;
FdataType: TDataType;
procedure
SetColor(const Value: TColor);
procedure
SetTitle(const Value: string);