Compare commits
No commits in common. "9f6742851da1eea75f912458864404d2fad1503e" and "7b404b5ed0a8928378bd04401b0d6ea8f05ff91b" have entirely different histories.
9f6742851d
...
7b404b5ed0
|
|
@ -3,9 +3,7 @@ unit tslvclDesigner;
|
|||
@explan(说明)设计器库 %%
|
||||
**}
|
||||
interface
|
||||
uses utslvcldesignerresource,cstructurelib,utslvclauxiliary,utslvclbase,
|
||||
utslvclgdi,utslvcldcomponents,utslvcldpropertytypes,tslvcl,
|
||||
UVCPropertyTypesPersistence,utslmemo,UDesignerProject;
|
||||
uses utslvcldesignerresource,cstructurelib,utslvclauxiliary,utslvclbase,utslvclgdi,utslvcldcomponents,utslvcldpropertytypes,tslvcl,UVCPropertyTypesPersistence,utslmemo,UDesignerProject;
|
||||
//*******设计控件基类**********************
|
||||
//**********设计控件类************
|
||||
|
||||
|
|
@ -14,23 +12,28 @@ type TVclDesigner = class(tvcform)
|
|||
@explan(说明) 控件设计器 对象 %%
|
||||
**}
|
||||
private
|
||||
fcwindowinfo; //当前窗口文件对象
|
||||
fwindowinfos; //窗口文件节点存储对象
|
||||
fcwindowinfo;
|
||||
fwindowinfos;
|
||||
fcutcopyinfo;//复制的信息
|
||||
FChmHelper; //帮助文档
|
||||
FImageList; //图标
|
||||
FViewBitmap; //图片管理器
|
||||
FVariableSelecter; //当前控件树的变量
|
||||
FFunctionSelecter; //当前控件树的函数
|
||||
FViewBitmap;
|
||||
FCTrans;
|
||||
FVariableSelecter;
|
||||
FFunctionSelecter;
|
||||
Ftvclform;
|
||||
//**********菜单***************
|
||||
FMenu0; //主菜单
|
||||
FMenu0;
|
||||
FParser;
|
||||
//********************************
|
||||
FToolBars; //控件工具栏
|
||||
FToolBars;
|
||||
FTree; //当前的树
|
||||
FObjInspector; //控件树展示器
|
||||
FPropGrid; //控件属性grid
|
||||
FEventGrid; //控件事件grid
|
||||
FObjInspector;
|
||||
FPropGrid;
|
||||
FEventGrid;
|
||||
|
||||
FTempCanvas;
|
||||
static FClassItems;
|
||||
//************************************
|
||||
FCurrentNode;
|
||||
FCurrentClikPos;
|
||||
|
|
@ -40,7 +43,7 @@ type TVclDesigner = class(tvcform)
|
|||
FProjectsManager;
|
||||
FProjectManager;
|
||||
//***************************
|
||||
function WrapProjectTo(); //打包当前
|
||||
function WrapProjectTo();
|
||||
begin
|
||||
FProjectManager.WrapTo();
|
||||
end
|
||||
|
|
@ -86,16 +89,20 @@ type TVclDesigner = class(tvcform)
|
|||
begin
|
||||
//extheight := CaptionHeight()+MenuBarHeight();
|
||||
clc := array();
|
||||
for i,v in class(TDComponent).GetClassItem() do
|
||||
begin
|
||||
cli := v.classification;
|
||||
if not(cli and ifstring(cli)) then cli := "常用";
|
||||
if ifnil(clc[cli]) then clc[cli] := 0;
|
||||
clc[cli]+=1;
|
||||
end
|
||||
mx := 0;
|
||||
for i,v in clc do mx := max(mx,v);
|
||||
height := (integer(mx*32/twidth)+1)*32+60+30{+24}+5;
|
||||
//if FClassItems and ifarray(FClassItems) then
|
||||
//begin
|
||||
for i,v in class(TDComponent).GetClassItem() do
|
||||
begin
|
||||
cli := v.classification;
|
||||
if not(cli and ifstring(cli)) then cli := "常用";
|
||||
if ifnil(clc[cli]) then clc[cli] := 0;
|
||||
clc[cli]+=1;
|
||||
end
|
||||
mx := 0;
|
||||
for i,v in clc do mx := max(mx,v);
|
||||
height := (integer(mx*32/twidth)+1)*32+60+30{+24}+5;
|
||||
//end else
|
||||
// height := 90+32{+24}+5;
|
||||
end
|
||||
|
||||
function TreeNode2tfmsub(lib,node,itemnames,nd);//tmf文件字符串
|
||||
|
|
@ -158,15 +165,21 @@ type TVclDesigner = class(tvcform)
|
|||
if node Is class(TComponentTreeNode) then
|
||||
begin
|
||||
comp := node.Component;
|
||||
node.Recycling(); //销毁节点
|
||||
if comp is class(TDComponent) then //销毁节点对应控件
|
||||
tree := Node.owner;
|
||||
node.Recycling();
|
||||
if tree is class(TComponentTree) then
|
||||
begin
|
||||
tree.deleteitem(node);
|
||||
node.Recycling();
|
||||
end
|
||||
if comp is class(TDComponent) then
|
||||
begin
|
||||
wd := comp.Cwnd;
|
||||
if wd is class(TComponent) then wd.Recycling();
|
||||
end
|
||||
end
|
||||
end
|
||||
function createmainmenubyarray(ms,pm,oer); //构造菜单
|
||||
function createmainmenubyarray(ms,pm,oer);
|
||||
begin
|
||||
if not(ifarray(ms) and ms) then exit;
|
||||
if ms["type"]="menu" then
|
||||
|
|
@ -218,23 +231,23 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
end
|
||||
public //复制粘贴
|
||||
function copynode(node); //复制
|
||||
function copynode(node);
|
||||
begin
|
||||
fcutcopyinfo := getnodeinfodata(node);
|
||||
end
|
||||
function cutnode(node); //剪切节点
|
||||
function cutnode(node);
|
||||
begin
|
||||
fcutcopyinfo := getnodeinfodata(node);
|
||||
fcutcopyinfo := getnodeinfodata(node,1);
|
||||
fcutcopyinfo[2] := true;
|
||||
end
|
||||
function pasttonode(nd);//粘贴节点
|
||||
function pasttonode(nd);
|
||||
begin
|
||||
if not fcutcopyinfo then return ;
|
||||
ifc := fcutcopyinfo[2];
|
||||
r := pastinfotonode(nd,fcutcopyinfo,1,not(ifc));
|
||||
if ifc and not(r) then fcutcopyinfo := nil; //如果失败就不清除内容
|
||||
end
|
||||
function pastinfotonode(nd,data,fst,notcute); //粘贴节点
|
||||
function pastinfotonode(nd,data,fst,notcute);
|
||||
begin
|
||||
tc := data[0];
|
||||
if ifstring(tc) then tc := class(TDComponent).GetClassItem(tc);
|
||||
|
|
@ -266,7 +279,7 @@ type TVclDesigner = class(tvcform)
|
|||
if i = "top" then pidx := 3 ; //位置判断
|
||||
if vi>pclt[pidx] then
|
||||
begin
|
||||
vi := integer(pclt[pidx]+(pclt[pidx-2]/2)-10); //位置处理
|
||||
vi := integer(pclt[pidx]+(pclt[pidx-2]/2)-5); //位置处理
|
||||
end
|
||||
end
|
||||
nnd.SetComponentProperties(i,vi);
|
||||
|
|
@ -276,22 +289,24 @@ type TVclDesigner = class(tvcform)
|
|||
pastinfotonode(nnd.TreeNode,v);
|
||||
end
|
||||
end
|
||||
function getnodeinfodata(node); //复制节点信息
|
||||
function getnodeinfodata(node,f);
|
||||
begin
|
||||
tc := node.Component;
|
||||
r := array();
|
||||
if tc is class(TDComponent) then
|
||||
begin
|
||||
r[0] := tc.dclassname() ;
|
||||
//if f then r["name"] := tc.name;
|
||||
cr := tc.GetChangedPublish(2);
|
||||
for i,v in cr do
|
||||
begin
|
||||
//if ifobj(v) then continue; //对象就忽略
|
||||
if not(v and ifstring(i) ) then continue; //严格判断
|
||||
r[i] := v;
|
||||
end
|
||||
for i := 0 to node.ItemCount-1 do
|
||||
begin
|
||||
r[1,i] := getnodeinfodata((node.items)[i]);//
|
||||
r[1,i] := getnodeinfodata((node.items)[i],f);//
|
||||
end
|
||||
end
|
||||
return r;
|
||||
|
|
@ -382,6 +397,21 @@ type TVclDesigner = class(tvcform)
|
|||
begin
|
||||
FProjectManager.ShowCurrentFormCode();//ShowEditor();
|
||||
end
|
||||
|
||||
Function EnabledDesigner(f);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 设置designer是否可用 %%
|
||||
@param(f)(bool)
|
||||
**}
|
||||
FObjInspector.Visible := F;
|
||||
self.Enabled := f;
|
||||
rt := FTree.RootItem;
|
||||
if rt and rt.ItemCount>0 then
|
||||
it := (rt.items)[0];
|
||||
if it then itt := it.Component;
|
||||
if itt then itt.Cwnd.Enabled := f;
|
||||
end
|
||||
function TreeNode2tfm(lib,itemnames,nd); //转换文件
|
||||
begin
|
||||
{**
|
||||
|
|
@ -396,7 +426,7 @@ type TVclDesigner = class(tvcform)
|
|||
begin
|
||||
FProjectManager.saveCurrentEdit();
|
||||
end
|
||||
function mainmenus(); //设计器菜单
|
||||
function mainmenus();virtual;
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 菜单
|
||||
|
|
@ -449,17 +479,17 @@ type TVclDesigner = class(tvcform)
|
|||
);
|
||||
end
|
||||
public
|
||||
function DeleFiledFromEdit(n,nn); //删除变量
|
||||
function DeleFiledFromEdit(n,nn);
|
||||
begin
|
||||
if FTree.Loading then return ;
|
||||
FProjectManager.DeleteAFiled(n,nn);
|
||||
end
|
||||
function AddFiledFromEdit(n); //添加变量
|
||||
function AddFiledFromEdit(n);
|
||||
begin
|
||||
if FTree.Loading then return ;
|
||||
FProjectManager.AddAFiled(n);
|
||||
end
|
||||
function AddusesFromEdit(lbs); //添加uses
|
||||
function AddusesFromEdit(lbs);
|
||||
begin
|
||||
if FTree.Loading then return ;
|
||||
FProjectManager.adduses(lbs);
|
||||
|
|
@ -474,7 +504,7 @@ type TVclDesigner = class(tvcform)
|
|||
SetFunctionList(classinfo["funcs"]);
|
||||
end
|
||||
end
|
||||
function LoadProject(n); //当如工程
|
||||
function LoadProject(n);
|
||||
begin
|
||||
FProjectManager.SetProjectInfo(n);
|
||||
end
|
||||
|
|
@ -492,7 +522,7 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
return r;
|
||||
end
|
||||
function OpenHelp(o,e); //打开帮助
|
||||
function OpenHelp(o,e);
|
||||
begin
|
||||
if not FChmHelper then
|
||||
begin
|
||||
|
|
@ -516,12 +546,14 @@ type TVclDesigner = class(tvcform)
|
|||
"控件详情":
|
||||
begin
|
||||
FChmHelper.ChmName := "help\\tslvclhelp.chm";
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
FChmHelper.ShowTslLangChm();
|
||||
//_wapi.WinExec('cmd.exe /C start http://bzjj.sinaapp.com/tslvclhelp/index.html',0);
|
||||
end
|
||||
function ComponentMove(o,e); //控件移动
|
||||
function ComponentMove(o,e); //移动
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 移动 控件 %%
|
||||
|
|
@ -540,7 +572,7 @@ type TVclDesigner = class(tvcform)
|
|||
FPropGrid.SetGridValue("height",o.height,O);
|
||||
//setcomponentfocus(o,false);
|
||||
end
|
||||
function DesignerClose(o,e) //控件窗口关闭
|
||||
function DesignerClose(o,e) //关闭
|
||||
begin
|
||||
{**
|
||||
@explan(说明)保存 %%
|
||||
|
|
@ -575,7 +607,7 @@ type TVclDesigner = class(tvcform)
|
|||
|
||||
public
|
||||
//****************************************
|
||||
function CreateComponent(); //构造控件
|
||||
function CreateComponent(); //构造句柄
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 构造组件 %%
|
||||
|
|
@ -614,16 +646,27 @@ type TVclDesigner = class(tvcform)
|
|||
//echo "\r\n 添加控件";
|
||||
return r;
|
||||
end
|
||||
function setcomponentfocus(cwnd,fk); //设置获得选中
|
||||
function RectToPoints(rc);
|
||||
begin
|
||||
{**
|
||||
@explan(说明)辅助函数
|
||||
**}
|
||||
r := array();
|
||||
r := array((rc[0],rc[1]),(rc[2],rc[1]),(rc[2],rc[3]),(rc[0],rc[3]),(rc[0],rc[1]));
|
||||
return r;
|
||||
end
|
||||
function setcomponentfocus(cwnd,fk);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 设计控件获得焦点 %%
|
||||
**}
|
||||
if not(cwnd is class(TWincontrol)) then exit ;
|
||||
if not cwnd.HandleAllocated() then exit;
|
||||
//if cwnd is class(tvcform) then exit;
|
||||
//if cwnd.WsPopUp then exit;
|
||||
return cwnd.DesigningSelect(fk);
|
||||
end
|
||||
function TreeNodeSelected(n); //控件树选中节点
|
||||
function TreeNodeSelected(n);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 节点被选择 %%
|
||||
|
|
@ -643,7 +686,7 @@ type TVclDesigner = class(tvcform)
|
|||
return t.SelectedNode();
|
||||
end
|
||||
private
|
||||
function RClickComponent(o,e); //右键控件窗口
|
||||
function RClickComponent(o,e);
|
||||
begin
|
||||
{**
|
||||
@explan(说明)右键菜单 %%
|
||||
|
|
@ -653,7 +696,7 @@ type TVclDesigner = class(tvcform)
|
|||
if not(tr.visible) then
|
||||
begin
|
||||
wnd := fwindowinfos.getnodebytree(tr);
|
||||
FProjectManager.setnodesel(wnd);
|
||||
FProjectManager.senodesel(wnd);
|
||||
return ;//
|
||||
end
|
||||
if FCurrentNode<>nd then
|
||||
|
|
@ -680,7 +723,7 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
//FClickTime;
|
||||
public
|
||||
function addandopeneventbyname(nd,n); //打开事件函数位置
|
||||
function addandopeneventbyname(nd,n);
|
||||
begin
|
||||
if nd then
|
||||
begin
|
||||
|
|
@ -721,7 +764,7 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
FProjectManager.ShowEditor();
|
||||
end
|
||||
function AddAndOPenEvent(nd); //打开事件函数
|
||||
function AddAndOPenEvent(nd);
|
||||
begin
|
||||
{**
|
||||
@explan(说明)通过节点打开函数编辑器 %%
|
||||
|
|
@ -747,7 +790,7 @@ type TVclDesigner = class(tvcform)
|
|||
if not(tr.visible) then
|
||||
begin
|
||||
wnd := fwindowinfos.getnodebytree(tr);
|
||||
FProjectManager.setnodesel(wnd);
|
||||
FProjectManager.senodesel(wnd);
|
||||
return ;//
|
||||
end
|
||||
if FCurrentNode<> nd then
|
||||
|
|
@ -804,7 +847,7 @@ type TVclDesigner = class(tvcform)
|
|||
if o._Tag is class(tmenu) then o._tag.Checked := false;
|
||||
end
|
||||
|
||||
function OnToolButtonCick(o,e); //工具按钮被点击
|
||||
function OnToolButtonCick(o,e); //工具栏
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 选择工具按钮 %%
|
||||
|
|
@ -822,7 +865,7 @@ type TVclDesigner = class(tvcform)
|
|||
FProjectManager.CloseCurrentEdit(nil,true);
|
||||
end
|
||||
public
|
||||
function BindCwndMessage(wnd); //给控件绑定处理函数
|
||||
function BindCwndMessage(wnd);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 为控件添加事件 %%
|
||||
|
|
@ -848,11 +891,21 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
end
|
||||
end
|
||||
function UnLoadTreeNode(wndnode); //卸载控件树
|
||||
function UnLoadTreeNode(wndnode);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 卸载tree的节点%%
|
||||
**}
|
||||
//fcutcopyinfo := nil;
|
||||
if wndnode = "all" then
|
||||
begin
|
||||
for i,v in fwindowinfos.fdata.data do
|
||||
begin
|
||||
FProjectManager.saveCurrentEdit(v.fnode);
|
||||
UnLoadTreeNode(v.fnode);
|
||||
end
|
||||
return ;
|
||||
end
|
||||
nd := fwindowinfos.getdata(wndnode);
|
||||
if not nd then return ;
|
||||
hidenatree(nd);
|
||||
|
|
@ -866,7 +919,7 @@ type TVclDesigner = class(tvcform)
|
|||
tr.Recycling();
|
||||
end
|
||||
private
|
||||
function hidenatree(nd);//隐藏控件树
|
||||
function hidenatree(nd);
|
||||
begin
|
||||
FCurrentNode := nil;
|
||||
if nd then
|
||||
|
|
@ -874,7 +927,6 @@ type TVclDesigner = class(tvcform)
|
|||
tr := nd.ftree;
|
||||
tr.visible := false;
|
||||
nd.fvars := FVariableSelecter.getlistds();
|
||||
nd.fcomp := FEventGrid.Component;
|
||||
FEventGrid.Component := array();
|
||||
FPropGrid.Component := array();
|
||||
nd.ffuncs := FFunctionSelecter.List.data;
|
||||
|
|
@ -882,7 +934,7 @@ type TVclDesigner = class(tvcform)
|
|||
class(TDComponent).TemporaryNotName:= array();
|
||||
end
|
||||
end
|
||||
function showtree(nd); //显示控件树
|
||||
function showtree(nd);
|
||||
begin
|
||||
FCurrentNode := nil;
|
||||
tr := nd.ftree;
|
||||
|
|
@ -891,10 +943,8 @@ type TVclDesigner = class(tvcform)
|
|||
FVariableSelecter.setlistds(nd.fvars);
|
||||
FFunctionSelecter.additems(nd.ffuncs);
|
||||
class(TDComponent).TemporaryNotName := nd.fnames;
|
||||
FPropGrid.Component := nd.fcomp ;
|
||||
FEventGrid.Component := nd.fcomp ;
|
||||
end
|
||||
function switchtree(nd); //切换控件树
|
||||
function switchtree(nd);
|
||||
begin
|
||||
FCurrentNode := nil;
|
||||
if nd<>fcwindowinfo then
|
||||
|
|
@ -904,28 +954,22 @@ type TVclDesigner = class(tvcform)
|
|||
hidenatree(fcwindowinfo);
|
||||
end
|
||||
fcwindowinfo := nd;
|
||||
if nd then
|
||||
FTree := fcwindowinfo.ftree;
|
||||
showtree(fcwindowinfo);
|
||||
rnd := FTree.RootItem;
|
||||
nnd := rnd.GetNodeByIndex(0);
|
||||
if nnd then
|
||||
begin
|
||||
FTree := fcwindowinfo.ftree;
|
||||
showtree(fcwindowinfo);
|
||||
if not(nd.fclk) then //不在最上层处理一下
|
||||
cp := nnd.Component;
|
||||
if not cp then return ;
|
||||
wd := cp.Cwnd;
|
||||
if wd.visible then
|
||||
begin
|
||||
nnd := FTree.RootItem.GetNodeByIndex(0);
|
||||
if nnd then
|
||||
begin
|
||||
cp := nnd.Component;
|
||||
if cp then
|
||||
begin
|
||||
wd := cp.Cwnd;
|
||||
if wd.visible then
|
||||
begin
|
||||
wd.visible := false;
|
||||
wd.visible := true;
|
||||
end
|
||||
end
|
||||
end
|
||||
wd.visible := false;
|
||||
wd.visible := true;
|
||||
FPropGrid.Component := cp;
|
||||
FEventGrid.Component := cp;
|
||||
end
|
||||
nd.fclk := false;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -966,11 +1010,12 @@ type TVclDesigner = class(tvcform)
|
|||
end ;
|
||||
|
||||
end
|
||||
function LoadTreeNode(Ptfm,inh,wndnode);//加载控件树
|
||||
function LoadTreeNode(Ptfm,inh,wndnode);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 加载tree节点 %%
|
||||
**}
|
||||
//UnLoadTreeNode();
|
||||
if FTree and FTree.Loading then return ;
|
||||
cwindowinfo := fwindowinfos.getorcreate(wndnode,ifold);
|
||||
if cwindowinfo = fcwindowinfo then
|
||||
|
|
@ -1001,7 +1046,7 @@ type TVclDesigner = class(tvcform)
|
|||
end ;
|
||||
FTree.Loading := nil;
|
||||
end
|
||||
function loadtfmtotree(p,d,node,wr,prs,obarray,inhname);//当如信息
|
||||
function loadtfmtotree(p,d,node,wr,prs,obarray,inhname);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 导入tfm文件 %%
|
||||
|
|
@ -1074,7 +1119,7 @@ type TVclDesigner = class(tvcform)
|
|||
end
|
||||
//comp.DoControlAlign();
|
||||
end
|
||||
function SetFunctionList(v); //设置函数信息
|
||||
function SetFunctionList(v);
|
||||
begin
|
||||
{**
|
||||
@explan(说明) 设置当前类使用的函数名称 %%
|
||||
|
|
@ -1206,7 +1251,7 @@ type TVclDesigner = class(tvcform)
|
|||
FProjectManager.FTslEditer.setdbugruncall(thisfunction(debugproject)); //设置调试回调
|
||||
|
||||
end
|
||||
property VariableSelecter read FVariableSelecter; //当前控件树的变量对象
|
||||
property VariableSelecter read FVariableSelecter;
|
||||
private
|
||||
function ViewBitmap(o,e);
|
||||
begin
|
||||
|
|
@ -1224,7 +1269,7 @@ type TVclDesigner = class(tvcform)
|
|||
FViewBitmap.visible := not FViewBitmap.visible;
|
||||
if o then o.Checked := FViewBitmap.visible;
|
||||
end
|
||||
function StopProject(o,e); //停止运行,目前没用
|
||||
function StopProject(o,e);
|
||||
begin
|
||||
//FRounMenu.Enabled := true;
|
||||
//FStopMenu.Enabled := false;
|
||||
|
|
@ -1238,11 +1283,11 @@ type TVclDesigner = class(tvcform)
|
|||
FRounMenu.Enabled := true;
|
||||
FStopMenu.Enabled := false;
|
||||
end
|
||||
function editcommandline();//执行命令行
|
||||
function editcommandline();
|
||||
begin
|
||||
FProjectManager.ShowExeEditer();
|
||||
end
|
||||
function debugproject(o,e); //调试运行
|
||||
function debugproject(o,e);
|
||||
begin
|
||||
FProjectManager.debugproject();
|
||||
end
|
||||
|
|
@ -1263,7 +1308,7 @@ type TVclDesigner = class(tvcform)
|
|||
o.Checked := FObjInspector.Visible
|
||||
end
|
||||
end
|
||||
function initobjinspector(); //初始化
|
||||
function initobjinspector();
|
||||
begin
|
||||
project := new TPairSplitter(self);
|
||||
project.visible := false;
|
||||
|
|
@ -1306,15 +1351,13 @@ end
|
|||
|
||||
implementation
|
||||
type tfileinfonode = class()
|
||||
fnode; //文件节点
|
||||
ftree; //窗口对应树
|
||||
ffuncs; //函数名
|
||||
fvars; //变量
|
||||
fnames; //可用的变量名
|
||||
fcomp; //选中的控件
|
||||
fclk; //是否点击选择
|
||||
fnode;
|
||||
ftree;
|
||||
ffuncs;
|
||||
fvars;
|
||||
fnames;
|
||||
end
|
||||
type tfilesinfo = class() //控件树存储对象
|
||||
type tfilesinfo = class()
|
||||
private
|
||||
fdesginer;
|
||||
fcompclick;
|
||||
|
|
@ -1330,7 +1373,7 @@ type tfilesinfo = class() //
|
|||
fparent := fp;
|
||||
|
||||
end
|
||||
function getdata(id); //通文件节点获得信息
|
||||
function getdata(id); //获得节点信息
|
||||
begin
|
||||
if not id then return fdata;
|
||||
for i,v in fdata.data do
|
||||
|
|
@ -1338,7 +1381,7 @@ type tfilesinfo = class() //
|
|||
if v.fnode = id then return v;
|
||||
end
|
||||
end
|
||||
function gettreebyid(id); //通过文件节点树获得树
|
||||
function gettreebyid(id);
|
||||
begin
|
||||
if not id then return fdata;
|
||||
for i,v in fdata.data do
|
||||
|
|
@ -1346,18 +1389,14 @@ type tfilesinfo = class() //
|
|||
if v.fnode = id then return v.FTree;
|
||||
end
|
||||
end
|
||||
function getnodebytree(tr); //通过树获得文件节点
|
||||
function getnodebytree(tr);
|
||||
begin
|
||||
for i,v in fdata.data do
|
||||
begin
|
||||
if v.ftree = tr then
|
||||
begin
|
||||
v.fclk := true;
|
||||
return v.fnode;
|
||||
end
|
||||
if v.ftree = tr then return v.fnode;
|
||||
end
|
||||
end
|
||||
function getorcreate(id,ifold); //如果存在返回,不存在构造并返回
|
||||
function getorcreate(id,ifold);
|
||||
begin
|
||||
nd := getdata(id);
|
||||
ifold := true ;
|
||||
|
|
@ -1373,7 +1412,7 @@ type tfilesinfo = class() //
|
|||
end
|
||||
return nd;
|
||||
end
|
||||
function add(nd,tr,fcs,vs);//添加一个
|
||||
function add(nd,tr,fcs,vs);
|
||||
begin
|
||||
for i,v in FData.data do
|
||||
begin
|
||||
|
|
@ -1402,7 +1441,7 @@ type tfilesinfo = class() //
|
|||
ftreeparnet;
|
||||
fdata;
|
||||
end
|
||||
type TPropEditGrid = class(TPropGrid) //属性编辑
|
||||
type TPropEditGrid = class(TPropGrid)
|
||||
{**
|
||||
@explan(说明) 属性编辑 %%
|
||||
**}
|
||||
|
|
@ -1426,7 +1465,7 @@ type TPropEditGrid = class(TPropGrid) //
|
|||
end
|
||||
|
||||
end
|
||||
type TEventEditGrid = class(TPropGrid) //事件编辑器
|
||||
type TEventEditGrid = class(TPropGrid)
|
||||
{**
|
||||
@explan(说明) 事件编辑 %%
|
||||
**}
|
||||
|
|
@ -1451,7 +1490,7 @@ type TEventEditGrid = class(TPropGrid) //
|
|||
inherited;
|
||||
OndblClick := thisfunction(GridCellDblClick);
|
||||
end
|
||||
function GridCellDblClick(o,e);override;//双击处理
|
||||
function GridCellDblClick(o,e);override;
|
||||
begin
|
||||
i := e.iitem;
|
||||
j := e.isubitem;
|
||||
|
|
@ -1528,7 +1567,7 @@ type TDesigImageList = class(TControlImageList)
|
|||
return r?r:0;
|
||||
end
|
||||
end
|
||||
type TDesignertoolbars = class(TPageControl) //设计器控件按钮
|
||||
type TDesignertoolbars = class(TPageControl)
|
||||
private
|
||||
FToolbars;
|
||||
FLabels ;
|
||||
|
|
@ -1580,7 +1619,7 @@ type TDesignertoolbars = class(TPageControl) //
|
|||
else v.Cursor := OCR_NORMAL;
|
||||
end
|
||||
end
|
||||
function addbtn(btn,t); //加入按钮
|
||||
function addbtn(btn,t);
|
||||
begin
|
||||
if not(t and ifstring(t)) then
|
||||
begin
|
||||
|
|
@ -1608,6 +1647,10 @@ type TDesignertoolbars = class(TPageControl) //
|
|||
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
type TViewBitmap = class(TvcForm)
|
||||
{**
|
||||
@explan(说明) 图片信息采集%%
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ type TProjectView = class(TVCForm) //
|
|||
FWrapFolder.Caption := "打包工程到目录";
|
||||
return;
|
||||
end
|
||||
function setnodesel(nd);
|
||||
function senodesel(nd);
|
||||
begin
|
||||
ftree.setsel(nd);
|
||||
end
|
||||
|
|
@ -506,7 +506,6 @@ type TProjectView = class(TVCForm) //
|
|||
if FTree.PopUpMenu then
|
||||
begin
|
||||
it := e.itemnew;
|
||||
if it=ftree.RootNode then return FDesigner.ExecuteCommand("hiddrennode",nil);
|
||||
if it then
|
||||
begin
|
||||
if it.FType="dir" then
|
||||
|
|
@ -744,11 +743,10 @@ type TProjectView = class(TVCForm) //
|
|||
FDesigner.ExecuteCommand("hiddrennode",nil);
|
||||
fn := FCurrentOpend.geteditfilename();
|
||||
it := FTslEditer.OpenAndGotoFileByName(fn);
|
||||
if not it then
|
||||
begin
|
||||
return FCurrentOpend := nil;
|
||||
end
|
||||
if not it then return FCurrentOpend := nil;
|
||||
|
||||
ShowEditor(); //FTslEditer.Show();
|
||||
|
||||
end
|
||||
"form","panel":
|
||||
begin
|
||||
|
|
@ -923,8 +921,7 @@ type TProjectView = class(TVCForm) //
|
|||
end;
|
||||
end
|
||||
//FTree.DeleteNode(nd);
|
||||
FTree.DeleteCurrentNode();
|
||||
//nd.Recycling();
|
||||
nd.Recycling();
|
||||
SaveProjInfo();
|
||||
end
|
||||
end
|
||||
|
|
@ -1906,7 +1903,7 @@ type TFileTree = class(TTreeCtl)
|
|||
FPNode.Caption := "当前工程";
|
||||
FPNode.FType := "dir";
|
||||
FPNode.parent := RootNode;
|
||||
//SetSel(FPNode);
|
||||
SetSel(FPNode);
|
||||
end
|
||||
function GetNodesByName(nds,n);
|
||||
begin
|
||||
|
|
@ -1971,10 +1968,10 @@ type TFileTree = class(TTreeCtl)
|
|||
C := CurrentNode;
|
||||
if not c then return false;
|
||||
if FPNode=c then return false;
|
||||
//pc := c.parent;
|
||||
//DeleteNode(c);
|
||||
//if pc.ItemCount<1 then setsel(pc);
|
||||
//else setsel(pc.GetNodeByIndex(0));
|
||||
pc := c.parent;
|
||||
DeleteNode(c);
|
||||
if pc.ItemCount<1 then setsel(pc);
|
||||
else setsel(pc.GetNodeByIndex(0));
|
||||
c.Recycling();
|
||||
end
|
||||
function GetNodePath(nd); //获得目录节点的path
|
||||
|
|
|
|||
|
|
@ -4389,7 +4389,6 @@ type TTslCodeMap=class(TTreeView) //tsl
|
|||
//Ë«»÷
|
||||
if not FTreeEditer then return;
|
||||
nd := CurrentNode;
|
||||
if not nd then return ;
|
||||
line := nd._tag;
|
||||
if line>0 then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -2661,7 +2661,7 @@ type TTreeNode=class(TTreeCtlNode)
|
|||
begin
|
||||
DeleteChildren();
|
||||
end
|
||||
(*function HandleAllocated();
|
||||
function HandleAllocated();
|
||||
begin
|
||||
{**
|
||||
@explan(说明)是否句柄有效%%
|
||||
|
|
@ -2674,7 +2674,7 @@ type TTreeNode=class(TTreeCtlNode)
|
|||
{**
|
||||
@explan(说明) 构建句柄 %%
|
||||
**}
|
||||
end *)
|
||||
end
|
||||
function InsertNode(node,bnode);override;
|
||||
begin
|
||||
{**
|
||||
|
|
@ -2874,7 +2874,6 @@ type TTreeView=class(TTreeCtl)
|
|||
@explan(说明) 删除 节点,但是节点不会销毁,请用node.recycling 销毁 %%
|
||||
@param(node)(TTreeNode)
|
||||
**}
|
||||
return deletenode(node);
|
||||
if node is class(TTreeNode)then
|
||||
begin
|
||||
end else
|
||||
|
|
@ -3200,34 +3199,10 @@ type TPairSplitter=class(tcustomcontrol) //
|
|||
end
|
||||
function MouseMove(o,e);override;
|
||||
begin
|
||||
if (csDesigning in ComponentState) then return ;
|
||||
if FIs_Draging then
|
||||
begin
|
||||
nxy := clienttowindow(e.xpos,e.ypos);
|
||||
_wapi.ImageList_DragMove(nxy[0],nxy[1]);
|
||||
end else
|
||||
begin
|
||||
idx := 0;
|
||||
for i:= 0 to FSides.count-1 do
|
||||
begin
|
||||
vi := FSides[i];
|
||||
if vi.Enabled and vi.Visible then idx++;
|
||||
if idx>1 then break;
|
||||
end
|
||||
if idx>1 then
|
||||
begin
|
||||
if FSplitterType=pstHorizontal then
|
||||
begin
|
||||
cursor := OCR_SIZEWE;
|
||||
end else
|
||||
if FSplitterType=pstVertical then
|
||||
begin
|
||||
cursor := OCR_SIZENS ;
|
||||
end
|
||||
end else
|
||||
begin
|
||||
cursor := OCR_NORMAL;
|
||||
end
|
||||
end
|
||||
inherited;
|
||||
end
|
||||
|
|
|
|||
|
|
@ -465,10 +465,6 @@ type TcustomTreeCtlNode = class(TVirtualListItem)
|
|||
CurrentDeleteNode := nd;
|
||||
nd.parent := self(true);
|
||||
CurrentDeleteNode := nil;
|
||||
if nd = Owner.CurrentNode then
|
||||
begin
|
||||
Owner.SetSel(nil);
|
||||
end
|
||||
finally
|
||||
Owner.DecPaintLock();
|
||||
end
|
||||
|
|
@ -1700,11 +1696,7 @@ type TcustomTreeCtl = class(TVirtualList)
|
|||
@explan(说明) 设置选中节点 %%
|
||||
@param(it)(TcustomTreeCtlNode) 节点 %%
|
||||
**}
|
||||
if flockchangedcall then
|
||||
begin
|
||||
return ;//
|
||||
end
|
||||
if ifnil(it) or ( (it is class(TcustomTreeCtlNode))and (it.Owner=self)) then
|
||||
if(it is class(TcustomTreeCtlNode))and it.Owner=self then
|
||||
begin
|
||||
r := CallSelChange(it);
|
||||
if r then return;
|
||||
|
|
@ -1719,7 +1711,6 @@ type TcustomTreeCtl = class(TVirtualList)
|
|||
end
|
||||
function GoToNode(it);
|
||||
begin
|
||||
if not((it is class(TcustomTreeCtlNode))and (it.Owner=self)) then return ;
|
||||
if NodeInList(it)then
|
||||
begin
|
||||
//return SetTopLine(GetItemIndex(it)); //滚动
|
||||
|
|
@ -1765,12 +1756,15 @@ type TcustomTreeCtl = class(TVirtualList)
|
|||
end
|
||||
inherited;
|
||||
end
|
||||
{function CreateNode();virtual;
|
||||
function CreateNode();virtual;
|
||||
begin
|
||||
{**
|
||||
@ignore(ºöÂÔ) %%
|
||||
**}
|
||||
return CreateTreeNode();
|
||||
r := new TcustomTreeCtlNode(self(true));
|
||||
return r;
|
||||
end}
|
||||
end
|
||||
function CreateTreeNode();virtual;
|
||||
begin
|
||||
r := new TcustomTreeCtlNode(self(true));
|
||||
|
|
@ -1833,9 +1827,7 @@ type TcustomTreeCtl = class(TVirtualList)
|
|||
begin
|
||||
//setprofiler(1+2+4);
|
||||
//exportfile(ftstream(),"","d:\\tst\\abc.stm",getprofilerinfo(true));
|
||||
flockchangedcall := true;
|
||||
if FRootItem then FRootItem.Recycling();
|
||||
flockchangedcall := false;
|
||||
FRootItem := nil;
|
||||
FCurrentNode := nil;
|
||||
FOnSelChanging := nil;
|
||||
|
|
@ -1887,7 +1879,6 @@ type TcustomTreeCtl = class(TVirtualList)
|
|||
return FRootItem;
|
||||
end
|
||||
private
|
||||
flockchangedcall;//
|
||||
FOnlyLeafNodeCheckMark;
|
||||
FNodeHierarchyWidth;
|
||||
FMulSelected;
|
||||
|
|
|
|||
Loading…
Reference in New Issue