设计器

优化继承和配色
This commit is contained in:
JianjunLiu 2022-11-18 11:10:05 +08:00
parent 888ec1c7d9
commit c1a3ad1423
4 changed files with 42 additions and 16 deletions

View File

@ -1051,6 +1051,21 @@ type TProjectView = class(TVCForm) //
if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("重复的文件名","提示",0,self); if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("重复的文件名","提示",0,self);
nd := info[0]; nd := info[0];
if not ifobj(nd) then return MessageboxA("父窗口错误","提示",0,self); 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; ph := FTree.CurrentNode.FPath;
fio := ioFileseparator(); fio := ioFileseparator();
fn := array("name":n,"type":nd.FType,"dir":ph); fn := array("name":n,"type":nd.FType,"dir":ph);
@ -1062,7 +1077,7 @@ type TProjectView = class(TVCForm) //
begin begin
r := format(%% r := format(%%
type %s=class(%s) type %s=class(%s)
uses tslvcl; %s
function create(AOwner); function create(AOwner);
begin begin
inherited; inherited;
@ -1080,7 +1095,7 @@ type %s=class(%s)
end end
%%,n,nd.Fname); %%,n,nd.Fname,us);
ReWriteString(ph,r); ReWriteString(ph,r);
FTmfParser.ScriptPath := nd.gettmfname(); FTmfParser.ScriptPath := nd.gettmfname();
r := FTmfParser.inheritedcoy(n+"1",n,nd.Fname); r := FTmfParser.inheritedcoy(n+"1",n,nd.Fname);
@ -1092,11 +1107,11 @@ end
if ifarray(cc)then if ifarray(cc)then
begin begin
inh := cc["inherited"]; inh := cc["inherited"];
end end
end end
FTree.SetFileToNode(fn); FTree.SetFileToNode(fn);
SaveProjInfo(); SaveProjInfo();
nd.parent.expand();
end end
function AddFormToCurrentDir(n); //添加窗口 function AddFormToCurrentDir(n); //添加窗口
begin begin
@ -1802,6 +1817,11 @@ BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000
it := OpenAndGotoFileByName(n); it := OpenAndGotoFileByName(n);
if it then return it.Delfiled(fld,nn); if it then return it.Delfiled(fld,nn);
end end
function getuses(n);
begin
it := OpenAndGotoFileByName(n);
if it then return it.getuses();
end
function GetClassInfo(n); //获得信息 function GetClassInfo(n); //获得信息
begin begin
if n and ifstring(n)then if n and ifstring(n)then

View File

@ -1149,6 +1149,13 @@ type TPageEditerItem=class(TPageItem)
end end
end 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 function adduses(libs);//Ìí¼Óuses
begin begin
if not FTslParser then return 0; if not FTslParser then return 0;
@ -2237,7 +2244,7 @@ type TEditer=class(TCustomcontrol) //
function PageItemSelChanged(o,e);virtual; function PageItemSelChanged(o,e);virtual;
begin begin
it := GetCurrentItem(); it := GetCurrentItem();
if not it then return; if not it then return Caption := "editer...";
//if JudgeItemState(it) then return ; //if JudgeItemState(it) then return ;
FCurrentItemCode[length(FCurrentItemCode)]:= it; FCurrentItemCode[length(FCurrentItemCode)]:= it;
if it.fisnewfile then if it.fisnewfile then

View File

@ -232,9 +232,13 @@ type TTslSynHighLighter = class(TSynHighLighter)
{** {**
@explan(˵Ã÷) tslÓï·¨¸ßÁÁÀà @explan(˵Ã÷) tslÓï·¨¸ßÁÁÀà
**} **}
private
fpairbegin;
public
function Create(AOwner); function Create(AOwner);
begin begin
inherited; 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" FSynBranch := 0;// 0, "tsl" "tslx"
Clean(); Clean();
FChangeDeal := true; FChangeDeal := true;
@ -416,8 +420,7 @@ type TTslSynHighLighter = class(TSynHighLighter)
if FKeyWords[lwttk] then if FKeyWords[lwttk] then
begin begin
d.FFcolor := 0x0000FF; d.FFcolor := 0x0000FF;
end end else
else
if FBinFunc[lwttk] then if FBinFunc[lwttk] then
begin begin
d.FFcolor := 0xcd0000; d.FFcolor := 0xcd0000;
@ -449,7 +452,7 @@ type TTslSynHighLighter = class(TSynHighLighter)
D.FMate := FCMBState.GetSate(); D.FMate := FCMBState.GetSate();
end else end else
if (lwttk in array("select","sselect","update","mselect","vselect","try","begin","type","case")) then if fpairbegin[lwttk] then
begin begin
FCBEState.GetLeft(); FCBEState.GetLeft();
d.FMATe := FCBEState.GetSate(); d.FMATe := FCBEState.GetSate();
@ -848,7 +851,6 @@ type TTslSynHighLighter = class(TSynHighLighter)
end end
end else end else
if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then if pos(vi,"`~@#$^&*)+-;,.?:[]|\\=><%/") then
//if vi in array("`","~","@","#","$","^","&","*",")","+","-",";",",",".","?",":","[","]","|","\\","=",">","<","%") then
begin begin
SetTToken(tokens,ttk,idx-1); SetTToken(tokens,ttk,idx-1);
if vi=")" then if vi=")" then
@ -1818,6 +1820,4 @@ type TTsfFileParser = class() //
return 0; return 0;
end end
end end
end. end.

View File

@ -788,11 +788,11 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
it := flines[i]; it := flines[i];
if it and it.FMarked then if it and it.FMarked then
begin begin
dc.brush.Color := 0xFF00FF; dc.brush.Color := 0x12a4f6;//0xFF00FF;
tr := r; tr := r;
tr[0]+= 1; tr[0]+= 1;
tr[1]+= 1; tr[1]+= 2;
tr[3]-= 1; tr[3]-= 4;
dc.FillRect(tr); dc.FillRect(tr);
end end
if i=Fecruningto then if i=Fecruningto then
@ -4148,7 +4148,6 @@ function CreateATslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
begin begin
return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode); return new TTslMemoUndoItem(AReason,AStart,AEnd,ChangeText,SelMode);
end end
InitialIzation InitialIzation
end. end.