From c1a3ad1423dbb255bb6003865e5b00129b21032e Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Fri, 18 Nov 2022 11:10:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化继承和配色 --- designer/udesignerproject.tsf | 28 ++++++++++++++++++++++++---- designer/utslcodeeditor.tsf | 9 ++++++++- designer/utslsynmemo.tsf | 14 +++++++------- funcext/tvclib/utslmemo.tsf | 7 +++---- 4 files changed, 42 insertions(+), 16 deletions(-) diff --git a/designer/udesignerproject.tsf b/designer/udesignerproject.tsf index c4c1a00..4ee3db3 100644 --- a/designer/udesignerproject.tsf +++ b/designer/udesignerproject.tsf @@ -1051,6 +1051,21 @@ type TProjectView = class(TVCForm) // if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("ظļ","ʾ",0,self); nd := info[0]; if not ifobj(nd) then return MessageboxA("ڴ","ʾ",0,self); + /////////uses// + r := FTslEditer.getuses(nd.gettsfname()); + if ifarray(r) and r then + begin + us := "uses "; + for i,v in r do + begin + us+=v+","; + end + us[length(us)] :=";"; + end else + begin + us := ""; + end + /////////// ph := FTree.CurrentNode.FPath; fio := ioFileseparator(); fn := array("name":n,"type":nd.FType,"dir":ph); @@ -1062,7 +1077,7 @@ type TProjectView = class(TVCForm) // begin r := format(%% type %s=class(%s) - uses tslvcl; + %s function create(AOwner); begin inherited; @@ -1080,7 +1095,7 @@ type %s=class(%s) end -%%,n,nd.Fname); +%%,n,nd.Fname,us); ReWriteString(ph,r); FTmfParser.ScriptPath := nd.gettmfname(); r := FTmfParser.inheritedcoy(n+"1",n,nd.Fname); @@ -1091,12 +1106,12 @@ end cc := FTslParser.GetClassAbstract(); if ifarray(cc)then begin - inh := cc["inherited"]; - + inh := cc["inherited"]; end end FTree.SetFileToNode(fn); SaveProjInfo(); + nd.parent.expand(); end function AddFormToCurrentDir(n); //Ӵ begin @@ -1802,6 +1817,11 @@ BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000 it := OpenAndGotoFileByName(n); if it then return it.Delfiled(fld,nn); end + function getuses(n); + begin + it := OpenAndGotoFileByName(n); + if it then return it.getuses(); + end function GetClassInfo(n); //Ϣ begin if n and ifstring(n)then diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index 7f28d14..31dd4d6 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -1149,6 +1149,13 @@ type TPageEditerItem=class(TPageItem) end end end + function getuses(); + begin + if not FTslParser then return 0; + d := GetClassInfo(); + if not(d and ifarray(d))then return 0; + return d["uses"]["info"]; + end function adduses(libs);//uses begin if not FTslParser then return 0; @@ -2237,7 +2244,7 @@ type TEditer=class(TCustomcontrol) // function PageItemSelChanged(o,e);virtual; begin it := GetCurrentItem(); - if not it then return; + if not it then return Caption := "editer..."; //if JudgeItemState(it) then return ; FCurrentItemCode[length(FCurrentItemCode)]:= it; if it.fisnewfile then diff --git a/designer/utslsynmemo.tsf b/designer/utslsynmemo.tsf index 4330f88..4530e98 100644 --- a/designer/utslsynmemo.tsf +++ b/designer/utslsynmemo.tsf @@ -232,9 +232,13 @@ type TTslSynHighLighter = class(TSynHighLighter) {** @explan(˵) tsl﷨ **} + private + fpairbegin; + public function Create(AOwner); begin inherited; + fpairbegin := array("select":1,"sselect":1,"update":1,"mselect":1,"vselect":1,"try":1,"begin":1,"type":1,"case":1); FSynBranch := 0;// 0, "tsl" "tslx" Clean(); FChangeDeal := true; @@ -416,8 +420,7 @@ type TTslSynHighLighter = class(TSynHighLighter) if FKeyWords[lwttk] then begin d.FFcolor := 0x0000FF; - end - else + end else if FBinFunc[lwttk] then begin d.FFcolor := 0xcd0000; @@ -449,7 +452,7 @@ type TTslSynHighLighter = class(TSynHighLighter) D.FMate := FCMBState.GetSate(); end else - if (lwttk in array("select","sselect","update","mselect","vselect","try","begin","type","case")) then + if fpairbegin[lwttk] then begin FCBEState.GetLeft(); d.FMATe := FCBEState.GetSate(); @@ -848,7 +851,6 @@ type TTslSynHighLighter = class(TSynHighLighter) end end else if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then - //if vi in array("`","~","@","#","$","^","&","*",")","+","-",";",",",".","?",":","[","]","|","\\","=",">","<","%") then begin SetTToken(tokens,ttk,idx-1); if vi=")" then @@ -1817,7 +1819,5 @@ type TTsfFileParser = class() // return 0; return 0; end -end - - +end end. \ No newline at end of file diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index a2245c7..3c0e62e 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -788,11 +788,11 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // it := flines[i]; if it and it.FMarked then begin - dc.brush.Color := 0xFF00FF; + dc.brush.Color := 0x12a4f6;//0xFF00FF; tr := r; tr[0]+= 1; - tr[1]+= 1; - tr[3]-= 1; + tr[1]+= 2; + tr[3]-= 4; dc.FillRect(tr); end if i=Fecruningto then @@ -4148,7 +4148,6 @@ function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); begin return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); end - InitialIzation end.