界面库

优化coolbar
This commit is contained in:
JianjunLiu 2022-09-16 17:21:36 +08:00
parent 286af5904f
commit 476be4b95c
4 changed files with 75 additions and 97 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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,8 +47,6 @@ 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
//begin
if FIs_Draging then if FIs_Draging then
begin begin
_wapi.ImageList_DragLeave(self.Handle); _wapi.ImageList_DragLeave(self.Handle);
@ -84,14 +82,11 @@ type tcustomcoolbar=class(tcustomcontrol)
_wapi.clipcursor(0); _wapi.clipcursor(0);
return ; return ;
end end
//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
//begin
xy := e.pos; xy := e.pos;
trk := -1; trk := -1;
for i,v in fcoolbands.data do for i,v in fcoolbands.data do
@ -126,7 +121,6 @@ type tcustomcoolbar=class(tcustomcontrol)
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

View File

@ -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;