64 lines
1.7 KiB
Plaintext
64 lines
1.7 KiB
Plaintext
type tcustomsplitter = class(tgraphiccontrol)
|
|
{**
|
|
@explan(说明)调整分割控件
|
|
**}
|
|
function create(AOwner);
|
|
begin
|
|
inherited;
|
|
Caption := "";
|
|
color := 0xf0f0f0;//0xEED2BC;
|
|
Width := 6;
|
|
Height := 100;
|
|
end
|
|
function paint();override;
|
|
begin
|
|
//inherited;
|
|
p := parent;
|
|
if not p then return ;
|
|
r := ClientRect;
|
|
dc := Canvas;
|
|
if Border then
|
|
begin
|
|
dc.pen.color := 0;
|
|
dc.pen.Width := 2;
|
|
dc.draw("polyline",array(r[0:1],r[array(2,1)],r[array(2,3)],r[array(0,3)],r[0:1]));
|
|
end
|
|
////////////点的颜色/////////////////////////
|
|
if TRANSPARENT then c := p.color;
|
|
else
|
|
c := color;
|
|
////////////////////////////
|
|
clr := sys_complementar_color(c);
|
|
x := integer(r[0]+(r[2]-r[0])/2);
|
|
y := integer(r[1]+(r[3]-r[1])/2);
|
|
sz := 4;
|
|
sp := 5;
|
|
for j :=(0 -sz) to sz do
|
|
begin
|
|
for i:=(0 -sz) to sz do
|
|
begin
|
|
x1 := x+sp*i;
|
|
y1 := y+sp*j;
|
|
if x1>r[0] and x1<r[2] and y1>r[1] and y1<r[3] then
|
|
begin
|
|
dc.SetPixel(array(x1,y1),clr);
|
|
end
|
|
end
|
|
end
|
|
end
|
|
private
|
|
function sys_complementar_color(c);
|
|
begin
|
|
uses utslvclauxiliary;
|
|
if (c .& 0xff000000) then
|
|
begin
|
|
return complementary_color( _wapi.GetSysColor(c .& 0x00ffffff));
|
|
end
|
|
return complementary_color(c);
|
|
end
|
|
{function SetAlign(a);override;
|
|
begin
|
|
inherited;
|
|
end }
|
|
end
|