parent
ab4811d834
commit
3b9ac6f107
|
|
@ -229,6 +229,57 @@ type TDComponent = class()
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
end
|
end
|
||||||
|
function copyclick(o,e);virtual;
|
||||||
|
begin
|
||||||
|
cp:=o.Component;
|
||||||
|
if not cp then exit;
|
||||||
|
nd := cp.TreeNode;
|
||||||
|
If not nd then exit;
|
||||||
|
d := nd.owner.Designer;
|
||||||
|
d.copynode(nd);
|
||||||
|
end
|
||||||
|
function cutclick(o,e);virtual;
|
||||||
|
begin
|
||||||
|
cp:=o.Component;
|
||||||
|
if not cp then exit;
|
||||||
|
nd := cp.TreeNode;
|
||||||
|
If not nd then exit;
|
||||||
|
ndp := nd.parent;
|
||||||
|
if ndp then
|
||||||
|
begin
|
||||||
|
dm := MessageBoxA("即将剪切:"+nd.Caption,"删除",(0x1 .| 0x30),nd.owner);//
|
||||||
|
if dm<>1 then exit;
|
||||||
|
d := nd.owner.Designer;
|
||||||
|
d.cutnode(nd);
|
||||||
|
wd := nd.Component.Cwnd;
|
||||||
|
ds := nd.owner.Designer;
|
||||||
|
//ds.setcomponentfocus(wd,false);
|
||||||
|
ndp.deletenode(nd);
|
||||||
|
ns := array();
|
||||||
|
wds := array();
|
||||||
|
GetDeleteNames(nd,ns,wds); //处理删除名字
|
||||||
|
for i,nsv in ns do
|
||||||
|
ds.DeleFiledFromEdit(nsv,"");
|
||||||
|
ds.EditerCodeChanged();
|
||||||
|
|
||||||
|
nd.Recycling();
|
||||||
|
if wd then
|
||||||
|
begin
|
||||||
|
wd.Recycling();
|
||||||
|
end
|
||||||
|
o.Component := nil;
|
||||||
|
ndp.Owner.SetSel(ndp);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function pasteclick(o,e);virtual;
|
||||||
|
begin
|
||||||
|
cp:=o.Component;
|
||||||
|
if not cp then exit;
|
||||||
|
nd := cp.TreeNode;
|
||||||
|
If not nd then exit;
|
||||||
|
d := nd.owner.Designer;
|
||||||
|
d.pasttonode(nd);
|
||||||
|
end
|
||||||
function deleteclick(o,e);virtual; //控件删除操作
|
function deleteclick(o,e);virtual; //控件删除操作
|
||||||
begin
|
begin
|
||||||
cp:=o.Component;
|
cp:=o.Component;
|
||||||
|
|
@ -238,7 +289,7 @@ type TDComponent = class()
|
||||||
ndp := nd.parent;
|
ndp := nd.parent;
|
||||||
if ndp then
|
if ndp then
|
||||||
begin
|
begin
|
||||||
dm := MessageBoxA("即将删除:"+nd.Caption,"删除",0x1 .| 0x30,nd.owner);//
|
dm := MessageBoxA("即将删除:"+nd.Caption,"删除",(0x1 .| 0x30),nd.owner);//
|
||||||
if dm<>1 then exit;
|
if dm<>1 then exit;
|
||||||
wd := nd.Component.Cwnd;
|
wd := nd.Component.Cwnd;
|
||||||
ds := nd.owner.Designer;
|
ds := nd.owner.Designer;
|
||||||
|
|
@ -362,11 +413,16 @@ type TDComponent = class()
|
||||||
|
|
||||||
function menus();virtual; //菜单项
|
function menus();virtual; //菜单项
|
||||||
begin
|
begin
|
||||||
return array(
|
r := array(
|
||||||
("type":"menu","caption":"删除","id":"delete","onclick":thisfunction(deleteclick)),
|
("type":"menu","caption":"删除","id":"delete","onclick":thisfunction(deleteclick)),
|
||||||
|
("type":"menu","caption":"复制","id":"copy","onclick":thisfunction(copyclick)),
|
||||||
|
("type":"menu","caption":"剪切","id":"cut","onclick":thisfunction(cutclick)),
|
||||||
|
("type":"menu","caption":"粘贴","id":"paste","onclick":thisfunction(pasteclick)),
|
||||||
("type":"menu","caption":"上移","onclick":thisfunction(MoveComponentUp)),
|
("type":"menu","caption":"上移","onclick":thisfunction(MoveComponentUp)),
|
||||||
("type":"menu","caption":"下移","onclick":thisfunction(MoveComponentDown))
|
("type":"menu","caption":"下移","onclick":thisfunction(MoveComponentDown))
|
||||||
);
|
);
|
||||||
|
if not IsContainer() then r := select * from r where ["caption"]<>"粘贴" end;
|
||||||
|
return r;
|
||||||
end
|
end
|
||||||
function CreateNode(tnode,owner,tree,Pwnd);virtual;
|
function CreateNode(tnode,owner,tree,Pwnd);virtual;
|
||||||
begin
|
begin
|
||||||
|
|
@ -400,6 +456,7 @@ type TDComponent = class()
|
||||||
tn.SelImgId := Imgs;
|
tn.SelImgId := Imgs;
|
||||||
end
|
end
|
||||||
o := createobject({ClassObject()}self(true).classinfo(1),owner);
|
o := createobject({ClassObject()}self(true).classinfo(1),owner);
|
||||||
|
o.imgs := imgs;
|
||||||
if not o then return 0;
|
if not o then return 0;
|
||||||
o.TreeNode := tn;
|
o.TreeNode := tn;
|
||||||
SetViewParent(o.Cwnd,Pwnd);
|
SetViewParent(o.Cwnd,Pwnd);
|
||||||
|
|
@ -428,12 +485,12 @@ type TDComponent = class()
|
||||||
if FCwnd then return FCwnd.GetChangedPropertiesn(n);
|
if FCwnd then return FCwnd.GetChangedPropertiesn(n);
|
||||||
return nil;
|
return nil;
|
||||||
end
|
end
|
||||||
function GetChangedPublish();virtual;
|
function GetChangedPublish(f);virtual;
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
@explan(说明)获得改变的属性%%
|
@explan(说明)获得改变的属性%%
|
||||||
**}
|
**}
|
||||||
if FCwnd then return FCwnd.GetChangedPublish();
|
if FCwnd then return FCwnd.GetChangedPublish(f);
|
||||||
return array();
|
return array();
|
||||||
end
|
end
|
||||||
function GetPublishProperties();virtual;
|
function GetPublishProperties();virtual;
|
||||||
|
|
@ -705,11 +762,11 @@ type TDVirutalWindow = class(TCustomControl)
|
||||||
if not r then return array();//array(1:nil);
|
if not r then return array();//array(1:nil);
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function GetChangedPublish();override;
|
function GetChangedPublish(f);override;
|
||||||
begin
|
begin
|
||||||
r := getnotnil(inherited);
|
r := getnotnil(inherited);
|
||||||
if not FBindComponent then exit;
|
if not FBindComponent then exit;
|
||||||
r2 :=FBindComponent.GetChangedPublish();
|
r2 :=FBindComponent.GetChangedPublish(f);
|
||||||
if r2 then
|
if r2 then
|
||||||
begin
|
begin
|
||||||
deletefiled(r2);
|
deletefiled(r2);
|
||||||
|
|
@ -793,7 +850,7 @@ type TVclDesigner = class(tvcform)
|
||||||
@explan(说明) 控件设计器 对象 %%
|
@explan(说明) 控件设计器 对象 %%
|
||||||
**}
|
**}
|
||||||
private
|
private
|
||||||
|
fcutcopyinfo;//
|
||||||
FChmHelper;
|
FChmHelper;
|
||||||
tmpcanvas; //canvas
|
tmpcanvas; //canvas
|
||||||
FImageList; //图标
|
FImageList; //图标
|
||||||
|
|
@ -1006,6 +1063,71 @@ type TVclDesigner = class(tvcform)
|
||||||
call(thisfunction,v,pm,oer);
|
call(thisfunction,v,pm,oer);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
public //复制粘贴
|
||||||
|
function copynode(node);
|
||||||
|
begin
|
||||||
|
fcutcopyinfo := getnodeinfodata(node);
|
||||||
|
end
|
||||||
|
function cutnode(node);
|
||||||
|
begin
|
||||||
|
fcutcopyinfo := getnodeinfodata(node,1);
|
||||||
|
end
|
||||||
|
function pasttonode(nd);
|
||||||
|
begin
|
||||||
|
if fcutcopyinfo then
|
||||||
|
begin
|
||||||
|
pastinfotonode(nd,fcutcopyinfo);
|
||||||
|
if fcutcopyinfo["name"] then fcutcopyinfo := nil;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function pastinfotonode(nd,data);
|
||||||
|
begin
|
||||||
|
tc := data[0];
|
||||||
|
if (tc is class(TDRootComponent)) and not( tc is class(TDMenu)) then
|
||||||
|
begin
|
||||||
|
nd := (FTree.RootItem.items)[0];
|
||||||
|
end
|
||||||
|
|
||||||
|
nnd := tc.ComponentCreater(nd,nd.Component.Cwnd);
|
||||||
|
if not nnd then return ;
|
||||||
|
nnd.CreateName();
|
||||||
|
FVariableSelecter.additem(nnd);
|
||||||
|
BindCwndMessage(nnd.Cwnd);
|
||||||
|
for i,v in data do
|
||||||
|
begin
|
||||||
|
if ifstring(i) then
|
||||||
|
begin
|
||||||
|
//if i in array("left","top") then continue;
|
||||||
|
nnd.SetComponentProperties(i,v);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for i,v in data[1] do
|
||||||
|
begin
|
||||||
|
pastinfotonode(nnd.TreeNode,v);
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function getnodeinfodata(node,f);
|
||||||
|
begin
|
||||||
|
tc := node.Component;
|
||||||
|
r := array();
|
||||||
|
if tc is class(TDComponent) then
|
||||||
|
begin
|
||||||
|
r[0] := tc;
|
||||||
|
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],f);//
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return r;
|
||||||
|
end
|
||||||
public
|
public
|
||||||
function OpenFileFromTpjFile(); //从文件打开工程
|
function OpenFileFromTpjFile(); //从文件打开工程
|
||||||
begin
|
begin
|
||||||
|
|
@ -1647,6 +1769,7 @@ type TVclDesigner = class(tvcform)
|
||||||
{**
|
{**
|
||||||
@explan(说明) 卸载tree的节点%%
|
@explan(说明) 卸载tree的节点%%
|
||||||
**}
|
**}
|
||||||
|
fcutcopyinfo := nil;
|
||||||
node := FTree.RootItem;
|
node := FTree.RootItem;
|
||||||
if node.ItemCount>0 then
|
if node.ItemCount>0 then
|
||||||
begin
|
begin
|
||||||
|
|
@ -1849,26 +1972,6 @@ type TVclDesigner = class(tvcform)
|
||||||
FImageList := new TDesigImageList(self);
|
FImageList := new TDesigImageList(self);
|
||||||
FTree.Imagelist := FImageList;
|
FTree.Imagelist := FImageList;
|
||||||
//******************toolbar ***************
|
//******************toolbar ***************
|
||||||
{fdebugtoolbar := new TToolBar(self);
|
|
||||||
btns := FProjectManager.FTslEditer.getdbugtoolbtns();
|
|
||||||
idx := 0;
|
|
||||||
for i,v in btns do
|
|
||||||
begin
|
|
||||||
if idx = 0 then fdebugtoolbar.ImageList := v.parent.ImageList;
|
|
||||||
idx++;
|
|
||||||
if v.caption = "添加/删除断点F5" then continue;
|
|
||||||
v.parent := fdebugtoolbar;
|
|
||||||
v._tag := v.onclick;
|
|
||||||
|
|
||||||
v.onclick := function(o,e)begin
|
|
||||||
cp := o.caption;
|
|
||||||
CallMessgeFunction(o._tag,o,e);
|
|
||||||
if cp<>"终止" then
|
|
||||||
begin
|
|
||||||
FProjectManager.ShowEditor();
|
|
||||||
end
|
|
||||||
end;
|
|
||||||
end }
|
|
||||||
tlbar := FProjectManager.FTslEditer.gettoolbar();
|
tlbar := FProjectManager.FTslEditer.gettoolbar();
|
||||||
savebtn := FProjectManager.FTslEditer.gettoolbarbtn();
|
savebtn := FProjectManager.FTslEditer.gettoolbarbtn();
|
||||||
for i,v in savebtn do //处理一下保存工程
|
for i,v in savebtn do //处理一下保存工程
|
||||||
|
|
@ -1883,7 +1986,7 @@ type TVclDesigner = class(tvcform)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
tlbar.Align := alLeft;
|
tlbar.Align := alLeft;
|
||||||
tlbar.width :=440;
|
tlbar.width :=450;
|
||||||
tlbar.parent := self;
|
tlbar.parent := self;
|
||||||
tlbar.arrange :="0;1";
|
tlbar.arrange :="0;1";
|
||||||
sp1 := new tsplitter(self);
|
sp1 := new tsplitter(self);
|
||||||
|
|
@ -1904,13 +2007,7 @@ type TVclDesigner = class(tvcform)
|
||||||
ic := new Ticon();
|
ic := new Ticon();
|
||||||
ic.Readvcon(HexFormatStrToTsl(GetTsIconBitmapInfo()));
|
ic.Readvcon(HexFormatStrToTsl(GetTsIconBitmapInfo()));
|
||||||
self.FormICon := ic;
|
self.FormICon := ic;
|
||||||
{fdebugtoolbar.Align := alnone;
|
|
||||||
fdebugtoolbar.left := FToolBars.Flabelcharlen* 10;
|
|
||||||
fdebugtoolbar.top := 0;
|
|
||||||
fdebugtoolbar.parent := FToolBars;}
|
|
||||||
|
|
||||||
//文件打窗口
|
//文件打窗口
|
||||||
|
|
||||||
FProjectFileOpener := new TOpenFileADlg(self);
|
FProjectFileOpener := new TOpenFileADlg(self);
|
||||||
FProjectFileOpener.filter := array("tvcl工程":"*.tpj");
|
FProjectFileOpener.filter := array("tvcl工程":"*.tpj");
|
||||||
FProjectFileOpener.parent := self;
|
FProjectFileOpener.parent := self;
|
||||||
|
|
@ -8951,6 +9048,7 @@ type TDForm = class(TDComponent)
|
||||||
//r[0] := array("type":"menu","caption":"保存窗口");
|
//r[0] := array("type":"menu","caption":"保存窗口");
|
||||||
r[0] := array("type":"menu","caption":"打开tsf文件","onclick":thisfunction(OpenClass));
|
r[0] := array("type":"menu","caption":"打开tsf文件","onclick":thisfunction(OpenClass));
|
||||||
r[1] := array("type":"menu","caption":"保存当前窗口","onclick":thisfunction(savecurrentform));
|
r[1] := array("type":"menu","caption":"保存当前窗口","onclick":thisfunction(savecurrentform));
|
||||||
|
r[2] := array("type":"menu","caption":"粘贴","onclick":thisfunction(pasteclick));
|
||||||
//r[2] := array("type":"menu","caption":"打开工程目录","onclick":thisfunction(openProjectDir));
|
//r[2] := array("type":"menu","caption":"打开工程目录","onclick":thisfunction(openProjectDir));
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
|
|
@ -9134,6 +9232,11 @@ type TDBtn = class(TDComponent)
|
||||||
begin
|
begin
|
||||||
return Class(tbtn);
|
return Class(tbtn);
|
||||||
end
|
end
|
||||||
|
function menus();override;
|
||||||
|
begin
|
||||||
|
r := inherited;
|
||||||
|
return select * from r where ["caption"] <> "粘贴" end ;
|
||||||
|
end
|
||||||
function Create(AOwner);override;
|
function Create(AOwner);override;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
@ -9173,7 +9276,7 @@ type TDPairSplitterSide = class(TDComponent)
|
||||||
function menus();override;
|
function menus();override;
|
||||||
begin
|
begin
|
||||||
r := inherited;
|
r := inherited;
|
||||||
return select * from r where ["caption"]="删除" end ;
|
return select * from r where ["caption"] in array("删除","粘贴","剪切") end ;
|
||||||
end
|
end
|
||||||
function InToolBar();override;
|
function InToolBar();override;
|
||||||
begin
|
begin
|
||||||
|
|
@ -9308,7 +9411,7 @@ type TDTabSheet = class(TDComponent)
|
||||||
function menus();override;
|
function menus();override;
|
||||||
begin
|
begin
|
||||||
r := inherited;
|
r := inherited;
|
||||||
return select * from r where ["caption"]="删除" end ;
|
return select * from r where ["caption"] in array("删除","粘贴","剪切") end ;
|
||||||
end
|
end
|
||||||
function InToolBar();override;
|
function InToolBar();override;
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -538,7 +538,7 @@ public
|
||||||
begin
|
begin
|
||||||
return FChangedProperties[n];
|
return FChangedProperties[n];
|
||||||
end
|
end
|
||||||
function GetChangedPublish();virtual;
|
function GetChangedPublish(f);virtual;
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
@explan(说明)获取修改过的publish,设计器使用 %%
|
@explan(说明)获取修改过的publish,设计器使用 %%
|
||||||
|
|
@ -554,10 +554,16 @@ public
|
||||||
vit := vi["type"];
|
vit := vi["type"];
|
||||||
otype := GetComponentPropertyType(vit);//GetPropertyType(vit);
|
otype := GetComponentPropertyType(vit);//GetPropertyType(vit);
|
||||||
if vi["write"]and otype then
|
if vi["write"]and otype then
|
||||||
|
begin
|
||||||
|
if f=2 then
|
||||||
|
begin
|
||||||
|
r[n] := vv;
|
||||||
|
end else
|
||||||
begin
|
begin
|
||||||
r[n]:= otype.FormatTMF(vv);
|
r[n]:= otype.FormatTMF(vv);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function SetChangedPublish(n,v);virtual;
|
function SetChangedPublish(n,v);virtual;
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
begin
|
begin
|
||||||
r := inherited;
|
r := inherited;
|
||||||
if class(tflag).haslocker then return r;
|
if class(tflag).haslocker then return r;
|
||||||
|
if (o is class(TWinControl)) and o.WsPopUp then return r;
|
||||||
if HandleAllocated() and ifarray(op) and (op["type"]="possize") then //λÖôóС·¢Ëͱ仯
|
if HandleAllocated() and ifarray(op) and (op["type"]="possize") then //λÖôóС·¢Ëͱ仯
|
||||||
begin
|
begin
|
||||||
ctls := controls;
|
ctls := controls;
|
||||||
|
|
@ -189,7 +190,8 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
for j,bsi in v do
|
for j,bsi in v do
|
||||||
begin
|
begin
|
||||||
ctl := bsi.fctl;
|
ctl := bsi.fctl;
|
||||||
if ctl.Visible then
|
|
||||||
|
if ctl.Visible and not(ctl is class(TWinControl) and ctl.WsPopUp) then
|
||||||
begin
|
begin
|
||||||
bss[length(bss)]:= bsi;
|
bss[length(bss)]:= bsi;
|
||||||
drc := array(x,y,x+mwid,y+rhs[i]);
|
drc := array(x,y,x+mwid,y+rhs[i]);
|
||||||
|
|
@ -558,11 +560,17 @@ type tcoolbarlines = class() //
|
||||||
h := 0;
|
h := 0;
|
||||||
for j,vj in v do
|
for j,vj in v do
|
||||||
begin
|
begin
|
||||||
if vj["visible"] then
|
if vj["visible"] and not(vj["wspopup"]) then
|
||||||
|
begin
|
||||||
h := max(h,vj["height"]);
|
h := max(h,vj["height"]);
|
||||||
end
|
end
|
||||||
|
end
|
||||||
r[i] := h;// max(20,h);
|
r[i] := h;// max(20,h);
|
||||||
end
|
end
|
||||||
|
if (csDesigning in ComponentState) and (length(r)=1 and r[0]<2) then
|
||||||
|
begin
|
||||||
|
r[0] := 25;
|
||||||
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function EnabledChild(f); //enable
|
function EnabledChild(f); //enable
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue