设计器

优化
This commit is contained in:
JianjunLiu 2022-09-29 17:06:03 +08:00
parent 533f6fef61
commit 7b404b5ed0
3 changed files with 134 additions and 120 deletions

View File

@ -494,10 +494,10 @@ type TVclDesigner = class(tvcform)
if FTree.Loading then return ; if FTree.Loading then return ;
FProjectManager.adduses(lbs); FProjectManager.adduses(lbs);
end end
function EditerCodeChanged(); //´úÂë¸Ä±ä function EditerCodeChanged(nd); //´úÂë¸Ä±ä
begin begin
if FTree.Loading then return ; if FTree.Loading then return ;
classinfo := FProjectManager.GetFormClassInfo(); classinfo := FProjectManager.GetFormClassInfo(nd);
if classinfo and ifarray(classinfo) then if classinfo and ifarray(classinfo) then
begin begin
class(TDComponent).TemporaryNotName := classinfo["members"]; class(TDComponent).TemporaryNotName := classinfo["members"];

View File

@ -228,15 +228,20 @@ type TProjectView = class(TVCForm) //
begin begin
if not FFilterList.visible then if not FFilterList.visible then
begin begin
xy := FFilter.clienttoscreen(FFilter.left,FFilter.height); xy := FFilter.clienttoscreen(FFilter.left,FFilter.height);
rec := xy; rec := xy;
rec[2] := xy[0]+FFilter.width; rec[2] := xy[0]+FFilter.width;
rec[3] := xy[1]+200; rec[3] := xy[1]+200;
FFilterList.SetBoundsRect(rec); FFilterList.SetBoundsRect(rec);
FFilterList.Show(SW_SHOWNOACTIVATE); FFilterList.Show(SW_SHOWNOACTIVATE);
end end
FFilterList.SetData(d); FFilterList.SetData(d);
end end
function saveformcode(); //保存当前class
begin
it := FTslEditer.GetCurrentItem();
FTslEditer.SavePageItem(it);
end
public public
function FilterKillFocus(o,e); function FilterKillFocus(o,e);
begin begin
@ -292,7 +297,7 @@ type TProjectView = class(TVCForm) //
if cc=VK_UP then if cc=VK_UP then
begin begin
e.skip := true; e.skip := true;
if FFilterList.visible then if FFilterList.visible then
begin begin
idx := FFilterList.getCurrentSelection(); idx := FFilterList.getCurrentSelection();
ct := length(FFilterNodes); ct := length(FFilterNodes);
@ -359,9 +364,10 @@ type TProjectView = class(TVCForm) //
begin begin
FTslEditer.SetCodeFormatInfo(FMTDATA); FTslEditer.SetCodeFormatInfo(FMTDATA);
end end
FTslEditer.OnFormCodeSave := function(o,e) FTslEditer.OnFormCodeSave := function(o,e) ;//TFTSLScriptcustomMemo
begin begin
if FCurrentOpend and (FCurrentOpend["type"] in array("panel","form")) then FDesigner.EditerCodeChanged(); nd := FTree.CurrentNode;
if nd and (nd["type"] in array("panel","form")) then FDesigner.EditerCodeChanged(nd);
end end
//FTslEditer.Parent := AOwner; //FTslEditer.Parent := AOwner;
FTmfParser := new TTmfParser(); FTmfParser := new TTmfParser();
@ -469,7 +475,6 @@ type TProjectView = class(TVCForm) //
FTree.OnSelChanged := thisfunction(TreeNodeChanged); FTree.OnSelChanged := thisfunction(TreeNodeChanged);
FTree.OnDblClick := function(o,e) FTree.OnDblClick := function(o,e)
begin begin
//echo "dbclick\r\n";
OpenTreeNode(); OpenTreeNode();
end end
FWrapFolder := new TFolderChooseADlg(self); FWrapFolder := new TFolderChooseADlg(self);
@ -505,11 +510,18 @@ type TProjectView = class(TVCForm) //
begin begin
if it.FType="dir" then if it.FType="dir" then
begin begin
FDelMenu.Enabled := true; if (it=FTree.ProjectNode) then
begin
FDelMenu.Enabled := false;
end else
FDelMenu.Enabled := true;
FAddMenu.Enabled := true; FAddMenu.Enabled := true;
end else end else
begin begin
FDelMenu.Enabled := true; if ((lowercase(it["name"]+".tsf")=lowercase(FMainForm+".tsf")) or (lowercase(it["name"]+".tsl")=lowercase(FExecEntry+".tsl"))) then
begin
FDelMenu.Enabled := false;
end else FDelMenu.Enabled := true;
FAddMenu.Enabled := false; FAddMenu.Enabled := false;
end end
if((it.FType="form")and(it.FName <> FMainForm)and(it.FPath()=""))then if((it.FType="form")and(it.FName <> FMainForm)and(it.FPath()=""))then
@ -528,7 +540,7 @@ type TProjectView = class(TVCForm) //
if((it.FType="form")and(it.FName <> FMainForm))or(it.FType="tsl")and(it.FName <> FExecEntry)or(it.FType="tsf")or(it.FType="panel") {or((it.FType = "dir") and it.parent<>FTree.RootNode)}then if((it.FType="form")and(it.FName <> FMainForm))or(it.FType="tsl")and(it.FName <> FExecEntry)or(it.FType="tsf")or(it.FType="panel") {or((it.FType = "dir") and it.parent<>FTree.RootNode)}then
begin begin
FRenameMenu.parent := FTreePopUpMenu; FRenameMenu.parent := FTreePopUpMenu;
if CreateMoveDirMenus()then FMoveMenu.parent := FTreePopUpMenu; if CreateMoveDirMenus(it)then FMoveMenu.parent := FTreePopUpMenu;
else FMoveMenu.parent := nil; else FMoveMenu.parent := nil;
end else end else
begin begin
@ -554,7 +566,7 @@ type TProjectView = class(TVCForm) //
if not FCProjectPath then return Messageboxa("工程没打开","提示",0,self); if not FCProjectPath then return Messageboxa("工程没打开","提示",0,self);
if FInput.ShowModal()then if FInput.ShowModal()then
begin begin
RenameCurrentDir(FInput.GetEditV()); RenameCurrentDir(FInput.GetEditV(1));
end end
end end
function Add_form(); function Add_form();
@ -640,8 +652,15 @@ type TProjectView = class(TVCForm) //
end end
end end
end end
function GetFormClassInfo(); //获得编辑器中类的变量信息 function GetFormClassInfo(nd); //获得编辑器中类的变量信息
begin begin
if nd then
begin
f1 := nd.gettsfname();
it := FTslEditer.GetCurrentItem();
f2 := it.ScriptPath;
if f1<>f2 then return ;
end
return FTslEditer.GetClassInfo(); return FTslEditer.GetClassInfo();
end end
function ShowEditor(); //显示函数编辑 function ShowEditor(); //显示函数编辑
@ -655,12 +674,14 @@ type TProjectView = class(TVCForm) //
if r then FTslEditer.OpenAndGotoFileByName(r); if r then FTslEditer.OpenAndGotoFileByName(r);
ShowEditor(); ShowEditor();
end end
function AddAFiled(n); //添加成员 function AddAFiled(n); //添加成员
begin begin
if ifstring(n)and FCurrentOpend and(FCurrentOpend["type"] in array("form","panel"))then if ifstring(n)and FCurrentOpend and(FCurrentOpend["type"] in array("form","panel"))then
begin begin
r := FCurrentOpend.gettsfname(); r := FCurrentOpend.gettsfname();
FTslEditer.Addfiled(r,n); FTslEditer.Addfiled(r,n);
saveformcode();
end end
end end
function adduses(lbs); //添加成员 function adduses(lbs); //添加成员
@ -669,6 +690,7 @@ type TProjectView = class(TVCForm) //
begin begin
r := FCurrentOpend.gettsfname(); r := FCurrentOpend.gettsfname();
FTslEditer.adduses(r,lbs); FTslEditer.adduses(r,lbs);
saveformcode();
end end
end end
@ -678,6 +700,7 @@ type TProjectView = class(TVCForm) //
begin begin
r := FCurrentOpend.gettsfname(); r := FCurrentOpend.gettsfname();
FTslEditer.Delfiled(r,n,nn); FTslEditer.Delfiled(r,n,nn);
saveformcode();
end end
end end
function AddAFunction(ff); //添加函数 function AddAFunction(ff); //添加函数
@ -687,6 +710,7 @@ type TProjectView = class(TVCForm) //
s := createtslfunction(ff); s := createtslfunction(ff);
fn := FCurrentOpend.gettsfname(); fn := FCurrentOpend.gettsfname();
r := FTslEditer.AddFunction(fn,ff["name"],s); r := FTslEditer.AddFunction(fn,ff["name"],s);
saveformcode();
ShowEditor(); ShowEditor();
return r; return r;
end end
@ -694,13 +718,14 @@ type TProjectView = class(TVCForm) //
function GoToAFunction(n); //跳转到函数 function GoToAFunction(n); //跳转到函数
begin begin
r := FTslEditer.GoToFunction(FCurrentOpend.gettsfname(),n); r := FTslEditer.GoToFunction(FCurrentOpend.gettsfname(),n);
saveformcode();
ShowEditor(); ShowEditor();
return r; return r;
end end
function OpenFileByName(n); //打开文件 function OpenFileByName(n); //打开文件
begin begin
fio := ioFileseparator(); fio := ioFileseparator();
if not(n and ifstring(n)) then return 0; if not(n and ifstring(n)) then return FDesigner.ExecuteCommand("hiddrennode",nil);;
nopend := FTree.NameInTree(n,nil,true); nopend := FTree.NameInTree(n,nil,true);
if not nopend then if not nopend then
begin begin
@ -709,12 +734,6 @@ type TProjectView = class(TVCForm) //
end end
if nopend=FCurrentOpend then if nopend=FCurrentOpend then
begin begin
{if FCurrentOpend["type"]in array("tsf","tsl","form","panel")then
begin
fn := FCurrentOpend.geteditfilename();
FTslEditer.OpenAndGotoFileByName(fn);
ShowEditor(); //FTslEditer.Show();
end}
return 0; return 0;
end end
FCurrentOpend := nopend; FCurrentOpend := nopend;
@ -770,7 +789,9 @@ type TProjectView = class(TVCForm) //
end end
function OpenMainForm(); //打开主函数 function OpenMainForm(); //打开主函数
begin begin
OpenFileByName(FMainForm); nd := FTree.NameInTree(FMainForm,nil,true);
FTree.SetSel(nd);
//OpenFileByName(FMainForm);
end end
function SetProjectInfo(F); //设置信息 %% function SetProjectInfo(F); //设置信息 %%
begin begin
@ -818,35 +839,29 @@ type TProjectView = class(TVCForm) //
FExecEntry := d["entryscript"]; FExecEntry := d["entryscript"];
end end
FTslEditer.setExecuteEditerSetcmdline(d["commandline"]); FTslEditer.setExecuteEditerSetcmdline(d["commandline"]);
OpenMainForm(); //打开主窗口2 OpenMainForm(); //打开主窗口
//设置选中节点 20210413 添加
mnode := FTree.NameInTree((FMainForm),nil,true);
if FTree.CurrentNode <> mnode then
begin
FTree.SetSel(mnode);
end
end end
function SetAsMainWind(o,e); function SetAsMainWind(o,e); //设置主窗口
begin begin
if o.caption = "设置为主窗口" then if o.caption = "设置为主窗口" then
begin begin
cn := FTree.CurrentNode; cn := FTree.CurrentNode;
fn := cn.FName ; fn := cn.FName ;
FMainForm := fn; FMainForm := fn;
SaveProjInfo(); SaveProjInfo();
o.parent := nil; o.parent := nil;
end else end else
if o.caption = "设置为入口脚本" then if o.caption = "设置为入口脚本" then
begin begin
cn := FTree.CurrentNode; cn := FTree.CurrentNode;
fn := cn.FName ; fn := cn.FName ;
FExecEntry := fn; FExecEntry := fn;
SaveProjInfo(); SaveProjInfo();
o.parent := nil; o.parent := nil;
end end
end end
function DeletCTNode(); function DeletCTNode(); //删除当前节点
begin begin
cn := FTree.CurrentNode; cn := FTree.CurrentNode;
if cn.FType="dir" then DeleteCurrentDir(); if cn.FType="dir" then DeleteCurrentDir();
@ -860,15 +875,25 @@ type TProjectView = class(TVCForm) //
if cn=FTree.ProjectNode then return Messageboxa("工程目录不能删除","提示",0,self); if cn=FTree.ProjectNode then return Messageboxa("工程目录不能删除","提示",0,self);
if IDOK=Messageboxa("即将从工程中移除文件夹:"+cn.Caption,"提示",1,self)then if IDOK=Messageboxa("即将从工程中移除文件夹:"+cn.Caption,"提示",1,self)then
begin begin
if FCurrentOpend and FTree.FileNameInCurrentNode(FCurrentOpend["name"])then
begin
CloseCurrentEdit(nil,true);
end
if IDOK=Messageboxa("是否删除文件夹及其类容:"+cn.Caption,"提示",1,self)then if IDOK=Messageboxa("是否删除文件夹及其类容:"+cn.Caption,"提示",1,self)then
begin begin
dcns := array();
ftree.GetNodeLeafs(cn,dcns);
for i,v in dcns do
begin
if v.FType = "dir" then continue;
FTslEditer.CloseScriptByFileName(v.geteditfilename());
if v.FType in array("form","panel") then
begin
tn := v.gettmfname();
FTslEditer.CloseScriptByFileName(tn);
FileDelete("",tn);
end
end
dp := cn.FPath; dp := cn.FPath;
DeleteAllFiles(FCProjectPath+dp); DeleteAllFiles(FCProjectPath+dp);
end end
FCurrentOpend := nil;
FTree.DeleteCurrentNode(); FTree.DeleteCurrentNode();
SaveProjInfo(); SaveProjInfo();
end end
@ -883,27 +908,15 @@ type TProjectView = class(TVCForm) //
if IDOK=Messageboxa("即将从工程中移除:"+d["name"],"提示",1,self)then if IDOK=Messageboxa("即将从工程中移除:"+d["name"],"提示",1,self)then
begin begin
CloseCurrentEdit(nd,true); CloseCurrentEdit(nd,true);
ml := d["dir"]; fn := nd.geteditfilename();
if ifstring(ml)and ml then ml := ml+fio; FTslEditer.CloseScriptByFileName(fn);
else ml := "";
ft := "tsl";
if d["type"]in array("panel","form","tsf")then ft := "tsf";
FTslEditer.CloseScriptByFileName(FCProjectPath+ml+d["name"]+"."+ft);
if IDOK=Messageboxa("是否删除文件","提示",1,self)then //移除文件 if IDOK=Messageboxa("是否删除文件","提示",1,self)then //移除文件
begin begin
FileDelete("",fn);
case d["type"]of case d["type"]of
"form","panel": "form","panel":
begin begin
FileDelete("",FCProjectPath+ml+d["name"]+".tsf"); FileDelete("",nd.gettmfname());
FileDelete("",FCProjectPath+"resource.tfm"+fio+d["name"]+".tfm");
end
"tsl":
begin
FileDelete("",FCProjectPath+ml+d["name"]+".tsl");
end
"tsf":
begin
FileDelete("",FCProjectPath+ml+d["name"]+"."+d["type"]);
end end
end; end;
end end
@ -1023,31 +1036,24 @@ type TProjectView = class(TVCForm) //
function RenameCurrentDir(n); //修改目录名 function RenameCurrentDir(n); //修改目录名
begin begin
if not LegalVariableName(n)then return MessageboxA("名字不合法,请重试","提示",0,self); if not LegalVariableName(n)then return MessageboxA("名字不合法,请重试","提示",0,self);
if FTree.NameInTree(lowercase(n),nil,false)then return MessageboxA("重复的文件名","提示",0,self); if FTree.NameInTree(n,nil,false)then return MessageboxA("重复的文件名","提示",0,self);
//CloseCurrentEdit(); //CloseCurrentEdit();
cn := FTree.CurrentNode; cn := FTree.CurrentNode;
if cn.FType="dir" then return; if cn.FType="dir" then return;
fio := ioFileseparator(); fio := ioFileseparator();
ph := FTree.CurrentNode.FPath;
if ph then ph += fio;
else ph := "";
fullsouce := 0; fullsouce := 0;
fllname := cn.geteditfilename();
fllnname := cn.geteditfilename(n);
case cn.FType of case cn.FType of
"tsf","panel","form": "panel","form":
begin begin
fllname := FCProjectPath+ph+cn.caption+".tsf"; fullsouce := cn.gettmfname() ;
fllnname := FCProjectPath+ph+n+".tsf"; fullnsouce := cn.gettmfname(n);
if cn.FType in array("panel","form")then FTslEditer.SaveFileByName(fullsouce);
begin FTslEditer.CloseScriptByFileName(fullsouce);
fullsouce := FCProjectPath+"resource.tfm"+fio+cn.caption+".tfm";
fullnsouce := FCProjectPath+"resource.tfm"+fio+n+".tfm";
end
end else
begin
fllname := FCProjectPath+ph+cn.caption+".tsl";
fllnname := FCProjectPath+ph+n+".tsl";
end end
end end
FTslEditer.SaveFileByName(fllname);
FTslEditer.CloseScriptByFileName(fllname); FTslEditer.CloseScriptByFileName(fllname);
if cn.FType in array("tsf","panel","form")then if cn.FType in array("tsf","panel","form")then
begin begin
@ -1086,11 +1092,11 @@ type TProjectView = class(TVCForm) //
filerename("",fullsouce,fullnsouce); filerename("",fullsouce,fullnsouce);
end end
cnifno := cn.FFileInfo; cnifno := cn.FFileInfo;
cnifno["name"]:= lowercase(n); cnifno["name"]:= n;
cn.FFileInfo := cnifno; cn.FFileInfo := cnifno;
cn.caption := n; cn.caption := n;
SaveProjInfo(); SaveProjInfo();
FDesigner.ExecuteCommand("renamefile",lowercase(n)); FDesigner.ExecuteCommand("renamefile",n);
end else end else
return MessageboxA("更名错误","提示",0,self); return MessageboxA("更名错误","提示",0,self);
end end
@ -1099,13 +1105,8 @@ type TProjectView = class(TVCForm) //
if not LegalVariableName(n)then return MessageboxA("名字不合法,请重试","提示",0,self); if not LegalVariableName(n)then return MessageboxA("名字不合法,请重试","提示",0,self);
if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("重复的文件名","提示",0,self); if FTree.NameInTree(lowercase(n),nil,true)then return MessageboxA("重复的文件名","提示",0,self);
fn := array("name":n,"type":t,"dir":FTree.CurrentNode.FPath); fn := array("name":n,"type":t,"dir":FTree.CurrentNode.FPath);
ph := FTree.CurrentNode.FPath; nnd := FTree.SetFileToNode(fn);
fio := ioFileseparator(); ph := nnd.geteditfilename();
if ph then ph += fio;
else ph := "";
FTree.SetFileToNode(fn);
cprojpath := FCProjectPath;
ph := cprojpath+ph+n+"."+t;
if not FileExists("",ph)then if not FileExists("",ph)then
begin begin
if t="tsf" then r := CreateATsf(n); if t="tsf" then r := CreateATsf(n);
@ -1114,7 +1115,7 @@ type TProjectView = class(TVCForm) //
end end
SaveProjInfo(); SaveProjInfo();
end end
function ShowExeEditer(); function ShowExeEditer(); //显示调试窗口
begin begin
if not FMainForm then if not FMainForm then
begin begin
@ -1140,7 +1141,7 @@ type TProjectView = class(TVCForm) //
return; return;
end end
function debugproject(); function debugproject(); //调试运行
begin begin
if not FMainForm then if not FMainForm then
begin begin
@ -1351,7 +1352,7 @@ type TProjectView = class(TVCForm) //
end end
end end
function GetDirNodes(nd,r); function GetDirNodes(nd,r,nt);
begin begin
if not ifarray(r) then r := array(); if not ifarray(r) then r := array();
if not nd then return ; if not nd then return ;
@ -1360,21 +1361,24 @@ type TProjectView = class(TVCForm) //
tnd := nd.GetNodeByIndex(i); tnd := nd.GetNodeByIndex(i);
if tnd.FType="dir" then if tnd.FType="dir" then
begin begin
r[length(r)] := array(tnd.FPath(),tnd); if nt<>tnd then
GetDirNodes(tnd,r); r[length(r)] := array(tnd.FPath(),tnd);
GetDirNodes(tnd,r,nt);
end end
end end
end end
function CreateMoveDirMenus(); function CreateMoveDirMenus(it);
begin begin
ds := array(); ds := array();
rnd := FTree.RootNode.GetNodeByIndex(0); rnd := FTree.RootNode.GetNodeByIndex(0);
GetDirNodes(rnd,ds); pit := it.parent;
if rnd<>pit then
ds[length(ds)] := array("<主目录>",rnd);
GetDirNodes(rnd,ds,pit);
if not ifarray(FMoveMnus) then FMoveMnus := array(); if not ifarray(FMoveMnus) then FMoveMnus := array();
if ds then if ds then
begin begin
ds[length(ds)] := array("<主目录>",rnd);
lends := length(ds); lends := length(ds);
lengthMenus := length(FMoveMnus); lengthMenus := length(FMoveMnus);
for i:= length(FMoveMnus) to lends-1 do for i:= length(FMoveMnus) to lends-1 do
@ -1612,7 +1616,7 @@ BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000
it := OpenAndGotoFileByName(n); it := OpenAndGotoFileByName(n);
if it then return it.AddFunction(fn,finfo); if it then return it.AddFunction(fn,finfo);
end end
function Addfiled(fn,n); function Addfiled(fn,n); //添加变量
begin begin
it := OpenAndGotoFileByName(fn); it := OpenAndGotoFileByName(fn);
if it then if it then
@ -1620,7 +1624,7 @@ BD141CA912494F502D48D224F45050274A21E03806FF2C7CA7516022D7D000000
it.AddFiled(n); it.AddFiled(n);
end end
end end
function Adduses(fn,lbs); function Adduses(fn,lbs); //添加uses
begin begin
it := OpenAndGotoFileByName(fn); it := OpenAndGotoFileByName(fn);
if it then if it then
@ -1633,27 +1637,30 @@ 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 GetClassInfo(n); function GetClassInfo(n); //获得信息
begin begin
if n and ifstring(n)then it := OpenAndGotoFileByName(n); if n and ifstring(n)then it := OpenAndGotoFileByName(n);
else it := GetCurrentItem(); else it := GetCurrentItem();
if it then return it.GetClassInfo(); if it then
begin
return it.GetClassInfo();
end
return nil; return nil;
end end
function dopageitemsaved(it);override; //保存
begin
calldatafunction(fSetOnFormCodeSave,it,nil);
end
function createparams(p);override; function createparams(p);override;
begin begin
inherited; inherited;
p.style .|= WS_MAXIMIZEBOX .| WS_MINIMIZEBOX; p.style .|= WS_MAXIMIZEBOX .| WS_MINIMIZEBOX;
//p.cstyle := CS_HREDRAW .| CS_VREDRAW .| CS_OWNDC .| CS_DBLCLKS ; //p.cstyle := CS_HREDRAW .| CS_VREDRAW .| CS_OWNDC .| CS_DBLCLKS ;
end end
property OnFormCodeSave write SetOnFormCodeSave; property OnFormCodeSave write fSetOnFormCodeSave;
private private
fSetOnFormCodeSave;
FDefaultcmdline; FDefaultcmdline;
function SetOnFormCodeSave(v);
begin
OnPageEditerChanged := v;
//OnScriptChanged := v;
end
end end
//************************************ //************************************
@ -2016,16 +2023,15 @@ type TFileTree = class(TTreeCtl)
end end
function AddDirToNode(n,nd); //在节点上面添加目录 function AddDirToNode(n,nd); //在节点上面添加目录
begin begin
if not ifstring(n)then return nil; if not(ifstring(n) and n)then return nil;
if not nd then return nil; if not nd then return nil;
if nd.FType <> "dir" then return nil; if nd.FType <> "dir" then return nil;
lv := lowercase(n); ci := DirInNode(n,nd);
ci := DirInNode(lv,nd);
if ci then return ci; if ci then return ci;
ci := CreateTreeNode(); ci := CreateTreeNode();
ci.FType := "dir"; ci.FType := "dir";
ci.caption := n; ci.caption := n;
ci.FName := lv; ci.FName := n;
ci.parent := nd; ci.parent := nd;
return ci; return ci;
end end
@ -2036,9 +2042,6 @@ type TFileTree = class(TTreeCtl)
property RootDir read FRootDir write SetRootDir; //根目录名称 property RootDir read FRootDir write SetRootDir; //根目录名称
property FileCanSel read FFileCanSel write SetFileCanSel; //文件是否可以选择 property FileCanSel read FFileCanSel write SetFileCanSel; //文件是否可以选择
property ProjectNode read FPNode; property ProjectNode read FPNode;
private
FImageIdName;
FFileCanSel;
function GetNodeLeafs(nd,fs); //获得叶子节点 function GetNodeLeafs(nd,fs); //获得叶子节点
begin begin
if nd.ItemCount<1 then if nd.ItemCount<1 then
@ -2051,16 +2054,21 @@ type TFileTree = class(TTreeCtl)
GetNodeLeafs(nd.GetNodeByIndex(i),fs); GetNodeLeafs(nd.GetNodeByIndex(i),fs);
end end
end end
private
FImageIdName;
FFileCanSel;
function SetFileCanSel(v); function SetFileCanSel(v);
begin begin
FFileCanSel := v; FFileCanSel := v;
end end
function DirInNode(d,nd); //文件夹是否在节点上面 function DirInNode(d,nd); //文件夹是否在节点上面
begin begin
ld := lowercase(d);
for i := 0 to nd.ItemCount-1 do for i := 0 to nd.ItemCount-1 do
begin begin
ci := nd.GetNodeByIndex(i); ci := nd.GetNodeByIndex(i);
if(ci.FName=d)then if(lowercase(ci.FName)=ld)then
begin begin
return ci; return ci;
end; end;

View File

@ -2105,15 +2105,21 @@ type TEditer=class(TCustomcontrol) //
//s := tostm(v); //s := tostm(v);
r := exportfile(ftstream(),"",fp,v); r := exportfile(ftstream(),"",fp,v);
it.ReGetLastLoadTime(); it.ReGetLastLoadTime();
dopageitemsaved(it);
return r; return r;
except except
end end
end end
r := ReWriteString(fp,s); r := ReWriteString(fp,s);
it.ReGetLastLoadTime(); it.ReGetLastLoadTime();
dopageitemsaved(it);
return r; return r;
end end
return 1; return 1;
end
function dopageitemsaved(it);virtual;
begin
end end
function ShowFindWnd(); function ShowFindWnd();
begin begin