forked from liujianjun/tslediter
parent
5fb0e102d9
commit
6d926c1568
|
|
@ -2887,7 +2887,54 @@ type TDToolBar = class(TDComponent)
|
||||||
//r.Cwnd.align := r.Cwnd.alnone;
|
//r.Cwnd.align := r.Cwnd.alnone;
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
type TDcoolBar = class(TDComponent)
|
||||||
|
{**
|
||||||
|
@explan(说明) toolbar 设计器控件 %%
|
||||||
|
**}
|
||||||
|
public
|
||||||
|
function HitTip();override;
|
||||||
|
begin
|
||||||
|
return inherited;
|
||||||
|
end
|
||||||
|
function DefaultAlign();override;
|
||||||
|
begin
|
||||||
|
return true;
|
||||||
|
end
|
||||||
|
function dclassname();override;
|
||||||
|
begin
|
||||||
|
return "tcoolbar";
|
||||||
|
end
|
||||||
|
|
||||||
|
function menus();override;
|
||||||
|
begin
|
||||||
|
r := inherited;
|
||||||
|
return r;
|
||||||
|
end
|
||||||
|
function CheckChild(CD);override;
|
||||||
|
begin
|
||||||
|
return true;
|
||||||
|
//return cd is class(TDToolButton);
|
||||||
|
end
|
||||||
|
|
||||||
|
function bitmapinfo();override;
|
||||||
|
begin
|
||||||
|
return gettoolbarbitmapinfo();
|
||||||
|
end
|
||||||
|
function WndClass();override;
|
||||||
|
begin
|
||||||
|
return Class(TcoolBar);
|
||||||
|
end
|
||||||
|
function Create(AOwner);override;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
end
|
||||||
|
function ComponentCreater(tnode,owner);override;
|
||||||
|
begin
|
||||||
|
r := inherited;
|
||||||
|
//r.Cwnd.align := r.Cwnd.alnone;
|
||||||
|
return r;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
type TDStatusBar = class(TDComponent)
|
type TDStatusBar = class(TDComponent)
|
||||||
{**
|
{**
|
||||||
|
|
@ -5532,6 +5579,25 @@ type TGridCellLazyIntegerEdit = class(TGridCellIntegerEdit)
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
type TGridCellLazystrEdit = class(TGridCellStringEdit) //后处理信息
|
||||||
|
function CreateEditer(AOwner);override;
|
||||||
|
begin
|
||||||
|
return new TGridCellLazystrEdit(AOwner);
|
||||||
|
end
|
||||||
|
function EditType();override;
|
||||||
|
begin
|
||||||
|
return "lazystr";
|
||||||
|
end
|
||||||
|
function LazyProperty();override;
|
||||||
|
begin
|
||||||
|
return true;
|
||||||
|
end
|
||||||
|
function create(AOwner);override;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
//*****************Ñ¡Ôñlist*******************************************
|
//*****************Ñ¡Ôñlist*******************************************
|
||||||
type UniCheckList = class(TTreeView) //µ¥Ñ¡
|
type UniCheckList = class(TTreeView) //µ¥Ñ¡
|
||||||
private
|
private
|
||||||
|
|
@ -9319,7 +9385,7 @@ begin
|
||||||
class(TDMainMenu),class(TDPopUpMenu),class(TDMenu),
|
class(TDMainMenu),class(TDPopUpMenu),class(TDMenu),
|
||||||
class(TDOpenFileADlg),class(TDSaveFileADlg),class(TDInputQuerys),
|
class(TDOpenFileADlg),class(TDSaveFileADlg),class(TDInputQuerys),
|
||||||
class(TDColorChoose),class(TDFontChoose),class(TDFolderChoose),
|
class(TDColorChoose),class(TDFontChoose),class(TDFolderChoose),
|
||||||
class(TDToolBar),class(TDStatusBar),class(TDToolButton),
|
class(TDcoolBar),class(TDToolBar),class(TDStatusBar),class(TDToolButton),
|
||||||
class(TDTray),
|
class(TDTray),
|
||||||
class(TDActionList),class(TDAction),
|
class(TDActionList),class(TDAction),
|
||||||
class(TDQuotations),class(TDtlogincontrol),
|
class(TDQuotations),class(TDtlogincontrol),
|
||||||
|
|
@ -9355,6 +9421,7 @@ begin
|
||||||
class(TGridCellNaturalEdit),
|
class(TGridCellNaturalEdit),
|
||||||
class(TGridCellIntegerEdit),
|
class(TGridCellIntegerEdit),
|
||||||
class(TGridCellLazyIntegerEdit),
|
class(TGridCellLazyIntegerEdit),
|
||||||
|
class(TGridCellLazystrEdit),
|
||||||
class(TGridCellStringEdit),
|
class(TGridCellStringEdit),
|
||||||
class(TGridCellEventHandleEdit),
|
class(TGridCellEventHandleEdit),
|
||||||
class(TGridCellVariableEdit),
|
class(TGridCellVariableEdit),
|
||||||
|
|
|
||||||
|
|
@ -1391,7 +1391,7 @@ type tcontrol = class(tcomponent)
|
||||||
end
|
end
|
||||||
if rchange then
|
if rchange then
|
||||||
begin
|
begin
|
||||||
mtic;
|
//mtic;
|
||||||
obj := class(tUIglobalData).uigetdata("tuiapplication");
|
obj := class(tUIglobalData).uigetdata("tuiapplication");
|
||||||
if obj then
|
if obj then
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ unit tslvcl;
|
||||||
{$endif}
|
{$endif}
|
||||||
interface
|
interface
|
||||||
uses utslvclconstant,utslvclbase,utslvclauxiliary,cstructurelib,utslvclmemstruct,utslvclevent,
|
uses utslvclconstant,utslvclbase,utslvclauxiliary,cstructurelib,utslvclmemstruct,utslvclevent,
|
||||||
UVCPropertyTypesPersistence,utslvclgdi,utslvclaction,utslvclmenu,utslvclstdctl,utslvclpage,utslvcldlg,
|
UVCPropertyTypesPersistence,utslvclgdi,utslvclaction,utslvclmenu,utslvclstdctl,utslvclpage,
|
||||||
utslvclgrid,utslvcltree;
|
utslvcldlg,utslvclgrid,utslvcltree,utslvclcoolbar;
|
||||||
function initializeapplication(); //获得app对象
|
function initializeapplication(); //获得app对象
|
||||||
function RegisterComponentType(n,typ); //注册控件,便于通过控件名称构造控件
|
function RegisterComponentType(n,typ); //注册控件,便于通过控件名称构造控件
|
||||||
function GetAndDispatchMessageA(hwnd,minm,maxm); //win32 分发消息
|
function GetAndDispatchMessageA(hwnd,minm,maxm); //win32 分发消息
|
||||||
|
|
@ -2444,6 +2444,7 @@ type TToolButton = class(TcustomToolButton)
|
||||||
return array("name","action","caption","enabled","stylesep","imageid","visible","onclick","popupmenu");
|
return array("name","action","caption","enabled","stylesep","imageid","visible","onclick","popupmenu");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
type TToolBar = class( TcustomToolBar)
|
type TToolBar = class( TcustomToolBar)
|
||||||
{**
|
{**
|
||||||
@explan(说明) 工具栏控件 %%
|
@explan(说明) 工具栏控件 %%
|
||||||
|
|
@ -2479,6 +2480,19 @@ type TStatusBar = class(TcustomStatusBar)
|
||||||
"font","visible","items","ondblclick","onmousedown","onmouseup");
|
"font","visible","items","ondblclick","onmousedown","onmouseup");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
type tcoolbar = class(tcustomcoolbar)
|
||||||
|
{**
|
||||||
|
@explan(˵Ã÷) coolbar¿Ø¼þ %%
|
||||||
|
**}
|
||||||
|
function create(AOwner);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
end
|
||||||
|
function publishs();override;
|
||||||
|
begin
|
||||||
|
return array("name","enabled","caption","autosize","font","color","dragbtncolor","sizebtncolor","visible","arrange");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
//树控件
|
//树控件
|
||||||
type TTreeCtlNode = class( TcustomTreeCtlNode)
|
type TTreeCtlNode = class( TcustomTreeCtlNode)
|
||||||
|
|
|
||||||
|
|
@ -1,55 +1,51 @@
|
||||||
unit utslvclcoolbar;
|
unit utslvclcoolbar;
|
||||||
|
{**
|
||||||
|
@explan(说明) coolbar库,提供coolbar 支持
|
||||||
|
**}
|
||||||
interface
|
interface
|
||||||
uses utslvclauxiliary,utslvclgdi;
|
uses utslvclauxiliary,utslvclgdi;
|
||||||
type tcustomcoolbar=class(tcustomcontrol)
|
type tcustomcoolbar=class(tcustomcontrol)
|
||||||
|
{**
|
||||||
|
@explan(说明) coolbar基类
|
||||||
|
**}
|
||||||
function Create(AOwner);
|
function Create(AOwner);
|
||||||
begin
|
begin
|
||||||
fcoolbands := new tcoolbarlines();
|
fcoolbands := new tcoolbarlines();
|
||||||
frowheight := 30;
|
|
||||||
fbtnwidth := 20;
|
fbtnwidth := 20;
|
||||||
fautosize := true;
|
fautosize := true;
|
||||||
inherited;
|
inherited;
|
||||||
|
Align := alTop;
|
||||||
FWill_Drag := true;
|
FWill_Drag := true;
|
||||||
cimgst();
|
cimgst();
|
||||||
fsizebtncolor := _wapi.GetSysColor(COLOR_MENUBAR);
|
fsizebtncolor := _wapi.GetSysColor(COLOR_MENUBAR);
|
||||||
fdragbtncolor := fsizebtncolor;
|
fdragbtncolor := fsizebtncolor;
|
||||||
|
|
||||||
end
|
end
|
||||||
function ControlAppended(AControl);override;
|
function ControlAppended(AControl);override;
|
||||||
begin
|
begin
|
||||||
{**
|
|
||||||
@explan(说明) 子控件添加 %%
|
|
||||||
**}
|
|
||||||
it := new tcoolband(AControl);
|
it := new tcoolband(AControl);
|
||||||
fcoolbands.appendrow(it);
|
fcoolbands.appendrow(it);
|
||||||
end
|
end
|
||||||
function ControlDeleted(AControl);override;
|
function ControlDeleted(AControl);override;
|
||||||
begin
|
begin
|
||||||
{**
|
|
||||||
@explan(说明) 子控件删除 %%
|
|
||||||
**}
|
|
||||||
fcoolbands.deleteitem(AControl);
|
fcoolbands.deleteitem(AControl);
|
||||||
end
|
end
|
||||||
function Notification(o,op);override;
|
function Notification(o,op);override;
|
||||||
begin
|
begin
|
||||||
return inherited;
|
r := inherited;
|
||||||
if ifarray(op) then
|
if class(tflag).haslocker then return r;
|
||||||
|
if HandleAllocated() and ifarray(op) and (op["type"]="possize") then //位置大小发送变化
|
||||||
begin
|
begin
|
||||||
ctls := controls;
|
ctls := controls;
|
||||||
if (ctls.IndexOf(o)>=0) then
|
if (ctls.IndexOf(o)>=0) then //子控件大小变化
|
||||||
begin
|
begin
|
||||||
//echo tostn(op);
|
doControlALign();
|
||||||
flg := op["flag"];
|
InvalidateRect(nil,false);
|
||||||
if flag>0 and ((flag .& 4 ) or (flg .& 8)) then
|
return r;
|
||||||
begin
|
|
||||||
echo "\r\n",tostn(op);
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return r;
|
||||||
end
|
end
|
||||||
inherited;
|
function MouseUp(o,e);override;//拖拽实现
|
||||||
end
|
|
||||||
|
|
||||||
function MouseUp(o,e);override;
|
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then exit;
|
if csDesigning in ComponentState then exit;
|
||||||
if e.button=mbLeft then
|
if e.button=mbLeft then
|
||||||
|
|
@ -66,7 +62,6 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
doControlALign();
|
doControlALign();
|
||||||
InvalidateRect(nil,false);
|
InvalidateRect(nil,false);
|
||||||
r := getarrange();
|
r := getarrange();
|
||||||
echo tostn(r);
|
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
if fsizenode then
|
if fsizenode then
|
||||||
|
|
@ -95,7 +90,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function MouseDown(o,e);override;
|
function MouseDown(o,e);override;//拖拽释放
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then exit;
|
if csDesigning in ComponentState then exit;
|
||||||
if e.button=mbLeft then
|
if e.button=mbLeft then
|
||||||
|
|
@ -104,15 +99,14 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
trk := -1;
|
trk := -1;
|
||||||
for i,v in fcoolbands.data do
|
for i,v in fcoolbands.data do
|
||||||
begin
|
begin
|
||||||
|
if pointinrect(xy,v.fdragrect) then //拖拽
|
||||||
if pointinrect(xy,v.fdragrect) then
|
|
||||||
begin
|
begin
|
||||||
trk := 0;
|
trk := 0;
|
||||||
fdragenode := v;
|
fdragenode := v;
|
||||||
fsizenode := nil;
|
fsizenode := nil;
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
if pointinrect(xy,v.fsizerect) then
|
if pointinrect(xy,v.fsizerect) then //调整大小
|
||||||
begin
|
begin
|
||||||
trk := 1;
|
trk := 1;
|
||||||
fdragenode := nil;
|
fdragenode := nil;
|
||||||
|
|
@ -127,9 +121,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
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]));
|
||||||
|
|
@ -139,7 +131,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function MouseMove(o,e);override;
|
function MouseMove(o,e);override; //移动
|
||||||
begin
|
begin
|
||||||
if FIs_Draging then
|
if FIs_Draging then
|
||||||
begin
|
begin
|
||||||
|
|
@ -148,7 +140,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
inherited;
|
inherited;
|
||||||
end
|
end
|
||||||
function doControlALign();override;
|
function doControlALign();override;//调整位置
|
||||||
begin
|
begin
|
||||||
mwid := 10;
|
mwid := 10;
|
||||||
swid := 12;
|
swid := 12;
|
||||||
|
|
@ -168,6 +160,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
return ;
|
return ;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
lk := new tflag();
|
||||||
for i,v in fcoolbands.data2 do
|
for i,v in fcoolbands.data2 do
|
||||||
begin
|
begin
|
||||||
x := 0;
|
x := 0;
|
||||||
|
|
@ -202,7 +195,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
y+=rhs[i];
|
y+=rhs[i];
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function paint();override;
|
function paint();override; //绘制
|
||||||
begin
|
begin
|
||||||
dc := canvas;
|
dc := canvas;
|
||||||
cl := dc.brush.color;
|
cl := dc.brush.color;
|
||||||
|
|
@ -221,33 +214,10 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
//dc.brush.color := 0x87CEEB;
|
//dc.brush.color := 0x87CEEB;
|
||||||
dc.brush.color := fdragbtncolor;
|
dc.brush.color := fdragbtncolor;
|
||||||
rc1 := v.fdragrect;
|
rc1 := v.fdragrect;
|
||||||
rc1[0]+=1;
|
paintbtn(v.fdragrect);
|
||||||
rc1[1]+=1;
|
|
||||||
rc1[2]-=1;
|
|
||||||
rc1[3]-=1;
|
|
||||||
dc.fillrect(rc1);
|
|
||||||
ply := array( rc1[array(0,1)],
|
|
||||||
rc1[array(2,1)],
|
|
||||||
rc1[array(2,3)],
|
|
||||||
rc1[array(0,3)],
|
|
||||||
rc1[array(0,1)]
|
|
||||||
);
|
|
||||||
dc.draw("polyline",ply) ;
|
|
||||||
//dc.brush.color := 0xEEE8AA;
|
//dc.brush.color := 0xEEE8AA;
|
||||||
dc.brush.color := fsizebtncolor;
|
dc.brush.color := fsizebtncolor;
|
||||||
rc1 := v.fsizerect;
|
paintbtn(v.fsizerect);
|
||||||
rc1[0]+=1;
|
|
||||||
rc1[1]+=1;
|
|
||||||
rc1[2]-=1;
|
|
||||||
rc1[3]-=1;
|
|
||||||
dc.fillrect(rc1);
|
|
||||||
ply := array( rc1[array(0,1)],
|
|
||||||
rc1[array(2,1)],
|
|
||||||
rc1[array(2,3)],
|
|
||||||
rc1[array(0,3)],
|
|
||||||
rc1[array(0,1)]
|
|
||||||
);
|
|
||||||
dc.draw("polyline",ply) ;
|
|
||||||
end
|
end
|
||||||
dc.brush.color := cl;
|
dc.brush.color := cl;
|
||||||
dc.pen.color := bcl;
|
dc.pen.color := bcl;
|
||||||
|
|
@ -255,16 +225,33 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
function Recycling();override;
|
function Recycling();override;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
//if FDRageimglist then _wapi.ImageList_Destroy(FDRageimglist);
|
FDRageimglist := nil;
|
||||||
end
|
end
|
||||||
property autosize read fautosize write setautosize;
|
property autosize:bool read fautosize write setautosize;
|
||||||
property arrange read getarrange write setarrange;
|
property arrange:lazystr read getarrange write setarrange;
|
||||||
property dragbtncolor:color read fdragbtncolor write fdragbtncolor;
|
property dragbtncolor:color read fdragbtncolor write fdragbtncolor;
|
||||||
property sizebtncolor:color read fsizebtncolor write fsizebtncolor;
|
property sizebtncolor:color read fsizebtncolor write fsizebtncolor;
|
||||||
private
|
private
|
||||||
fautosize ;
|
fautosize ;
|
||||||
fdragbtncolor;
|
fdragbtncolor;
|
||||||
fsizebtncolor;
|
fsizebtncolor;
|
||||||
|
fsizelocker;
|
||||||
|
function paintbtn(rc1);
|
||||||
|
begin
|
||||||
|
dc := canvas;
|
||||||
|
rc1[0]+=1;
|
||||||
|
rc1[1]+=1;
|
||||||
|
rc1[2]-=1;
|
||||||
|
rc1[3]-=1;
|
||||||
|
dc.fillrect(rc1);
|
||||||
|
ply := array( rc1[array(0,1)],
|
||||||
|
rc1[array(2,1)],
|
||||||
|
rc1[array(2,3)],
|
||||||
|
rc1[array(0,3)],
|
||||||
|
rc1[array(0,1)]
|
||||||
|
);
|
||||||
|
dc.draw("polyline",ply) ;
|
||||||
|
end
|
||||||
function arange2a(s);
|
function arange2a(s);
|
||||||
begin
|
begin
|
||||||
ss := str2array(s,";");
|
ss := str2array(s,";");
|
||||||
|
|
@ -278,11 +265,12 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
function getarrange();
|
function getarrange(b);
|
||||||
begin
|
begin
|
||||||
|
if not(b) then b := fcoolbands;
|
||||||
ar := "";
|
ar := "";
|
||||||
ctls := controls;
|
ctls := controls;
|
||||||
for i,vi in fcoolbands.data2 do
|
for i,vi in b.data2 do
|
||||||
begin
|
begin
|
||||||
for j,v in vi do
|
for j,v in vi do
|
||||||
begin
|
begin
|
||||||
|
|
@ -300,7 +288,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
ct := ctls.count-1;
|
ct := ctls.count-1;
|
||||||
if ct<0 then return ;
|
if ct<0 then return ;
|
||||||
idxs := 0->(ct);
|
idxs := 0->(ct);
|
||||||
fcoolbands_ := new tnumindexarray();
|
ncoollines := new tnumindexarray();
|
||||||
for i,v in str2array(ar,";") do
|
for i,v in str2array(ar,";") do
|
||||||
begin
|
begin
|
||||||
if v then
|
if v then
|
||||||
|
|
@ -321,23 +309,26 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
end
|
end
|
||||||
if line.length() then
|
if line.length() then
|
||||||
begin
|
begin
|
||||||
fcoolbands_.Push(line);
|
ncoollines.Push(line);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for i,v in idxs do
|
for i,v in idxs do
|
||||||
begin
|
begin
|
||||||
line := new tnumindexarray();
|
line := new tnumindexarray();
|
||||||
line.Push(new tcoolband(ctls[vidx]));
|
line.Push(new tcoolband(ctls[v]));
|
||||||
fcoolbands_.Push(line);
|
ncoollines.Push(line);
|
||||||
end
|
end
|
||||||
fcoolbands := fcoolbands_;
|
nb := new tcoolbarlines();
|
||||||
|
nb.lines := ncoollines;
|
||||||
|
if getarrange()=getarrange(nb) then return ; //相同
|
||||||
|
fcoolbands := nb;
|
||||||
if HandleAllocated() then
|
if HandleAllocated() then
|
||||||
begin
|
begin
|
||||||
doControlALign();
|
doControlALign();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function setautosize(v);
|
function setautosize(v);//自动调整
|
||||||
begin
|
begin
|
||||||
nv := v?true:false;
|
nv := v?true:false;
|
||||||
if nv<>fautosize then
|
if nv<>fautosize then
|
||||||
|
|
@ -363,22 +354,17 @@ type tcustomcoolbar=class(tcustomcontrol)
|
||||||
FDRageimglist.addbmp(bmp);
|
FDRageimglist.addbmp(bmp);
|
||||||
bmp.readvcon(HexFormatStrToTsl(getsizebmp()));
|
bmp.readvcon(HexFormatStrToTsl(getsizebmp()));
|
||||||
FDRageimglist.addbmp(bmp);
|
FDRageimglist.addbmp(bmp);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
fdragenode; //拖拽的节点
|
||||||
fdragenode;
|
fsizenode; //调整大小节点
|
||||||
fsizenode;
|
fcoolbands; //节点管理器
|
||||||
|
|
||||||
fcoolbands;
|
|
||||||
frowheight;
|
|
||||||
fbtnwidth;
|
fbtnwidth;
|
||||||
FIs_Draging;//
|
FIs_Draging;//
|
||||||
FWill_Drag;//
|
FWill_Drag;//
|
||||||
FDRageimglist;//
|
FDRageimglist;//
|
||||||
|
|
||||||
end
|
end
|
||||||
implementation
|
implementation
|
||||||
type tcoolband = class
|
type tcoolband = class() //管理节点
|
||||||
function create(ctl);
|
function create(ctl);
|
||||||
begin
|
begin
|
||||||
fctl := ctl;
|
fctl := ctl;
|
||||||
|
|
@ -414,7 +400,7 @@ type tcoolband = class
|
||||||
private
|
private
|
||||||
fenable;
|
fenable;
|
||||||
end
|
end
|
||||||
type tcoolbarlines = class
|
type tcoolbarlines = class() //节点管理器
|
||||||
function create();
|
function create();
|
||||||
begin
|
begin
|
||||||
flines := new tnumindexarray();
|
flines := new tnumindexarray();
|
||||||
|
|
@ -442,56 +428,56 @@ type tcoolbarlines = class
|
||||||
if v.length()<1 then
|
if v.length()<1 then
|
||||||
begin
|
begin
|
||||||
flines.splice(i,1);//删除
|
flines.splice(i,1);//删除
|
||||||
|
return 2;
|
||||||
|
end
|
||||||
|
return 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
return 0;
|
||||||
end
|
end
|
||||||
function moveitemto(it,nit,f);//移动到坐标
|
function moveitemto(it,nit,f);//移动到坐标
|
||||||
begin
|
begin
|
||||||
if it=nit then return 0;
|
if it=nit then return 0;
|
||||||
{id1 := -1;
|
bkr := 0;
|
||||||
id2 := -1;
|
for i,v in data2 do //查找行列位置
|
||||||
for i ,v in data do
|
|
||||||
begin
|
begin
|
||||||
if v= it then
|
for j,vj in v do
|
||||||
begin
|
begin
|
||||||
id1 := i;
|
if vj=it then
|
||||||
if id2>-1 then break;
|
begin
|
||||||
|
id1 := array(i,j);
|
||||||
|
end else
|
||||||
|
if nit = vj then
|
||||||
|
begin
|
||||||
|
id2 := array(i,j);
|
||||||
end
|
end
|
||||||
if v=nit then
|
if id1 and id2 then
|
||||||
begin
|
begin
|
||||||
id2 := i;
|
bkr := 1;
|
||||||
if id1>-1 then break;
|
break;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
//it 为移动的
|
if bkr then break;
|
||||||
//nid 为锚点
|
end
|
||||||
case f of
|
if not(bkr) then return 0;
|
||||||
0,1: //前
|
if id1[0]=id2[0] then //同一行
|
||||||
begin
|
begin
|
||||||
if (id2-id1)=1 then return 0;
|
if ((id1[1]-id2[1])=1) and f=3 then //在后面情况
|
||||||
|
begin
|
||||||
|
return 0;
|
||||||
|
end
|
||||||
|
if ((id1[1]-id2[1])=-1) and (f=0 or f=1) then //在前面情况
|
||||||
|
begin
|
||||||
|
return 0;
|
||||||
end
|
end
|
||||||
|
|
||||||
2: //前一行
|
|
||||||
begin
|
|
||||||
|
|
||||||
end
|
end
|
||||||
3: //后
|
|
||||||
begin
|
|
||||||
if (id1-id2)=1 then return 0;
|
|
||||||
end
|
|
||||||
4: //后一行
|
|
||||||
begin
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
end }
|
|
||||||
deleteitem(it);//删掉
|
deleteitem(it);//删掉
|
||||||
case f of
|
case f of
|
||||||
0,1: //前
|
0,1,3: //前
|
||||||
begin
|
begin
|
||||||
ifg := 0;
|
ifg := f=3;
|
||||||
end
|
end
|
||||||
2: //前一行
|
2: //前一行
|
||||||
begin
|
begin
|
||||||
|
|
@ -500,10 +486,6 @@ type tcoolbarlines = class
|
||||||
flines.unshift(line);
|
flines.unshift(line);
|
||||||
return 1;
|
return 1;
|
||||||
end
|
end
|
||||||
3: //后
|
|
||||||
begin
|
|
||||||
ifg :=2;
|
|
||||||
end
|
|
||||||
4: //后一行
|
4: //后一行
|
||||||
begin
|
begin
|
||||||
line := new tnumindexarray();
|
line := new tnumindexarray();
|
||||||
|
|
@ -522,9 +504,11 @@ type tcoolbarlines = class
|
||||||
if ifg then //后面
|
if ifg then //后面
|
||||||
begin
|
begin
|
||||||
v.splice(j+1,0,it);
|
v.splice(j+1,0,it);
|
||||||
|
return 1;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
v.splice(j,0,it);
|
v.splice(j,0,it);
|
||||||
|
return 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -533,19 +517,20 @@ type tcoolbarlines = class
|
||||||
end
|
end
|
||||||
function getrowheights(); //总高度
|
function getrowheights(); //总高度
|
||||||
begin
|
begin
|
||||||
r := array(25);
|
r := array(25); //默认高度
|
||||||
for i,v in flines.data do
|
for i,v in getdata2() do
|
||||||
begin
|
begin
|
||||||
h := 0;
|
h := 0;
|
||||||
for j,vj in v.data do
|
for j,vj in v do
|
||||||
begin
|
begin
|
||||||
|
if vj["visible"] then
|
||||||
h := max(h,vj["height"]);
|
h := max(h,vj["height"]);
|
||||||
end
|
end
|
||||||
r[i] := h;
|
r[i] := max(20,h);
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function EnabledChild(f);
|
function EnabledChild(f); //enable
|
||||||
begin
|
begin
|
||||||
for i,v in flines.data do
|
for i,v in flines.data do
|
||||||
begin
|
begin
|
||||||
|
|
@ -555,7 +540,7 @@ type tcoolbarlines = class
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function getnodebyxy(x,y);
|
function getnodebyxy(x,y); //通过位置获得节点的信息,拖拽处理使用
|
||||||
begin
|
begin
|
||||||
rs := getrowheights();
|
rs := getrowheights();
|
||||||
b := 0;
|
b := 0;
|
||||||
|
|
@ -566,46 +551,45 @@ type tcoolbarlines = class
|
||||||
if v<1 then continue;
|
if v<1 then continue;
|
||||||
if y>=b and y<=b+v then //确定行
|
if y>=b and y<=b+v then //确定行
|
||||||
begin
|
begin
|
||||||
for j,bsi in flines[i].data do
|
for j,bsi in flines[i].data do //在行中循环
|
||||||
begin
|
begin
|
||||||
|
|
||||||
rc := bsi.fctlrect;
|
rc := bsi.fctlrect;
|
||||||
rt := -1;
|
rt := -1;
|
||||||
if (x>=(rc[0])) and ( x<=(rc[0]+rc[2])) and
|
if (x>=(rc[0])) and ( x<=(rc[0]+rc[2])) and
|
||||||
(y>=(rc[1]+bdr)) and ( y<=(rc[1]+rc[3]-bdr)) then
|
(y>=(rc[1]+bdr)) and ( y<=(rc[1]+rc[3]-bdr)) then //中间位置
|
||||||
begin
|
begin
|
||||||
rt := 0;
|
rt := 0;
|
||||||
end
|
end
|
||||||
if x<(rc[0]+bdr) then
|
if x<(rc[0]+bdr) then //左边
|
||||||
begin
|
begin
|
||||||
rt := 1;
|
rt := 1;
|
||||||
end
|
end
|
||||||
if i=0 then
|
if i=0 then
|
||||||
begin
|
begin
|
||||||
if y<(rc[1]+bdr) then
|
if y<(rc[1]+bdr) then //上边
|
||||||
begin
|
begin
|
||||||
rt := 2;
|
rt := 2;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if i=rl then
|
if i=rl then
|
||||||
begin
|
begin
|
||||||
if y>(rc[1]+rc[3]-bdr) then
|
if y>(rc[1]+rc[3]-bdr) then //下边
|
||||||
begin
|
begin
|
||||||
rt := 4;
|
rt := 4;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if rt>-1 then return array(bsi,rt,i,j);
|
if rt>-1 then return array(bsi,rt,i,j); //后边
|
||||||
end
|
end
|
||||||
return array(bsi,3,i,j);
|
return array(bsi,3,i,j);
|
||||||
end
|
end
|
||||||
b+=v;
|
b+=v;
|
||||||
end
|
end
|
||||||
ri := length(rs)-1;
|
ri := length(rs)-1;
|
||||||
return array((flines[ri])[0],4,ri,0);
|
return array((flines[ri])[0],4,ri,0); //字后面
|
||||||
end
|
end
|
||||||
property data2 read getdata2;
|
property data2 read getdata2;
|
||||||
property data read getdata;
|
property data read getdata;
|
||||||
property lines read flines;
|
property lines read flines write flines;
|
||||||
private
|
private
|
||||||
function getdata();
|
function getdata();
|
||||||
begin
|
begin
|
||||||
|
|
@ -635,9 +619,19 @@ type tcoolbarlines = class
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
flines;
|
flines;
|
||||||
|
|
||||||
end
|
end
|
||||||
function getmovebmp();
|
type tflag = class() //锁定对象
|
||||||
|
static haslocker;
|
||||||
|
function create();
|
||||||
|
begin
|
||||||
|
haslocker++;
|
||||||
|
end
|
||||||
|
function destroy();
|
||||||
|
begin
|
||||||
|
haslocker--;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function getmovebmp(); //移动图片
|
||||||
begin
|
begin
|
||||||
return "0502000000060400000074797065000203000000696D670006040000006461746
|
return "0502000000060400000074797065000203000000696D670006040000006461746
|
||||||
10002E801000089504E470D0A1A0A0000000D4948445200000018000000180806
|
10002E801000089504E470D0A1A0A0000000D4948445200000018000000180806
|
||||||
|
|
@ -658,7 +652,7 @@ E8A93404DEE2BB10AB6CFBB4672112E12AB6061F785932DEEC585C478A2CF8655
|
||||||
454E44AE42608200";
|
454E44AE42608200";
|
||||||
|
|
||||||
end
|
end
|
||||||
function getsizebmp();
|
function getsizebmp(); //调整大小图片
|
||||||
begin
|
begin
|
||||||
return "0502000000060400000074797065000203000000696D670006040000006461746
|
return "0502000000060400000074797065000203000000696D670006040000006461746
|
||||||
100020E01000089504E470D0A1A0A0000000D4948445200000018000000180806
|
100020E01000089504E470D0A1A0A0000000D4948445200000018000000180806
|
||||||
|
|
|
||||||
|
|
@ -4369,10 +4369,10 @@ type TcustomToolBar=class(TCustomControl)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function ContextMenu(o,e);override;
|
{function ContextMenu(o,e);override;
|
||||||
begin
|
begin
|
||||||
e.skip := true;
|
e.skip := true;
|
||||||
end
|
end }
|
||||||
function MouseUp(o,e);override;
|
function MouseUp(o,e);override;
|
||||||
begin
|
begin
|
||||||
if csDesigning in ComponentState then return;
|
if csDesigning in ComponentState then return;
|
||||||
|
|
|
||||||
|
|
@ -1427,6 +1427,17 @@ type TPropertyLazyInteger=class(TPropertyInteger)
|
||||||
return true;
|
return true;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
type TPropertyLazystr=class(TPropertyString)
|
||||||
|
function EditType();override;
|
||||||
|
begin
|
||||||
|
return "lazystr";
|
||||||
|
end
|
||||||
|
function LazyProperty();override;
|
||||||
|
begin
|
||||||
|
return true;
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
type UniSelProperty=class(TPropertyType)
|
type UniSelProperty=class(TPropertyType)
|
||||||
function Create();
|
function Create();
|
||||||
begin
|
begin
|
||||||
|
|
@ -2038,6 +2049,7 @@ begin
|
||||||
"tpropertystatusitems",
|
"tpropertystatusitems",
|
||||||
"tpropertyfilefilter",
|
"tpropertyfilefilter",
|
||||||
"tpropertylazyinteger",
|
"tpropertylazyinteger",
|
||||||
|
"TPropertyLazystr",
|
||||||
"uniselproperty",
|
"uniselproperty",
|
||||||
"uniobjectmember",
|
"uniobjectmember",
|
||||||
"tpropertyalign9",
|
"tpropertyalign9",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue