界面库

整理代码
This commit is contained in:
JianjunLiu 2022-11-11 10:32:56 +08:00
parent 6fbb499871
commit dcf12aa9dc
5 changed files with 68 additions and 36 deletions

View File

@ -1187,6 +1187,8 @@ type TBatSynHigLighter = class(TSynHighLighter)
end
return r;
end
private
FSyns;
end
type TINISynHigLighter = class(TSynHighLighter)
function Create(AOwner);

View File

@ -6,6 +6,7 @@ unit tslvcl;
**}
{
更新说明
20221111整理代码,实现发现版本
20220328整理代码
20200721 修改设计器中属性的显示控制,将属性持久化和设计器分离
20200515 整理代码去掉一些不需要使用的代码
@ -3338,7 +3339,6 @@ type TTlvnActiveEvent=class(tuieventbase)
begin
inherited;
FNmList := array();
//FNmList := new ttagNMLISTVIEW(l);
end
property hdr index "hdr" read _getvalue_ write _setvalue_;
property iitem index "iitem" read _getvalue_ write _setvalue_;
@ -3349,33 +3349,7 @@ type TTlvnActiveEvent=class(tuieventbase)
property ptaction index "ptaction" read _getvalue_ write _setvalue_;
property lparam index "lparam" read _getvalue_ write _setvalue_;
end
{type ttagNMLISTVIEW=class(tslcstructureobj)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("hdr","user",
(
("hwndfrom","intptr",0),
("idfrom","intptr",0),
("code","int",0))),
("iitem","int",0),
("isubitem","int",0),
("unewstate","int",0),
("uoldstate","int",0),
("uchanged","int",0),
("ptaction","int[2]",
(0,0)),
("lparam","intptr",0)));
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
end}
type TGridCtl = class(TcustomGridCtl)
function create(AOwner);override;
begin
@ -3385,8 +3359,7 @@ type TGridCtl = class(TcustomGridCtl)
begin
return array("name","height","width","left","top","border","anchors","align","font","color","parentcolor","parentfont",
"autoscroll","columncount","itemcount",
"itemheight","mousesizecell","fixedrows","fixedcolumns",
"columnheader","columns",
"itemheight","mousesizecell","fixedrows","fixedcolumns","mergeinfo",
"ondrawcell","onhitcellsizer","onmousewheel","onmousemove",
"onmousedown","onmouseup","ondblclick",
"onkeyup","onkeydown","onkeypress","onnotification");
@ -8412,9 +8385,8 @@ begin
//return "1.1.1.20200731_beta";
//return "1.1.2.20210915_beta";
//return "1.1.3.20220210_beta";
return "1.1.4.20221010_beta";
return "1.1.4.20221111";
end
function ExitMessageLoop();
begin
{**

View File

@ -41,6 +41,7 @@ type TcustomGridCtl = class(tcustomscrollcontrol) //
begin
InvalidateRect(nil,false);
end
property cellsizerstate read fcellsizerstate;//调整大小
public
function IncPaintLock();
begin
@ -723,11 +724,26 @@ type TcustomGridCtl = class(tcustomscrollcontrol) //
end
return r;
end
function CleanMergeCells();
function CleanMergeCells(rc);
begin
{**
@explan(说明) 清空合并信息 %%
@param(rc)(array(行,列))指定清除的合并格子 %%
**}
if ifarray(rc) and rc[0]>=0 and rc[1]>=0 then
begin
di := -1;
for i,v in FMergers do
begin
if v.CellInMerge(rc[0],rc[1])then
begin
di:=i;
break;
end
end
if di>=0 then deleteindex(FMergers,di,1);
return ;
end
FMergers := array();
end
function Recycling();override;
@ -747,14 +763,28 @@ type TcustomGridCtl = class(tcustomscrollcontrol) //
property VariableRows read FVariableRows write SetVariableRows;
property ondrawcell:eventhandler read Fondrawcell write Fondrawcell;
property onhitcellsizer:eventhandler read fonhitcellsizer write fonhitcellsizer;
property mergeinfo:tsl read GetMergeInfo write setmergeinfo;
{**
@param(ItemCount)(integer) 行数 %%
@param(ColumnCount)(integer) 列数 %%
@param(ItemHeight)(integer) 行高,固定高度情况下使用 %%
@param(MouseSizeCell)(bool) 鼠标改变列宽 %%
@param(FixedRows)(integer) 固定的行数作为列标 %%
@param(FixedColumns)(integer) 固定的列数作为列标 %%
@param(mergeinfo)(array) 合并信息,二维数组,每行为一个合并信息array(开始行,开始列,截止行,截止列) %%
@param(onhitcellsizer)(function[o,e]) 鼠标移动到边线时候回调,e.wparam 1,2 表示行列,e.lparam 代表对于序号,e.skip是的值作为返回表示是否忽略调整大小 %%
@param(ondrawcell)(function[o,e]) 绘制回调,e.row 行号,e.col 列号,e.rec 绘制区域,e.canvas 绘画对象 %%
**}
protected
property cellsizerstate read fcellsizerstate;//调整大小
private
function setmergeinfo(rcs);
begin
FMergers := array();
for i,v in rcs do
begin
MergeCells(v);
end
InvalidateRect(nil,false);
end
function callondragcellsize(i,r);
begin
if fonhitcellsizer then

View File

@ -1478,6 +1478,33 @@ end
*)
{type ttagNMLISTVIEW=class(tslcstructureobj)
private
static SSTRUCT;
class function getstruct()
begin
if not SSTRUCT then SSTRUCT := MemoryAlignmentCalculate(array(
("hdr","user",
(
("hwndfrom","intptr",0),
("idfrom","intptr",0),
("code","int",0))),
("iitem","int",0),
("isubitem","int",0),
("unewstate","int",0),
("uoldstate","int",0),
("uchanged","int",0),
("ptaction","int[2]",
(0,0)),
("lparam","intptr",0)));
return SSTRUCT;
end
public
function create(ptr)
begin
inherited create(getstruct(),ptr);
end
end}
initialization

View File

@ -767,7 +767,8 @@ type TcustomTreeCtlNode = class(TVirtualListItem)
@param(ModifyChildrenChecked)(bool) 勾选的时候是否修改自己的勾选状态 %%
@param(MouseCanChecked)(bool) 能否使用鼠标点击勾选 %%
**}
protected property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode;
protected
property CurrentDeleteNode read FCurrentDeleteNode write FCurrentDeleteNode;
property CurrentAddNode read FCurrentAddNode write FCurrentAddNode;
function Gitems();
begin