设计器

添加高亮控件
This commit is contained in:
JianjunLiu
2022-09-15 17:59:12 +08:00
parent 1abe441ca6
commit 286af5904f
5 changed files with 121 additions and 4 deletions
+13 -1
View File
@@ -1741,6 +1741,7 @@ type tmemo = class(TSynMemoNorm)
function DoTextChanged(p);override;//文本改变
begin
inherited;
calldatafunction(Fonchange,self(true),new tuieventbase(0,0,0,0));
end
function MouseUp(o,e);override;
begin
@@ -1788,7 +1789,7 @@ type tmemo = class(TSynMemoNorm)
"popupmenu","visible","anchors","align",
"height","width","left","top",
"text","readonly","selectbkcolor","guttercolor","currentlinecolor","guttercharcnt",
"tabspace","onmousewheel","onmousemove","onpopupmenu",
"tabspace","highlighter","onmousewheel","onmousemove","onpopupmenu",
"onmousedown","onmouseup","onsetfocus","onkillfocus",
"onkeyup","onkeydown","onkeypress",
"onchange");
@@ -1800,6 +1801,17 @@ type tmemo = class(TSynMemoNorm)
FonSetFocus;
fonKillFocus;
end
type thighlighter= class(tcustomsynhighlighter)
uses UTslMemo;
function create(AOwner);
begin
inherited;
end
function publishs();override;
begin
return array("name","keywordcolor","symcolor","stringcolor","annotationcolor");
end
end
//goupbox
type tgroupbox = class(tcustomgroupbox)
+3 -2
View File
@@ -3031,7 +3031,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
fignorecase := false;//忽略大小写
FChangeDeal := true;
FTokens := array();
setkeyword(array("null","true","false"));
setkeyword(array("null","true","false","goto","break","for","to","while","do"));
setblockannote(array(
("/*","*/"),
));
@@ -3043,6 +3043,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
));
setpairs(array(
("(",")"),
("[","]"),
("{","}"),
));
clean();
@@ -3741,7 +3742,7 @@ type TSynCustomMemo = class(TCustomMemo)
y := (CaretY-GetYpos())*GetYScrollDelta();
x := (CaretX-GetXpos())*GetXScrollDelta();
end
property Highlighter read FHighlighter write SetHighlighter; //语法高亮
property Highlighter:thighlighter read FHighlighter write SetHighlighter; //语法高亮
property Completion read FCompletion write SetCompletion; //自动完成
property TabChar read FTabChar write SetTabChar;
private
@@ -1222,6 +1222,12 @@ type TPropertyImagelist=class(TPropertyaction) //imagelist
return "tcontrolimagelist";
end
end
type TPropertyhgt=class(TPropertyaction) //imagelist
Function EditType();override;
begin
return "thighlighter";
end
end
type TPropertyImagesData=class(TPropertyType) //imagedata,作为imagelist的数据
Function EditType();override;
begin
@@ -2043,6 +2049,7 @@ begin
"tpropertypopupmenu",
"tpropertymainmenu",
"tpropertyimagelist",
"tpropertyhgt",
"tpropertyimagesdata",
"tpropertybitmap",
"tpropertyicon",