设计器

升级语法解析
This commit is contained in:
JianjunLiu
2023-03-08 17:57:23 +08:00
parent c924bcd2a0
commit 5d19805db7
5 changed files with 192 additions and 29 deletions
+3 -2
View File
@@ -522,9 +522,10 @@ type tcontrol = class(tcomponent)
begin
if idx=-1 then
begin
FControls.append(actrl);
wkactl := makeweakref(actrl);
FControls.append(wkactl);
actrl.FParent := self(true);
ControlAppended(actrl);
ControlAppended(wkactl);
ifop := true;
end
end
+34 -2
View File
@@ -770,6 +770,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
rc[0]:= Max(rc[0],FGutter.Width);
//echo tostn(array(FirstLine, LastLine, FirstCol, LastCol));
cvs := Canvas;
cvs.Font := font;
bcvs := new TCanvsRgnClipAutoSave(cvs,rc);
PaintTextLines(RC,FirstLine,LastLine,FirstCol,LastCol);
end
@@ -3144,7 +3145,8 @@ type tcustomsynhighlighter = class(TSynHighLighter)
fannotationcolor := 0xaa3300;
fignorecase := false;//忽略大小写
FChangeDeal := true;
FTokens := array();
FTokens := array();
fregs := array();
setkeyword(array("null","true","false","goto","break","for","to","while","do"));
setblockannote(array(
("/*","*/"),
@@ -3199,6 +3201,10 @@ type tcustomsynhighlighter = class(TSynHighLighter)
begin
return setpairs(pm);
end
"regs":
begin
return setregs(pm);
end
end ;
return inherited;
end
@@ -3256,6 +3262,9 @@ type tcustomsynhighlighter = class(TSynHighLighter)
if ifsysfun(bttk) then
begin
d.FFColor := fsysfuncolor ;
end else
begin
dereg(d,bttk);
end
dopair(d,bttk);
end else
@@ -3324,6 +3333,17 @@ type tcustomsynhighlighter = class(TSynHighLighter)
end
end
end
function dereg(d,ttk);
begin
for i,v in fregs do
begin
if parseregexpr(i,ttk,"",r,mp,ml)=1 then
begin
d.FFColor := v;
return ;
end
end
end
function dopair(d,bttk); //处理配对信息
begin
if FIgnoreCase then
@@ -3531,6 +3551,17 @@ type tcustomsynhighlighter = class(TSynHighLighter)
end
end
end
function setregs(d);
begin
fregs := array();
for rg,v in d do
begin
if ifnil(v) then continue;
if not(rg and ifstring(rg)) then continue;
fregs[rg] := v
end
end
function setpairs(d);//设置配对
begin
fswordpairs := array();
@@ -3648,7 +3679,8 @@ type tcustomsynhighlighter = class(TSynHighLighter)
fsysfuntires;
frowstires;
fblockstiresa;
fblockstiresb;
fblockstiresb;
fregs;
/////
fkeywordcolor;
fsysfuncolor;