forked from liujianjun/tslediter
parent
286af5904f
commit
476be4b95c
|
|
@ -5391,34 +5391,11 @@ type TGridCellVariabletimagelistEdit = class(TGridCellVariableTactionEdit)
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
type TGridCellVariablehgtEdit = class(TGridCellVariableTactionEdit)
|
type TGridCellVariablehgtEdit = class(TGridCellVariabletimagelistEdit)
|
||||||
Function EditType();override;
|
Function EditType();override;
|
||||||
begin
|
begin
|
||||||
return "thighlighter";
|
return "thighlighter";
|
||||||
end
|
end
|
||||||
function CellDrawLabel(dc,rect,d);override;
|
|
||||||
begin
|
|
||||||
v := d["value"];
|
|
||||||
if v is class(tcomponent) then
|
|
||||||
begin
|
|
||||||
dc.DrawText(v.name,rect,DT_VCENTER.|DT_LEFT .|DT_SINGLELINE);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function FormatTMF(d);override;
|
|
||||||
begin
|
|
||||||
if d is class(tcomponent) then
|
|
||||||
begin
|
|
||||||
r := d.name;
|
|
||||||
if r then return r;
|
|
||||||
end
|
|
||||||
return false;
|
|
||||||
end
|
|
||||||
function GetItemValue(V);override;
|
|
||||||
begin
|
|
||||||
if v is class(TDComponent) then r := v.GetTrueComponent();
|
|
||||||
return r;
|
|
||||||
end
|
|
||||||
function create(owner);override;
|
function create(owner);override;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
|
|
|
||||||
|
|
@ -2518,7 +2518,7 @@ type tcoolbar = class(tcustomcoolbar)
|
||||||
end
|
end
|
||||||
function publishs();override;
|
function publishs();override;
|
||||||
begin
|
begin
|
||||||
return array("name","enabled","caption","autosize","border","wsdlgmodalframe","font","color","dragbtncolor","visible","arrange");
|
return array("name","enabled","caption","autosize","align","border","wsdlgmodalframe","font","color","dragbtncolor","visible","arrange");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
type tsplitter = class(tcustomsplitter)
|
type tsplitter = class(tcustomsplitter)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
function ControlDeleted(AControl);override;
|
function ControlDeleted(AControl);override;
|
||||||
begin
|
begin
|
||||||
fcoolbands.deleteitem(AControl);
|
fcoolbands.deleteitem(AControl,true);
|
||||||
end
|
end
|
||||||
function Notification(o,op);override;
|
function Notification(o,op);override;
|
||||||
begin
|
begin
|
||||||
|
|
@ -47,86 +47,80 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
function WMLBUTTONUP(o,e);override;//ÍÏקʵÏÖ
|
function WMLBUTTONUP(o,e);override;//ÍÏקʵÏÖ
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then exit;
|
if csDesigning in ComponentState then exit;
|
||||||
//if e.button=mbLeft then
|
if FIs_Draging then
|
||||||
//begin
|
begin
|
||||||
if FIs_Draging then
|
_wapi.ImageList_DragLeave(self.Handle);
|
||||||
|
_wapi.ImageList_EndDrag();
|
||||||
|
if fdragenode then
|
||||||
begin
|
begin
|
||||||
_wapi.ImageList_DragLeave(self.Handle);
|
r := fcoolbands.getnodebyxy(e.xpos,e.ypos);
|
||||||
_wapi.ImageList_EndDrag();
|
if fcoolbands.moveitemto(fdragenode,r[0],r[1]) then
|
||||||
if fdragenode then
|
|
||||||
begin
|
begin
|
||||||
r := fcoolbands.getnodebyxy(e.xpos,e.ypos);
|
doControlALign();
|
||||||
if fcoolbands.moveitemto(fdragenode,r[0],r[1]) then
|
InvalidateRect(nil,false);
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
if fsizenode then
|
||||||
|
begin
|
||||||
|
ctl := fsizenode.fctl;
|
||||||
|
clr := ctl.BoundsRect;
|
||||||
|
y := e.ypos;
|
||||||
|
if y> clr[1] and (y<clr[1]+clr[3]) then
|
||||||
|
begin
|
||||||
|
nwid := e.xpos-ctl.left;
|
||||||
|
if nwid>10 then
|
||||||
begin
|
begin
|
||||||
|
ctl.Width := nwid;
|
||||||
doControlALign();
|
doControlALign();
|
||||||
InvalidateRect(nil,false);
|
InvalidateRect(nil,false);
|
||||||
end
|
end
|
||||||
end else
|
|
||||||
if fsizenode then
|
|
||||||
begin
|
|
||||||
ctl := fsizenode.fctl;
|
|
||||||
clr := ctl.BoundsRect;
|
|
||||||
y := e.ypos;
|
|
||||||
if y> clr[1] and (y<clr[1]+clr[3]) then
|
|
||||||
begin
|
|
||||||
nwid := e.xpos-ctl.left;
|
|
||||||
if nwid>10 then
|
|
||||||
begin
|
|
||||||
ctl.Width := nwid;
|
|
||||||
doControlALign();
|
|
||||||
InvalidateRect(nil,false);
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
EnabledChild(true);
|
|
||||||
FWill_Drag := true;
|
|
||||||
FIs_Draging := false;
|
|
||||||
_wapi.clipcursor(0);
|
|
||||||
return ;
|
|
||||||
end
|
end
|
||||||
//end
|
EnabledChild(true);
|
||||||
|
FWill_Drag := true;
|
||||||
|
FIs_Draging := false;
|
||||||
|
_wapi.clipcursor(0);
|
||||||
|
return ;
|
||||||
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function WMLButtonDown(o,e);override;//ÍÏ×§ÊÍ·Å
|
function WMLButtonDown(o,e);override;//ÍÏ×§ÊÍ·Å
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then exit;
|
if csDesigning in ComponentState then exit;
|
||||||
//if e.button=mbLeft then
|
xy := e.pos;
|
||||||
//begin
|
trk := -1;
|
||||||
xy := e.pos;
|
for i,v in fcoolbands.data do
|
||||||
trk := -1;
|
begin
|
||||||
for i,v in fcoolbands.data do
|
if pointinrect(xy,v.fdragrect) then //ÍÏ×§
|
||||||
begin
|
begin
|
||||||
if pointinrect(xy,v.fdragrect) then //ÍÏ×§
|
trk := 0;
|
||||||
begin
|
fdragenode := v;
|
||||||
trk := 0;
|
fsizenode := nil;
|
||||||
fdragenode := v;
|
break;
|
||||||
fsizenode := nil;
|
end
|
||||||
break;
|
if pointinrect(xy,v.fsizerect) then //µ÷Õû´óС
|
||||||
end
|
begin
|
||||||
if pointinrect(xy,v.fsizerect) then //µ÷Õû´óС
|
trk := 1;
|
||||||
begin
|
fdragenode := nil;
|
||||||
trk := 1;
|
fsizenode := v;
|
||||||
fdragenode := nil;
|
break;
|
||||||
fsizenode := v;
|
end
|
||||||
break;
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
if trk<0 then return inherited;
|
if trk<0 then return inherited;
|
||||||
nxy := clienttowindow(e.xpos,e.ypos);
|
nxy := clienttowindow(e.xpos,e.ypos);
|
||||||
if FWill_Drag then
|
if FWill_Drag then
|
||||||
begin
|
begin
|
||||||
FWill_Drag := false;
|
FWill_Drag := false;
|
||||||
FIs_Draging := true;
|
FIs_Draging := true;
|
||||||
_wapi.ImageList_BeginDrag(FDRageimglist.Handle,trk,12,12);
|
_wapi.ImageList_BeginDrag(FDRageimglist.Handle,trk,12,12);
|
||||||
_wapi.ImageList_DragEnter(self.Handle,nxy[0],nxy[1]);
|
_wapi.ImageList_DragEnter(self.Handle,nxy[0],nxy[1]);
|
||||||
crect := clientrect;
|
crect := clientrect;
|
||||||
ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3]));
|
ps := array(clienttoscreen(crect[0],crect[1]),clienttoscreen(crect[2],crect[3]));
|
||||||
_wapi.clipcursor(ps);
|
_wapi.clipcursor(ps);
|
||||||
EnabledChild(false);
|
EnabledChild(false);
|
||||||
return ;
|
return ;
|
||||||
end
|
end
|
||||||
//end
|
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function WMMouseMove(o,e);override; //ÒÆ¶¯
|
function WMMouseMove(o,e);override; //ÒÆ¶¯
|
||||||
|
|
@ -171,7 +165,8 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
swid := 10;
|
swid := 10;
|
||||||
y := 0;
|
y := 0;
|
||||||
rhs := fcoolbands.getrowheights();
|
rhs := fcoolbands.getrowheights();
|
||||||
if autosize then
|
bal := Align;
|
||||||
|
if autosize and ( bal =alTop or bal=alBottom) then
|
||||||
begin
|
begin
|
||||||
rc := ClientRect;
|
rc := ClientRect;
|
||||||
nh := sum(rhs);
|
nh := sum(rhs);
|
||||||
|
|
@ -182,7 +177,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
begin
|
begin
|
||||||
Align := alNone;
|
Align := alNone;
|
||||||
Height := bw+nh;
|
Height := bw+nh;
|
||||||
Align := alTop;
|
Align := bal;
|
||||||
return ;
|
return ;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -454,13 +449,15 @@ type tcoolbarlines = class() //
|
||||||
line := new tnumindexarray();
|
line := new tnumindexarray();
|
||||||
flines.unshift(line);
|
flines.unshift(line);
|
||||||
end
|
end
|
||||||
function deleteitem(it,f); //ɾ³ýÒ»Ïî
|
function deleteitem(it,ifctl); //ɾ³ýÒ»Ïî
|
||||||
begin
|
begin
|
||||||
for i,v in flines.data do
|
for i,v in flines.data do
|
||||||
begin
|
begin
|
||||||
for j ,vj in v.data do
|
for j ,vj in v.data do
|
||||||
begin
|
begin
|
||||||
if vj = it then
|
if ifctl then vjctl := vj.fctl;
|
||||||
|
else vjctl := vj;
|
||||||
|
if vjctl = it then
|
||||||
begin
|
begin
|
||||||
v.splice(j,1);
|
v.splice(j,1);
|
||||||
if v.length()<1 then
|
if v.length()<1 then
|
||||||
|
|
|
||||||
|
|
@ -387,12 +387,16 @@ type tcustompagecontrol = class(TCustomControl)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
public
|
||||||
function getsheetrect(); //»ñµÃsheet
|
function getsheetrect(); //»ñµÃsheet
|
||||||
begin
|
begin
|
||||||
|
{**
|
||||||
|
@explan(说明) 获得sheet可视区域 %%
|
||||||
|
@return(array) array(左,上,右,下) %%
|
||||||
|
**}
|
||||||
if not FClientarea then CalcTabs();
|
if not FClientarea then CalcTabs();
|
||||||
return FClientarea;
|
return FClientarea;
|
||||||
end
|
end
|
||||||
public
|
|
||||||
function DesigningClick();override;
|
function DesigningClick();override;
|
||||||
begin
|
begin
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue