parent
26b74435fb
commit
fad69fa5e4
|
|
@ -2490,7 +2490,7 @@ type tcoolbar = class(tcustomcoolbar)
|
|||
end
|
||||
function publishs();override;
|
||||
begin
|
||||
return array("name","enabled","caption","autosize","font","color","dragbtncolor","sizebtncolor","visible","arrange");
|
||||
return array("name","enabled","caption","autosize","border","font","color","dragbtncolor","visible","arrange");
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -2503,7 +2503,6 @@ type TTreeCtlNode = class( TcustomTreeCtlNode)
|
|||
begin
|
||||
inherited;
|
||||
end
|
||||
|
||||
end
|
||||
type TTreeCtl = class(TcustomTreeCtl)
|
||||
{**
|
||||
|
|
|
|||
|
|
@ -17,8 +17,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
Align := alTop;
|
||||
FWill_Drag := true;
|
||||
cimgst();
|
||||
fsizebtncolor := _wapi.GetSysColor(COLOR_MENUBAR);
|
||||
fdragbtncolor := fsizebtncolor;
|
||||
fdragbtncolor := _wapi.GetSysColor(COLOR_MENUBAR);
|
||||
end
|
||||
function ControlAppended(AControl);override;
|
||||
begin
|
||||
|
|
@ -137,13 +136,35 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
begin
|
||||
nxy := clienttowindow(e.xpos,e.ypos);
|
||||
_wapi.ImageList_DragMove(nxy[0],nxy[1]);
|
||||
end else
|
||||
begin
|
||||
xy := e.pos();
|
||||
for i,v in fcoolbands.data do
|
||||
begin
|
||||
if pointinrect(xy,v.fdragrect) then //ÍÏ×§
|
||||
begin
|
||||
cursor := OCR_SIZEALL;
|
||||
flg := true;
|
||||
break;
|
||||
end
|
||||
if pointinrect(xy,v.fsizerect) then //ÍÏ×§
|
||||
begin
|
||||
cursor := OCR_SIZEWE;
|
||||
flg := true;
|
||||
break;
|
||||
end
|
||||
end
|
||||
if not flg then
|
||||
begin
|
||||
cursor := OCR_NORMAL;
|
||||
end
|
||||
end
|
||||
inherited;
|
||||
end
|
||||
function doControlALign();override;//µ÷ÕûλÖÃ
|
||||
begin
|
||||
mwid := 10;
|
||||
swid := 12;
|
||||
swid := 10;
|
||||
y := 0;
|
||||
rhs := fcoolbands.getrowheights();
|
||||
if autosize then
|
||||
|
|
@ -164,12 +185,16 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
for i,v in fcoolbands.data2 do
|
||||
begin
|
||||
x := 0;
|
||||
bss := array();
|
||||
for j,bsi in v do
|
||||
begin
|
||||
ctl := bsi.fctl;
|
||||
if ctl.Visible then
|
||||
begin
|
||||
bsi.fdragrect := array(x,y,x+mwid,y+rhs[i]);
|
||||
bss[length(bss)]:= bsi;
|
||||
drc := array(x,y,x+mwid,y+rhs[i]);
|
||||
bsi.fdragrect := drc;
|
||||
bsi.fbtnrect := drc;
|
||||
h := ctl.Height;
|
||||
w := ctl.Width;
|
||||
x += mwid;
|
||||
|
|
@ -182,18 +207,32 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
ctl.SetBounds(x,y+dy,w,h);
|
||||
x+=w;
|
||||
bsi.fsizerect := array(x,y,x+swid,y+rhs[i]);
|
||||
x+=swid;
|
||||
//x+=swid;
|
||||
end else
|
||||
begin
|
||||
bsi.fdragrect := array(0,0,0,0);
|
||||
bsi.fctlrect := array(0,0,0,0);
|
||||
bsi.fsizerect := array(0,0,0,0);
|
||||
bsi.fdragrect := array();//array(0,0,0,0);
|
||||
bsi.fctlrect := array();//array(0,0,0,0);
|
||||
bsi.fsizerect := array();//array(0,0,0,0);
|
||||
end
|
||||
end
|
||||
bsi.fsizerect := array();//array(0,0,0,0);
|
||||
y+=rhs[i];
|
||||
for i := 0 to length(bss)-2 do //ÖØÐÂÉèÖÃλÖÃ
|
||||
begin
|
||||
bs := bss[i];
|
||||
rc := bs.fsizerect;
|
||||
if rc then
|
||||
begin
|
||||
bs2 := bss[i+1];
|
||||
rc[1] := rc[1]+integer((rc[3]-rc[1])/2);
|
||||
bs.fsizerect := rc;
|
||||
rc := bs2.fdragrect;
|
||||
rc[3] := rc[3]-integer((rc[3]-rc[1])/2);
|
||||
bs2.fdragrect := rc;
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
bsi.fsizerect := array(0,0,0,0);
|
||||
y+=rhs[i];
|
||||
end
|
||||
end
|
||||
function paint();override; //»æÖÆ
|
||||
begin
|
||||
|
|
@ -211,13 +250,8 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
end
|
||||
for i,v in fcoolbands.data do
|
||||
begin
|
||||
//dc.brush.color := 0x87CEEB;
|
||||
dc.brush.color := fdragbtncolor;
|
||||
rc1 := v.fdragrect;
|
||||
paintbtn(v.fdragrect);
|
||||
//dc.brush.color := 0xEEE8AA;
|
||||
dc.brush.color := fsizebtncolor;
|
||||
paintbtn(v.fsizerect);
|
||||
paintbtn(v.fbtnrect);
|
||||
end
|
||||
dc.brush.color := cl;
|
||||
dc.pen.color := bcl;
|
||||
|
|
@ -230,11 +264,9 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
property autosize:bool read fautosize write setautosize;
|
||||
property arrange:lazystr read getarrange write setarrange;
|
||||
property dragbtncolor:color read fdragbtncolor write fdragbtncolor;
|
||||
property sizebtncolor:color read fsizebtncolor write fsizebtncolor;
|
||||
private
|
||||
fautosize ;
|
||||
fdragbtncolor;
|
||||
fsizebtncolor;
|
||||
fsizelocker;
|
||||
function paintbtn(rc1);
|
||||
begin
|
||||
|
|
@ -397,6 +429,7 @@ type tcoolband = class() //
|
|||
fdragrect;
|
||||
fsizerect;
|
||||
fctlrect;
|
||||
fbtnrect;
|
||||
private
|
||||
fenable;
|
||||
end
|
||||
|
|
@ -526,7 +559,7 @@ type tcoolbarlines = class() //
|
|||
if vj["visible"] then
|
||||
h := max(h,vj["height"]);
|
||||
end
|
||||
r[i] := max(20,h);
|
||||
r[i] := h;// max(20,h);
|
||||
end
|
||||
return r;
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue