* initial import of spktoolbar
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1690 8e941d3f-bd1b-0410-a28a-d453659cc2b4
2380
components/spktoolbar/SpkGUITools/SpkGUITools.pas
Normal file
555
components/spktoolbar/SpkGraphTools/SpkGraphTools.pas
Normal file
@ -0,0 +1,555 @@
|
||||
unit SpkGraphTools;
|
||||
|
||||
{$DEFINE SPKGRAPHTOOLS}
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Graphics, Classes, Math, Sysutils, Dialogs,
|
||||
SpkMath;
|
||||
|
||||
const NUM_ZERO = 0.00000001;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Proste struktury *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
type // Wska�nik do tablicy TRGBTriple
|
||||
PRGBTripleArray = ^TRGBTripleArray;
|
||||
// Tablica TRGBTriple (u�ywana podczas operacji ze ScanLine)
|
||||
TRGBTripleArray = array[word] of TRGBTriple;
|
||||
|
||||
type THSLTriple = record
|
||||
H, S, L : extended;
|
||||
end;
|
||||
|
||||
type // Typ u�ywany podczas rysowania gradient�w
|
||||
TRIVERTEX = packed record
|
||||
x,y : DWORD;
|
||||
Red,
|
||||
Green,
|
||||
Blue,
|
||||
Alpha : Word;
|
||||
end;
|
||||
|
||||
type // Rodzaj gradientu
|
||||
TGradientType = (gtVertical, gtHorizontal);
|
||||
// Rodzaj linii gradientowej (miejsce rozmycia)
|
||||
TGradientLineShade = (lsShadeStart, lsShadeEnds, lsShadeCenter, lsShadeEnd);
|
||||
// Rodzaj linii gradientowej (wypuk�o��)
|
||||
TGradient3dLine = (glRaised, glLowered);
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Nag��wki dla zewn�trznych funkcji *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
function GradientFill(DC : hDC; pVertex : Pointer; dwNumVertex : DWORD; pMesh : Pointer; dwNumMesh, dwMode: DWORD) : DWord; stdcall; external 'msimg32.dll';
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Klasy narz�dziowe *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
type TColorTools = class(TObject)
|
||||
private
|
||||
protected
|
||||
public
|
||||
class function Darken(kolor : TColor; percentage : byte) : TColor;
|
||||
class function Brighten(kolor : TColor; percentage : byte) : TColor;
|
||||
class function Shade(kol1,kol2 : TColor; percentage : byte) : TColor; overload;
|
||||
class function Shade(kol1,kol2 : TColor; Step : extended) : TColor; overload;
|
||||
class function AddColors(c1, c2 : TColor) : TColor;
|
||||
class function MultiplyColors(c1, c2 : TColor) : TColor;
|
||||
class function MultiplyColor(color : TColor; scalar : integer) : TColor; overload;
|
||||
class function MultiplyColor(color : TColor; scalar : extended) : TColor; overload;
|
||||
class function percent(min, pos, max : integer) : byte;
|
||||
class function RGB2HSL(ARGB : TRGBTriple) : THSLTriple;
|
||||
class function HSL2RGB(AHSL : THSLTriple) : TRGBTriple;
|
||||
class function RgbTripleToColor(ARgbTriple : TRGBTriple) : TColor;
|
||||
class function ColorToRgbTriple(AColor : TColor) : TRGBTriple;
|
||||
class function ColorToGrayscale(AColor : TColor) : TColor;
|
||||
end;
|
||||
|
||||
type TGradientTools = class(TObject)
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure HGradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect); overload;
|
||||
class procedure HGradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint); overload;
|
||||
class procedure HGradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer); overload;
|
||||
|
||||
class procedure VGradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect); overload;
|
||||
class procedure VGradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint); overload;
|
||||
class procedure VGradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer); overload;
|
||||
|
||||
class procedure Gradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect; GradientType : TGradientType); overload;
|
||||
class procedure Gradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint; GradientType : TGradientType); overload;
|
||||
class procedure Gradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer; GradientType : TGradientType); overload;
|
||||
|
||||
class procedure HGradientLine(canvas : TCanvas; cBase, cShade : TColor; x1, x2 , y : integer; ShadeMode : TGradientLineShade);
|
||||
class procedure VGradientLine(canvas : TCanvas; cBase, cShade : TColor; x, y1 , y2 : integer; ShadeMode : TGradientLineShade);
|
||||
|
||||
class procedure HGradient3dLine(canvas : TCanvas; x1,x2,y : integer; ShadeMode : TGradientLineShade; A3dKind : TGradient3dLine = glLowered);
|
||||
class procedure VGradient3dLine(canvas : TCanvas; x,y1,y2 : integer; ShadeMode : TGradientLineShade; A3dKind : TGradient3dLine = glLowered);
|
||||
end;
|
||||
|
||||
type TTextTools = class
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure OutlinedText(Canvas : TCanvas; x, y : integer; text : string);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TColorTools }
|
||||
|
||||
class function TColorTools.Darken(kolor : TColor; percentage : byte) : TColor;
|
||||
|
||||
var r,g,b : byte;
|
||||
|
||||
begin
|
||||
r:=round(GetRValue(ColorToRGB(kolor))*(100-percentage)/100);
|
||||
g:=round(GetGValue(ColorToRGB(kolor))*(100-percentage)/100);
|
||||
b:=round(GetBValue(ColorToRGB(kolor))*(100-percentage)/100);
|
||||
result:=rgb(r,g,b);
|
||||
end;
|
||||
|
||||
class function TColorTools.Brighten(kolor : TColor; percentage : byte) : TColor;
|
||||
|
||||
var r,g,b : byte;
|
||||
|
||||
begin
|
||||
r:=round(GetRValue(ColorToRGB(kolor))+( (255-GetRValue(ColorToRGB(kolor)))*(percentage/100) ));
|
||||
g:=round(GetGValue(ColorToRGB(kolor))+( (255-GetGValue(ColorToRGB(kolor)))*(percentage/100) ));
|
||||
b:=round(GetBValue(ColorToRGB(kolor))+( (255-GetBValue(ColorToRGB(kolor)))*(percentage/100) ));
|
||||
result:=rgb(r,g,b);
|
||||
end;
|
||||
|
||||
class function TColorTools.Shade(kol1,kol2 : TColor; percentage : byte) : TColor;
|
||||
|
||||
var r,g,b : byte;
|
||||
|
||||
begin
|
||||
r:=round(GetRValue(ColorToRGB(kol1))+( (GetRValue(ColorToRGB(kol2))-GetRValue(ColorToRGB(kol1)))*(percentage/100) ));
|
||||
g:=round(GetGValue(ColorToRGB(kol1))+( (GetGValue(ColorToRGB(kol2))-GetGValue(ColorToRGB(kol1)))*(percentage/100) ));
|
||||
b:=round(GetBValue(ColorToRGB(kol1))+( (GetBValue(ColorToRGB(kol2))-GetBValue(ColorToRGB(kol1)))*(percentage/100) ));
|
||||
result:=rgb(r,g,b);
|
||||
end;
|
||||
|
||||
class function TColorTools.Shade(kol1,kol2 : TColor; Step : extended) : TColor;
|
||||
|
||||
var r,g,b : byte;
|
||||
|
||||
begin
|
||||
r:=round(GetRValue(ColorToRGB(kol1))+( (GetRValue(ColorToRGB(kol2))-GetRValue(ColorToRGB(kol1)))*(Step) ));
|
||||
g:=round(GetGValue(ColorToRGB(kol1))+( (GetGValue(ColorToRGB(kol2))-GetGValue(ColorToRGB(kol1)))*(Step) ));
|
||||
b:=round(GetBValue(ColorToRGB(kol1))+( (GetBValue(ColorToRGB(kol2))-GetBValue(ColorToRGB(kol1)))*(Step) ));
|
||||
result:=rgb(r,g,b);
|
||||
end;
|
||||
|
||||
class function TColorTools.AddColors(c1, c2 : TColor) : TColor;
|
||||
|
||||
begin
|
||||
result:=rgb(max( 0,min( 255,GetRValue(c1)+GetRValue(c2) ) ),
|
||||
max( 0,min( 255,GetGValue(c1)+GetGValue(c2) ) ),
|
||||
max( 0,min( 255,GetBValue(c1)+GetBValue(c2) ) ));
|
||||
end;
|
||||
|
||||
class function TColorTools.MultiplyColors(c1, c2 : TColor) : TColor;
|
||||
|
||||
begin
|
||||
result:=rgb(max( 0,min( 255,GetRValue(c1)*GetRValue(c2) ) ),
|
||||
max( 0,min( 255,GetGValue(c1)*GetGValue(c2) ) ),
|
||||
max( 0,min( 255,GetBValue(c1)*GetBValue(c2) ) ));
|
||||
end;
|
||||
|
||||
class function TColorTools.MultiplyColor(color : TColor; scalar : integer) : TColor;
|
||||
|
||||
begin
|
||||
result:=rgb(max( 0,min( 255,GetRValue(color)*scalar ) ),
|
||||
max( 0,min( 255,GetGValue(color)*scalar ) ),
|
||||
max( 0,min( 255,GetBValue(color)*scalar ) ));
|
||||
end;
|
||||
|
||||
class function TColorTools.MultiplyColor(color : TColor; scalar : extended) : TColor;
|
||||
|
||||
begin
|
||||
result:=rgb(max( 0,min( 255,round(GetRValue(color)*scalar) ) ),
|
||||
max( 0,min( 255,round(GetGValue(color)*scalar) ) ),
|
||||
max( 0,min( 255,round(GetBValue(color)*scalar) ) ));
|
||||
end;
|
||||
|
||||
class function TColorTools.Percent(min, pos, max : integer) : byte;
|
||||
|
||||
begin
|
||||
if max=min then result:=max else
|
||||
result:=round((pos-min)*100/(max-min));
|
||||
end;
|
||||
|
||||
{.$MESSAGE WARN 'Por�wnywanie liczb rzeczywistych? Trzeba poprawi�'}
|
||||
class function TColorTools.RGB2HSL(ARGB : TRGBTriple) : THSLTriple;
|
||||
|
||||
var RGBmin, RGBmax : extended;
|
||||
R, G, B : extended;
|
||||
H, S, L : extended;
|
||||
|
||||
begin
|
||||
R:=ARGB.rgbtRed/255;
|
||||
G:=ARGB.rgbtGreen/255;
|
||||
B:=ARGB.rgbtBlue/255;
|
||||
|
||||
RGBmin:=min(R,min(G,B));
|
||||
RGBmax:=max(R,min(G,B));
|
||||
|
||||
H:=0;
|
||||
if RGBmax=RGBmin then
|
||||
begin
|
||||
// H jest nieoznaczone, ale przyjmijmy zero dla sensowno�ci oblicze�
|
||||
H:=0;
|
||||
end else
|
||||
if (R=RGBmax) and (G>=B) then
|
||||
begin
|
||||
H:=(pi/3)*((G-B)/(RGBmax-RGBmin))+0;
|
||||
end else
|
||||
if (R=RGBmax) and (G<B) then
|
||||
begin
|
||||
H:=(pi/3)*((G-B)/(RGBmax-RGBmin))+(2*pi);
|
||||
end else
|
||||
if (G=RGBmax) then
|
||||
begin
|
||||
H:=(pi/3)*((B-R)/(RGBmax-RGBmin))+(2*pi/3);
|
||||
end else
|
||||
if (B=RGBmax) then
|
||||
begin
|
||||
H:=(pi/3)*((R-G)/(RGBmax-RGBmin))+(4*pi/3);
|
||||
end;
|
||||
|
||||
L:=(RGBmax+RGBmin)/2;
|
||||
|
||||
S:=0;
|
||||
if (L<NUM_ZERO) or (rgbMin=rgbMax) then
|
||||
begin
|
||||
S:=0;
|
||||
end else
|
||||
if (L<=0.5) then
|
||||
begin
|
||||
S:=((RGBmax-RGBmin)/(2*L));
|
||||
end else
|
||||
if (L>0.5) then
|
||||
begin
|
||||
S:=((RGBmax-RGBmin)/(2-2*L));
|
||||
end;
|
||||
|
||||
result.H:=H/(2*pi);
|
||||
result.S:=S;
|
||||
result.L:=L;
|
||||
end;
|
||||
|
||||
class function TColorTools.HSL2RGB(AHSL : THSLTriple) : TRGBTriple;
|
||||
|
||||
var R, G, B : extended;
|
||||
TR, TG, TB : extended;
|
||||
Q, P : extended;
|
||||
|
||||
function ProcessColor(Tc : extended) : extended;
|
||||
|
||||
begin
|
||||
if (Tc<(1/6)) then
|
||||
result:=P+((Q-P)*6.0*Tc) else
|
||||
if (Tc<(1/2)) then
|
||||
result:=Q else
|
||||
if (Tc<(2/3)) then
|
||||
result:=P+((Q-P)*((2/3)-Tc)*6.0) else
|
||||
result:=P;
|
||||
end;
|
||||
|
||||
begin
|
||||
if AHSL.S<NUM_ZERO then
|
||||
begin
|
||||
R:=AHSL.L;
|
||||
G:=AHSL.L;
|
||||
B:=AHSL.L;
|
||||
end else
|
||||
begin
|
||||
if (AHSL.L<0.5) then
|
||||
Q:=AHSL.L*(AHSL.S+1.0) else
|
||||
Q:=AHSL.L+AHSL.S-(AHSL.L*AHSL.S);
|
||||
|
||||
P:=2.0*AHSL.L-Q;
|
||||
|
||||
TR:=AHSL.H+(1/3);
|
||||
TG:=AHSL.H;
|
||||
TB:=AHSL.H-(1/3);
|
||||
|
||||
if (TR<0) then TR:=TR+1 else
|
||||
if (TR>1) then TR:=TR-1;
|
||||
|
||||
if (TG<0) then TG:=TG+1 else
|
||||
if (TG>1) then TG:=TG-1;
|
||||
|
||||
if (TB<0) then TB:=TB+1 else
|
||||
if (TB>1) then TB:=TB-1;
|
||||
|
||||
R:=ProcessColor(TR);
|
||||
G:=ProcessColor(TG);
|
||||
B:=ProcessColor(TB);
|
||||
end;
|
||||
|
||||
result.rgbtRed:=round(255*R);
|
||||
result.rgbtGreen:=round(255*G);
|
||||
result.rgbtBlue:=round(255*B);
|
||||
end;
|
||||
|
||||
class function TColorTools.RgbTripleToColor(ARgbTriple : TRGBTriple) : TColor;
|
||||
|
||||
begin
|
||||
result:=rgb(ARgbTriple.rgbtRed,ARgbTriple.rgbtGreen,ARgbTriple.rgbtBlue);
|
||||
end;
|
||||
|
||||
class function TColorTools.ColorToGrayscale(AColor: TColor): TColor;
|
||||
|
||||
var avg : byte;
|
||||
|
||||
begin
|
||||
avg:=(GetRValue(Acolor) + GetGValue(AColor) + GetBValue(AColor)) div 3;
|
||||
result:=rgb(avg,avg,avg);
|
||||
end;
|
||||
|
||||
class function TColorTools.ColorToRgbTriple(AColor : TColor) : TRGBTriple;
|
||||
|
||||
begin
|
||||
result.rgbtRed:=GetRValue(AColor);
|
||||
result.rgbtGreen:=GetGValue(AColor);
|
||||
result.rgbtBlue:=GetBValue(AColor);
|
||||
end;
|
||||
|
||||
{ TGradientTools }
|
||||
|
||||
class procedure TGradientTools.HGradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect);
|
||||
|
||||
var vert : array[0..1] of TRIVERTEX;
|
||||
gRect : _GRADIENT_RECT;
|
||||
Col1,Col2 : TColor;
|
||||
|
||||
begin
|
||||
Col1:=ColorToRGB(cStart);
|
||||
Col2:=ColorToRGB(cEnd);
|
||||
with vert[0] do
|
||||
begin
|
||||
x:=rect.left;
|
||||
y:=rect.top;
|
||||
Red:=GetRValue(Col1) shl 8;
|
||||
Green:=GetGValue(Col1) shl 8;
|
||||
Blue:=GetBValue(Col1) shl 8;
|
||||
Alpha:=0;
|
||||
end;
|
||||
|
||||
with vert[1] do
|
||||
begin
|
||||
x:=rect.right;
|
||||
y:=rect.bottom;
|
||||
Red:=GetRValue(Col2) shl 8;
|
||||
Green:=GetGValue(Col2) shl 8;
|
||||
Blue:=GetBValue(Col2) shl 8;
|
||||
Alpha:=0;
|
||||
end;
|
||||
|
||||
gRect.UpperLeft:=0;
|
||||
gRect.LowerRight:=1;
|
||||
GradientFill(canvas.Handle,@vert,2,@gRect,1,GRADIENT_FILL_RECT_H);
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.HGradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint);
|
||||
|
||||
begin
|
||||
HGradient(canvas,cstart,cend,rect(p1.x,p1.y,p2.x,p2.y));
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.HGradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer);
|
||||
|
||||
begin
|
||||
HGradient(canvas,cstart,cend,rect(x1,y1,x2,y2));
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.VGradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect);
|
||||
|
||||
var vert : array[0..1] of TRIVERTEX;
|
||||
gRect : _GRADIENT_RECT;
|
||||
Col1,Col2 : TColor;
|
||||
|
||||
begin
|
||||
Col1:=ColorToRGB(cStart);
|
||||
Col2:=ColorToRGB(cEnd);
|
||||
with vert[0] do
|
||||
begin
|
||||
x:=rect.left;
|
||||
y:=rect.top;
|
||||
Red:=GetRValue(Col1) shl 8;
|
||||
Green:=GetGValue(Col1) shl 8;
|
||||
Blue:=GetBValue(Col1) shl 8;
|
||||
Alpha:=0;
|
||||
end;
|
||||
|
||||
with vert[1] do
|
||||
begin
|
||||
x:=rect.right;
|
||||
y:=rect.bottom;
|
||||
Red:=GetRValue(Col2) shl 8;
|
||||
Green:=GetGValue(Col2) shl 8;
|
||||
Blue:=GetBValue(Col2) shl 8;
|
||||
Alpha:=0;
|
||||
end;
|
||||
|
||||
gRect.UpperLeft:=0;
|
||||
gRect.LowerRight:=1;
|
||||
GradientFill(canvas.Handle,@vert,2,@gRect,1,GRADIENT_FILL_RECT_V);
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.VGradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint);
|
||||
|
||||
begin
|
||||
VGradient(canvas,cstart,cend,rect(p1.x,p1.y,p2.x,p2.y));
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.VGradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer);
|
||||
|
||||
begin
|
||||
VGradient(canvas,cstart,cend,rect(x1,y1,x2,y2));
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.Gradient(canvas : TCanvas; cStart,cEnd : TColor; rect : T2DIntRect; GradientType : TGradientType);
|
||||
|
||||
begin
|
||||
if GradientType=gtVertical then VGradient(canvas, cStart, cEnd, rect) else
|
||||
HGradient(canvas, cStart, cEnd, rect);
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.Gradient(canvas : TCanvas; cStart,cEnd : TColor; p1, p2 : TPoint; GradientType : TGradientType);
|
||||
|
||||
begin
|
||||
if GradientType=gtVertical then VGradient(canvas, cStart, cEnd, p1, p2) else
|
||||
HGradient(canvas, cStart, cEnd, p1, p2);
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.Gradient(canvas : TCanvas; cStart,cEnd : TColor; x1,y1,x2,y2 : integer; GradientType : TGradientType);
|
||||
|
||||
begin
|
||||
if GradientType=gtVertical then VGradient(canvas, cStart, cEnd, x1, y1, x2, y2) else
|
||||
HGradient(canvas, cStart, cEnd, x1, y1, x2, y2);
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.HGradientLine(canvas : TCanvas; cBase, cShade : TColor; x1, x2 , y : integer; ShadeMode : TGradientLineShade);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
if x1=x2 then exit;
|
||||
if x1>x2 then
|
||||
begin
|
||||
i:=x1;
|
||||
x1:=x2;
|
||||
x2:=i;
|
||||
end;
|
||||
case ShadeMode of
|
||||
lsShadeStart : HGradient(canvas,cShade,cBase,rect(x1,y,x2,y+1));
|
||||
lsShadeEnds : begin
|
||||
i:=(x1+x2) div 2;
|
||||
HGradient(canvas,cShade,cBase,rect(x1,y,i,y+1));
|
||||
HGradient(canvas,cBase,cShade,rect(i,y,x2,y+1));
|
||||
end;
|
||||
lsShadeCenter : begin
|
||||
i:=(x1+x2) div 2;
|
||||
HGradient(canvas,cBase,cShade,rect(x1,y,i,y+1));
|
||||
HGradient(canvas,cShade,cBase,rect(i,y,x2,y+1));
|
||||
end;
|
||||
lsShadeEnd : HGradient(canvas,cBase,cShade,rect(x1,y,x2,y+1));
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.VGradientLine(canvas : TCanvas; cBase, cShade : TColor; x, y1 , y2 : integer; ShadeMode : TGradientLineShade);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
if y1=y2 then exit;
|
||||
if y1>y2 then
|
||||
begin
|
||||
i:=y1;
|
||||
y1:=y2;
|
||||
y2:=i;
|
||||
end;
|
||||
case ShadeMode of
|
||||
lsShadeStart : VGradient(canvas,cShade,cBase,rect(x,y1,x+1,y2));
|
||||
lsShadeEnds : begin
|
||||
i:=(y1+y2) div 2;
|
||||
VGradient(canvas,cShade,cBase,rect(x,y1,x+1,i));
|
||||
VGradient(canvas,cBase,cShade,rect(x,i,x+1,y2));
|
||||
end;
|
||||
lsShadeCenter : begin
|
||||
i:=(y1+y2) div 2;
|
||||
VGradient(canvas,cBase,cShade,rect(x,y1,x+1,i));
|
||||
VGradient(canvas,cShade,cBase,rect(x,i,x+1,y2));
|
||||
end;
|
||||
lsShadeEnd : VGradient(canvas,cBase,cShade,rect(x,y1,x+1,y2));
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.HGradient3dLine(canvas : TCanvas; x1,x2,y : integer; ShadeMode : TGradientLineShade; A3dKind : TGradient3dLine = glLowered);
|
||||
|
||||
begin
|
||||
if A3dKind = glRaised then
|
||||
begin
|
||||
HGradientLine(canvas,clBtnHighlight,clBtnFace,x1,x2,y,ShadeMode);
|
||||
HGradientLine(canvas,clBtnShadow,clBtnFace,x1,x2,y+1,ShadeMode);
|
||||
end else
|
||||
begin
|
||||
HGradientLine(canvas,clBtnShadow,clBtnFace,x1,x2,y,ShadeMode);
|
||||
HGradientLine(canvas,clBtnHighlight,clBtnFace,x1,x2,y+1,ShadeMode);
|
||||
end;
|
||||
end;
|
||||
|
||||
class procedure TGradientTools.VGradient3dLine(canvas : TCanvas; x,y1,y2 : integer; ShadeMode : TGradientLineShade; A3dKind : TGradient3dLine = glLowered);
|
||||
|
||||
begin
|
||||
if A3dKind = glLowered then
|
||||
begin
|
||||
VGradientLine(canvas,clBtnFace,clBtnHighlight,x,y1,y2,ShadeMode);
|
||||
VGradientLine(canvas,clBtnFace,clBtnShadow,x+1,y1,y2,ShadeMode);
|
||||
end else
|
||||
begin
|
||||
VGradientLine(canvas,clBtnFace,clBtnShadow,x,y1,y2,ShadeMode);
|
||||
VGradientLine(canvas,clBtnFace,clBtnHighlight,x+1,y1,y2,ShadeMode);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TTextTools }
|
||||
|
||||
class procedure TTextTools.OutlinedText(Canvas : TCanvas; x, y : integer; text : string);
|
||||
|
||||
var TmpColor : TColor;
|
||||
TmpBrushStyle : TBrushStyle;
|
||||
|
||||
begin
|
||||
TmpColor:=Canvas.Font.color;
|
||||
TmpBrushStyle:=Canvas.Brush.style;
|
||||
|
||||
Canvas.brush.style:=bsClear;
|
||||
|
||||
Canvas.font.color:=clBlack;
|
||||
Canvas.TextOut(x-1,y,text);
|
||||
Canvas.TextOut(x+1,y,text);
|
||||
Canvas.TextOut(x,y-1,text);
|
||||
Canvas.TextOut(x,y+1,text);
|
||||
|
||||
Canvas.font.color:=TmpColor;
|
||||
Canvas.TextOut(x,y,text);
|
||||
|
||||
Canvas.Brush.Style:=TmpBrushStyle;
|
||||
end;
|
||||
|
||||
end.
|
1378
components/spktoolbar/SpkMath/SpkMath.pas
Normal file
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Button-add.bmp
Normal file
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Button.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Move-down.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Move-up.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Pane-add.bmp
Normal file
After Width: | Height: | Size: 822 B |
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Pane.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Tab-add.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Tab-remove.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Tab.bmp
Normal file
After Width: | Height: | Size: 822 B |
BIN
components/spktoolbar/SpkToolbar - designtime/GFX/Template.xcf
Normal file
@ -0,0 +1,368 @@
|
||||
unit SpkToolbarEditor;
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Controls, Classes, DesignEditors, DesignIntf, TypInfo, Dialogs,
|
||||
SysUtils,
|
||||
spkToolbar, spkt_Tab, spkt_Pane, spkt_Appearance,
|
||||
spkte_EditWindow, spkte_AppearanceEditor;
|
||||
|
||||
const PROPERTY_CONTENTS_NAME = 'Contents';
|
||||
PROPERTY_CONTENTS_VALUE = 'Open editor...';
|
||||
|
||||
type TAddContentsFilter = class(TSelectionEditor, ISelectionPropertyFilter)
|
||||
public
|
||||
procedure FilterProperties(const ASelection: IDesignerSelections; const ASelectionProperties: IInterfaceList);
|
||||
end;
|
||||
|
||||
type TSpkToolbarContentsEditor = class(TBasePropertyEditor, IProperty, IPropertyKind)
|
||||
private
|
||||
protected
|
||||
FPropList : PInstPropList;
|
||||
FPropCount : integer;
|
||||
FDesigner : IDesigner;
|
||||
FToolbar : TSpkToolbar;
|
||||
|
||||
procedure SetPropEntry(Index: Integer; AInstance: TPersistent;
|
||||
APropInfo: PPropInfo); override;
|
||||
procedure Initialize; override;
|
||||
public
|
||||
constructor Create(const ADesigner: IDesigner; APropCount: Integer); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure Activate;
|
||||
function AllEqual: Boolean;
|
||||
function AutoFill: Boolean;
|
||||
procedure Edit;
|
||||
function HasInstance(Instance: TPersistent): Boolean;
|
||||
function GetAttributes: TPropertyAttributes;
|
||||
function GetEditLimit: Integer;
|
||||
function GetEditValue(out Value: string): Boolean;
|
||||
function GetName: string;
|
||||
procedure GetProperties(Proc: TGetPropProc);
|
||||
function GetPropInfo: PPropInfo;
|
||||
function GetPropType: PTypeInfo;
|
||||
function GetValue: string;
|
||||
procedure GetValues(Proc: TGetStrProc);
|
||||
procedure Revert;
|
||||
procedure SetValue(const Value: string);
|
||||
function ValueAvailable: Boolean;
|
||||
|
||||
function GetKind: TTypeKind;
|
||||
|
||||
property PropCount : integer read FPropCount;
|
||||
property Designer : IDesigner read FDesigner;
|
||||
property Toolbar : TSpkToolbar read FToolbar write FToolbar;
|
||||
end;
|
||||
|
||||
type TSpkToolbarCaptionEditor = class(TStringProperty)
|
||||
private
|
||||
protected
|
||||
public
|
||||
procedure SetValue(const Value: string); override;
|
||||
end;
|
||||
|
||||
type TSpkToolbarAppearanceEditor = class(TClassProperty)
|
||||
private
|
||||
protected
|
||||
public
|
||||
function GetAttributes: TPropertyAttributes; override;
|
||||
procedure Edit; override;
|
||||
end;
|
||||
|
||||
type TSpkToolbarEditor = class(TComponentEditor)
|
||||
protected
|
||||
procedure DoOpenContentsEditor;
|
||||
public
|
||||
procedure Edit; override;
|
||||
procedure ExecuteVerb(Index: Integer); override;
|
||||
function GetVerb(Index: Integer): string; override;
|
||||
function GetVerbCount: Integer; override;
|
||||
end;
|
||||
|
||||
var EditWindow : TfrmEditWindow;
|
||||
|
||||
implementation
|
||||
|
||||
{ TSpkToolbarEditor }
|
||||
|
||||
procedure TSpkToolbarContentsEditor.Activate;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.AllEqual: Boolean;
|
||||
begin
|
||||
result:=FPropCount = 1;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.AutoFill: Boolean;
|
||||
begin
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
constructor TSpkToolbarContentsEditor.Create(const ADesigner: IDesigner;
|
||||
APropCount: Integer);
|
||||
begin
|
||||
inherited Create(ADesigner, APropCount);
|
||||
FDesigner:=ADesigner;
|
||||
FPropCount:=APropCount;
|
||||
FToolbar:=nil;
|
||||
GetMem(FPropList, APropCount * SizeOf(TInstProp));
|
||||
FillChar(FPropList^, APropCount * SizeOf(TInstProp), 0);
|
||||
end;
|
||||
|
||||
destructor TSpkToolbarContentsEditor.Destroy;
|
||||
begin
|
||||
if FPropList <> nil then
|
||||
FreeMem(FPropList, FPropCount * SizeOf(TInstProp));
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.Edit;
|
||||
begin
|
||||
EditWindow.SetData(FToolbar,self.Designer);
|
||||
EditWindow.Show;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetAttributes: TPropertyAttributes;
|
||||
begin
|
||||
result:=[paDialog, paReadOnly];
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetEditLimit: Integer;
|
||||
begin
|
||||
result:=0;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetEditValue(out Value: string): Boolean;
|
||||
begin
|
||||
Value:=GetValue;
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetKind: TTypeKind;
|
||||
begin
|
||||
result:=tkClass;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetName: string;
|
||||
begin
|
||||
result:=PROPERTY_CONTENTS_NAME;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.GetProperties(Proc: TGetPropProc);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetPropInfo: PPropInfo;
|
||||
begin
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetPropType: PTypeInfo;
|
||||
begin
|
||||
Result:=nil;
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.GetValue: string;
|
||||
begin
|
||||
result:=PROPERTY_CONTENTS_VALUE;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.GetValues(Proc: TGetStrProc);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.HasInstance(Instance: TPersistent): Boolean;
|
||||
begin
|
||||
result:=EditWindow.Toolbar = Instance;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.Initialize;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.Revert;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.SetPropEntry(Index: Integer; AInstance: TPersistent;
|
||||
APropInfo: PPropInfo);
|
||||
begin
|
||||
with FPropList^[Index] do
|
||||
begin
|
||||
Instance := AInstance;
|
||||
PropInfo := APropInfo;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarContentsEditor.SetValue(const Value: string);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
function TSpkToolbarContentsEditor.ValueAvailable: Boolean;
|
||||
begin
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
{ TSelectionFilter }
|
||||
|
||||
procedure TAddContentsFilter.FilterProperties(
|
||||
const ASelection: IDesignerSelections;
|
||||
const ASelectionProperties: IInterfaceList);
|
||||
|
||||
var ContentsEditor : TSpkToolbarContentsEditor;
|
||||
Prop : IProperty;
|
||||
i : integer;
|
||||
Added : boolean;
|
||||
|
||||
begin
|
||||
if ASelection.Count<>1 then
|
||||
exit;
|
||||
|
||||
if ASelection[0] is TSpkToolbar then
|
||||
begin
|
||||
ContentsEditor:=TSpkToolbarContentsEditor.Create(inherited Designer, 1);
|
||||
ContentsEditor.Toolbar:=ASelection[0] as TSpkToolbar;
|
||||
|
||||
i:=0;
|
||||
Added:=false;
|
||||
while (i<ASelectionProperties.Count) and not Added do
|
||||
begin
|
||||
ASelectionProperties.Items[i].QueryInterface(IProperty, Prop);
|
||||
if (assigned(Prop)) and (Prop.GetName>PROPERTY_CONTENTS_NAME) then
|
||||
begin
|
||||
ASelectionProperties.Insert(i, ContentsEditor);
|
||||
Added:=true;
|
||||
end;
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
if not(Added) then
|
||||
ASelectionProperties.Add(ContentsEditor as IProperty);
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TSpkToolbarEditor }
|
||||
|
||||
procedure TSpkToolbarEditor.DoOpenContentsEditor;
|
||||
|
||||
var Component : TComponent;
|
||||
Toolbar : TSpkToolbar;
|
||||
Designer : IDesigner;
|
||||
|
||||
begin
|
||||
Component:=self.GetComponent;
|
||||
if not(assigned(Component)) then
|
||||
exit;
|
||||
|
||||
if not(Component is TSpkToolbar) then
|
||||
exit;
|
||||
|
||||
Toolbar:=Component as TSpkToolbar;
|
||||
Designer:=self.GetDesigner;
|
||||
|
||||
EditWindow.SetData(Toolbar,Designer);
|
||||
EditWindow.Show;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarEditor.Edit;
|
||||
|
||||
begin
|
||||
DoOpenContentsEditor;
|
||||
end;
|
||||
|
||||
procedure TSpkToolbarEditor.ExecuteVerb(Index: Integer);
|
||||
begin
|
||||
case Index of
|
||||
0 : DoOpenContentsEditor;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSpkToolbarEditor.GetVerb(Index: Integer): string;
|
||||
begin
|
||||
case Index of
|
||||
0 : result:='Contents editor...';
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSpkToolbarEditor.GetVerbCount: Integer;
|
||||
begin
|
||||
result:=1;
|
||||
end;
|
||||
|
||||
{ TSpkToolbarCaptionEditor }
|
||||
|
||||
procedure TSpkToolbarCaptionEditor.SetValue(const Value: string);
|
||||
begin
|
||||
inherited;
|
||||
EditWindow.RefreshNames;
|
||||
end;
|
||||
|
||||
{ TSpkToolbarAppearanceEditor }
|
||||
|
||||
procedure TSpkToolbarAppearanceEditor.Edit;
|
||||
|
||||
var Obj : TObject;
|
||||
Toolbar : TSpkToolbar;
|
||||
Tab : TSpkTab;
|
||||
AppearanceEditor : tfrmAppearanceEditWindow;
|
||||
|
||||
begin
|
||||
Obj:=GetComponent(0);
|
||||
if Obj is TSpkToolbar then
|
||||
begin
|
||||
Toolbar:=(Obj as TSpkToolbar);
|
||||
|
||||
AppearanceEditor:=TfrmAppearanceEditWindow.Create(nil);
|
||||
try
|
||||
AppearanceEditor.Appearance.Assign(Toolbar.Appearance);
|
||||
if AppearanceEditor.ShowModal = mrOK then
|
||||
begin
|
||||
Toolbar.Appearance.Assign(AppearanceEditor.Appearance);
|
||||
Modified;
|
||||
end;
|
||||
finally
|
||||
AppearanceEditor.Free;
|
||||
end;
|
||||
|
||||
end else
|
||||
if Obj is TSpkTab then
|
||||
begin
|
||||
Tab:=(Obj as TSpkTab);
|
||||
|
||||
AppearanceEditor:=TfrmAppearanceEditWindow.Create(nil);
|
||||
try
|
||||
AppearanceEditor.Appearance.Assign(Tab.CustomAppearance);
|
||||
if AppearanceEditor.ShowModal = mrOK then
|
||||
begin
|
||||
Tab.CustomAppearance.Assign(AppearanceEditor.Appearance);
|
||||
Modified;
|
||||
end;
|
||||
finally
|
||||
AppearanceEditor.Free;
|
||||
end;
|
||||
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSpkToolbarAppearanceEditor.GetAttributes: TPropertyAttributes;
|
||||
begin
|
||||
result:=inherited GetAttributes + [paDialog] - [paMultiSelect];
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
EditWindow:=TfrmEditWindow.create(nil);
|
||||
|
||||
finalization
|
||||
|
||||
EditWindow.Free;
|
||||
|
||||
end.
|
@ -0,0 +1,740 @@
|
||||
unit spkte_AppearanceEditor;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, ExtCtrls, StdCtrls, ComCtrls,
|
||||
SpkGUITools, SpkXMLParser,
|
||||
spkt_Buttons, spkt_BaseItem, spkt_Pane, spkt_Types, spkt_Tab, SpkToolbar,
|
||||
spkt_Appearance;
|
||||
|
||||
type
|
||||
TfrmAppearanceEditWindow = class(TForm)
|
||||
gbPreview: TGroupBox;
|
||||
tbPreview: TSpkToolbar;
|
||||
SpkTab1: TSpkTab;
|
||||
SpkPane1: TSpkPane;
|
||||
SpkLargeButton1: TSpkLargeButton;
|
||||
SpkLargeButton3: TSpkLargeButton;
|
||||
SpkLargeButton2: TSpkLargeButton;
|
||||
SpkPane2: TSpkPane;
|
||||
SpkSmallButton1: TSpkSmallButton;
|
||||
SpkSmallButton2: TSpkSmallButton;
|
||||
SpkSmallButton3: TSpkSmallButton;
|
||||
SpkPane3: TSpkPane;
|
||||
SpkSmallButton4: TSpkSmallButton;
|
||||
SpkSmallButton5: TSpkSmallButton;
|
||||
SpkSmallButton6: TSpkSmallButton;
|
||||
SpkSmallButton7: TSpkSmallButton;
|
||||
SpkSmallButton8: TSpkSmallButton;
|
||||
PageControl1: TPageControl;
|
||||
TabSheet1: TTabSheet;
|
||||
TabSheet2: TTabSheet;
|
||||
TabSheet3: TTabSheet;
|
||||
Label2: TLabel;
|
||||
pTabFrame: TPanel;
|
||||
pTabGradientFrom: TPanel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
pTabGradientTo: TPanel;
|
||||
cbTabGradientKind: TComboBox;
|
||||
Label5: TLabel;
|
||||
Label6: TLabel;
|
||||
pTabHeaderFont: TPanel;
|
||||
Label8: TLabel;
|
||||
pPaneBorderDark: TPanel;
|
||||
pPaneBorderLight: TPanel;
|
||||
Label21: TLabel;
|
||||
Label9: TLabel;
|
||||
pPaneGradientFrom: TPanel;
|
||||
pPaneGradientTo: TPanel;
|
||||
Label10: TLabel;
|
||||
Label11: TLabel;
|
||||
cbPaneGradientKind: TComboBox;
|
||||
pPaneCaptionBackground: TPanel;
|
||||
Label12: TLabel;
|
||||
Label13: TLabel;
|
||||
pPaneCaptionFont: TPanel;
|
||||
Label1: TLabel;
|
||||
Label7: TLabel;
|
||||
Label14: TLabel;
|
||||
Label25: TLabel;
|
||||
Label26: TLabel;
|
||||
pItemFont: TPanel;
|
||||
cbItemIdleGradientKind: TComboBox;
|
||||
pItemIdleGradientTo: TPanel;
|
||||
pItemIdleGradientFrom: TPanel;
|
||||
pItemIdleFrame: TPanel;
|
||||
Label27: TLabel;
|
||||
Label28: TLabel;
|
||||
pItemIdleCaptionColor: TPanel;
|
||||
Label29: TLabel;
|
||||
pItemIdleInnerDark: TPanel;
|
||||
Label30: TLabel;
|
||||
pItemIdleInnerLight: TPanel;
|
||||
cbItemHottrackGradientKind: TComboBox;
|
||||
pItemHottrackGradientTo: TPanel;
|
||||
pItemHottrackGradientFrom: TPanel;
|
||||
pItemHottrackFrame: TPanel;
|
||||
Label15: TLabel;
|
||||
pItemHottrackCaptionColor: TPanel;
|
||||
pItemHottrackInnerDark: TPanel;
|
||||
pItemHottrackInnerLight: TPanel;
|
||||
cbItemActiveGradientKind: TComboBox;
|
||||
pItemActiveGradientTo: TPanel;
|
||||
pItemActiveGradientFrom: TPanel;
|
||||
pItemActiveFrame: TPanel;
|
||||
Label16: TLabel;
|
||||
pItemActiveCaptionColor: TPanel;
|
||||
pItemActiveInnerDark: TPanel;
|
||||
pItemActiveInnerLight: TPanel;
|
||||
bOK: TButton;
|
||||
bCancel: TButton;
|
||||
cdColorDialog: TColorDialog;
|
||||
fdFontDialog: TFontDialog;
|
||||
pTabHeaderFontColor: TPanel;
|
||||
pPaneCaptionFontColor: TPanel;
|
||||
TabSheet4: TTabSheet;
|
||||
bImport: TButton;
|
||||
bExport: TButton;
|
||||
mXML: TMemo;
|
||||
sTabRectangle: TShape;
|
||||
cbLinkTab: TCheckBox;
|
||||
sPaneRectangle: TShape;
|
||||
cbLinkPane: TCheckBox;
|
||||
cbLinkItem: TCheckBox;
|
||||
sItemRectangle: TShape;
|
||||
TabSheet5: TTabSheet;
|
||||
Label17: TLabel;
|
||||
bReset: TButton;
|
||||
procedure pTabFrameClick(Sender: TObject);
|
||||
procedure pTabGradientFromClick(Sender: TObject);
|
||||
procedure pTabGradientToClick(Sender: TObject);
|
||||
procedure pPaneBorderDarkClick(Sender: TObject);
|
||||
procedure pPaneBorderLightClick(Sender: TObject);
|
||||
procedure pPaneGradientFromClick(Sender: TObject);
|
||||
procedure pPaneGradientToClick(Sender: TObject);
|
||||
procedure pPaneCaptionBackgroundClick(Sender: TObject);
|
||||
procedure pItemIdleFrameClick(Sender: TObject);
|
||||
procedure pItemIdleGradientFromClick(Sender: TObject);
|
||||
procedure pItemIdleGradientToClick(Sender: TObject);
|
||||
procedure pItemIdleCaptionColorClick(Sender: TObject);
|
||||
procedure pItemIdleInnerDarkClick(Sender: TObject);
|
||||
procedure pItemIdleInnerLightClick(Sender: TObject);
|
||||
procedure pItemHottrackFrameClick(Sender: TObject);
|
||||
procedure pItemHottrackGradientFromClick(Sender: TObject);
|
||||
procedure pItemHottrackGradientToClick(Sender: TObject);
|
||||
procedure pItemHottrackCaptionColorClick(Sender: TObject);
|
||||
procedure pItemHottrackInnerDarkClick(Sender: TObject);
|
||||
procedure pItemHottrackInnerLightClick(Sender: TObject);
|
||||
procedure pItemActiveFrameClick(Sender: TObject);
|
||||
procedure pItemActiveGradientFromClick(Sender: TObject);
|
||||
procedure pItemActiveGradientToClick(Sender: TObject);
|
||||
procedure pItemActiveCaptionColorClick(Sender: TObject);
|
||||
procedure pItemActiveInnerDarkClick(Sender: TObject);
|
||||
procedure pItemActiveInnerLightClick(Sender: TObject);
|
||||
procedure pTabHeaderFontClick(Sender: TObject);
|
||||
procedure pPaneCaptionFontClick(Sender: TObject);
|
||||
procedure pItemFontClick(Sender: TObject);
|
||||
procedure cbTabGradientKindChange(Sender: TObject);
|
||||
procedure cbPaneGradientKindChange(Sender: TObject);
|
||||
procedure cbItemIdleGradientKindChange(Sender: TObject);
|
||||
procedure cbItemHottrackGradientKindChange(Sender: TObject);
|
||||
procedure cbItemActiveGradientKindChange(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure pTabHeaderFontColorClick(Sender: TObject);
|
||||
procedure pPaneCaptionFontColorClick(Sender: TObject);
|
||||
procedure bExportClick(Sender: TObject);
|
||||
procedure bImportClick(Sender: TObject);
|
||||
procedure cbLinkTabClick(Sender: TObject);
|
||||
procedure cbLinkPaneClick(Sender: TObject);
|
||||
procedure cbLinkItemClick(Sender: TObject);
|
||||
procedure bResetClick(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
procedure SetLinkedFrameColor(AColor : TColor);
|
||||
procedure SetLinkedGradientFromColor(AColor : TColor);
|
||||
procedure SetLinkedGradientToColor(AColor : TColor);
|
||||
procedure SetLinkedGradientKind(AKindIndex : integer);
|
||||
|
||||
function GetAppearance: TSpkToolbarAppearance;
|
||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
|
||||
procedure SwitchAttributesLink(const Value : boolean);
|
||||
|
||||
function ChangeColor(Panel : TPanel) : boolean;
|
||||
procedure SetPanelColor(Panel: TPanel; AColor : TColor);
|
||||
function ChangeFont(Panel : TPanel) : boolean;
|
||||
procedure SetPanelFont(Panel : TPanel; AFont : TFont);
|
||||
procedure SetComboGradientKind(Combo : TComboBox; GradientType : TBackgroundKind);
|
||||
procedure LoadAppearance(AAppearance : TSpkToolbarAppearance);
|
||||
public
|
||||
property Appearance : TSpkToolbarAppearance read GetAppearance write SetAppearance;
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
frmAppearanceEditWindow: TfrmAppearanceEditWindow;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.dfm}
|
||||
|
||||
{ TForm3 }
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
begin
|
||||
tbPreview.Appearance.Assign(Value);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetComboGradientKind(Combo: TComboBox;
|
||||
GradientType: TBackgroundKind);
|
||||
begin
|
||||
case GradientType of
|
||||
bkSolid: Combo.itemindex:=0;
|
||||
bkHorizontalGradient: Combo.itemindex:=1;
|
||||
bkVerticalGradient: Combo.itemindex:=2;
|
||||
bkConcave: Combo.itemindex:=3;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetLinkedFrameColor(AColor: TColor);
|
||||
begin
|
||||
tbPreview.Appearance.Tab.BorderColor:=AColor;
|
||||
SetPanelColor(pTabFrame, AColor);
|
||||
|
||||
tbPreview.Appearance.Pane.BorderDarkColor:=AColor;
|
||||
SetPanelColor(pPaneBorderDark, AColor);
|
||||
|
||||
tbPreview.Appearance.Element.IdleFrameColor:=AColor;
|
||||
SetPanelColor(pItemIdleFrame, AColor);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetLinkedGradientFromColor(AColor: TColor);
|
||||
begin
|
||||
tbPreview.Appearance.Tab.GradientFromColor:=AColor;
|
||||
SetPanelColor(pTabGradientFrom, AColor);
|
||||
|
||||
tbPreview.Appearance.Pane.GradientFromColor:=AColor;
|
||||
SetPanelColor(pPaneGradientFrom, AColor);
|
||||
|
||||
tbPreview.Appearance.Element.IdleGradientFromColor:=AColor;
|
||||
SetPanelColor(pItemIdleGradientFrom, AColor);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetLinkedGradientKind(AKindIndex: integer);
|
||||
|
||||
var Kind : TBackgroundKind;
|
||||
|
||||
begin
|
||||
case AKindIndex of
|
||||
0 : Kind:=bkSolid;
|
||||
1 : Kind:=bkHorizontalGradient;
|
||||
2 : Kind:=bkVerticalGradient;
|
||||
3 : Kind:=bkConcave;
|
||||
else Kind:=bkSolid;
|
||||
end;
|
||||
|
||||
tbPreview.Appearance.Tab.GradientType:=Kind;
|
||||
SetComboGradientKind(cbTabGradientKind, Kind);
|
||||
|
||||
tbPreview.Appearance.Pane.GradientType:=Kind;
|
||||
SetComboGradientKind(cbPaneGradientKind, Kind);
|
||||
|
||||
tbPreview.Appearance.Element.IdleGradientType:=Kind;
|
||||
SetComboGradientKind(cbItemIdleGradientKind, Kind);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetLinkedGradientToColor(AColor: TColor);
|
||||
begin
|
||||
tbPreview.Appearance.Tab.GradientToColor:=AColor;
|
||||
SetPanelColor(pTabGradientTo, AColor);
|
||||
|
||||
tbPreview.Appearance.Pane.GradientToColor:=AColor;
|
||||
SetPanelColor(pPaneGradientTo, AColor);
|
||||
|
||||
tbPreview.Appearance.Element.IdleGradientToColor:=AColor;
|
||||
SetPanelColor(pItemIdleGradientTo, AColor);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetPanelColor(Panel: TPanel; AColor : TColor);
|
||||
begin
|
||||
Panel.Color := AColor;
|
||||
if Panel.Color<>AColor then
|
||||
Showmessage('lipa!');
|
||||
if (GetRValue(AColor) + GetGValue(AColor) + GetBValue(AColor)) div 3 >= 128 then
|
||||
Panel.Font.Color := clBlack
|
||||
else
|
||||
Panel.Font.Color := clWhite;
|
||||
Panel.Caption := '$' + IntToHex(AColor, 8);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SetPanelFont(Panel: TPanel; AFont: TFont);
|
||||
begin
|
||||
Panel.Font.assign(AFont);
|
||||
Panel.Caption:=AFont.Name+', '+inttostr(AFont.Size);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.SwitchAttributesLink(const Value: boolean);
|
||||
begin
|
||||
cbLinkTab.checked:=Value;
|
||||
cbLinkPane.Checked:=Value;
|
||||
cbLinkItem.Checked:=Value;
|
||||
|
||||
sTabRectangle.visible:=Value;
|
||||
sPaneRectangle.Visible:=Value;
|
||||
sItemRectangle.Visible:=Value;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbItemHottrackGradientKindChange(Sender: TObject);
|
||||
begin
|
||||
case (Sender as TCombobox).ItemIndex of
|
||||
0 : tbPreview.Appearance.Element.HottrackGradientType:=bkSolid;
|
||||
1 : tbPreview.Appearance.Element.HottrackGradientType:=bkHorizontalGradient;
|
||||
2 : tbPreview.Appearance.Element.HottrackGradientType:=bkVerticalGradient;
|
||||
3 : tbPreview.Appearance.Element.HottrackGradientType:=bkConcave;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbItemIdleGradientKindChange(Sender: TObject);
|
||||
begin
|
||||
case (Sender as TCombobox).ItemIndex of
|
||||
0 : tbPreview.Appearance.Element.IdleGradientType:=bkSolid;
|
||||
1 : tbPreview.Appearance.Element.IdleGradientType:=bkHorizontalGradient;
|
||||
2 : tbPreview.Appearance.Element.IdleGradientType:=bkVerticalGradient;
|
||||
3 : tbPreview.Appearance.Element.IdleGradientType:=bkConcave;
|
||||
end;
|
||||
|
||||
if cbLinkItem.Checked then
|
||||
SetLinkedGradientKind((Sender as TComboBox).ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbLinkItemClick(Sender: TObject);
|
||||
begin
|
||||
SwitchAttributesLink(cbLinkItem.Checked);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbLinkPaneClick(Sender: TObject);
|
||||
begin
|
||||
SwitchAttributesLink(cbLinkPane.Checked);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbLinkTabClick(Sender: TObject);
|
||||
begin
|
||||
SwitchAttributesLink(cbLinkTab.Checked);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbTabGradientKindChange(Sender: TObject);
|
||||
begin
|
||||
case (Sender as TCombobox).ItemIndex of
|
||||
0 : tbPreview.Appearance.Tab.GradientType:=bkSolid;
|
||||
1 : tbPreview.Appearance.Tab.GradientType:=bkHorizontalGradient;
|
||||
2 : tbPreview.Appearance.Tab.GradientType:=bkVerticalGradient;
|
||||
3 : tbPreview.Appearance.Tab.GradientType:=bkConcave;
|
||||
end;
|
||||
|
||||
if cbLinkTab.Checked then
|
||||
SetLinkedGradientKind((Sender as TComboBox).ItemIndex);
|
||||
end;
|
||||
|
||||
function TfrmAppearanceEditWindow.ChangeColor(Panel: TPanel): boolean;
|
||||
begin
|
||||
cdColorDialog.Color:=Panel.Color;
|
||||
if cdColorDialog.Execute then
|
||||
begin
|
||||
SetPanelColor(Panel, cdColorDialog.Color);
|
||||
result:=true
|
||||
end
|
||||
else
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
function TfrmAppearanceEditWindow.ChangeFont(Panel: TPanel): boolean;
|
||||
begin
|
||||
fdFontDialog.Font.assign(Panel.font);
|
||||
if fdFontDialog.Execute then
|
||||
begin
|
||||
SetPanelFont(Panel, fdFontDialog.Font);
|
||||
result:=true;
|
||||
end
|
||||
else
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.FormShow(Sender: TObject);
|
||||
begin
|
||||
LoadAppearance(tbPreview.Appearance);
|
||||
end;
|
||||
|
||||
function TfrmAppearanceEditWindow.GetAppearance: TSpkToolbarAppearance;
|
||||
begin
|
||||
result:=tbPreview.Appearance;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.LoadAppearance(AAppearance: TSpkToolbarAppearance);
|
||||
begin
|
||||
with AAppearance do
|
||||
begin
|
||||
with Tab do
|
||||
begin
|
||||
SetPanelColor(pTabFrame, BorderColor);
|
||||
SetPanelColor(pTabGradientFrom, GradientFromColor);
|
||||
SetPanelColor(pTabGradientTo, GradientToColor);
|
||||
SetComboGradientKind(cbTabGradientKind, GradientType);
|
||||
SetPanelFont(pTabHeaderFont, TabHeaderFont);
|
||||
SetPanelColor(pTabHeaderFontColor, TabHeaderFont.Color);
|
||||
end;
|
||||
|
||||
with Pane do
|
||||
begin
|
||||
SetPanelColor(pPaneBorderDark, BorderDarkColor);
|
||||
SetPanelColor(pPaneBorderLight, BorderLightColor);
|
||||
SetPanelColor(pPaneGradientFrom, GradientFromColor);
|
||||
SetPanelColor(pPaneGradientTo, GradientToColor);
|
||||
SetComboGradientKind(cbPaneGradientKind, GradientType);
|
||||
SetPanelColor(pPaneCaptionBackground, CaptionBgColor);
|
||||
SetPanelFont(pPaneCaptionFont, CaptionFont);
|
||||
SetPanelColor(pPaneCaptionFontColor, CaptionFont.Color);
|
||||
end;
|
||||
|
||||
with Element do
|
||||
begin
|
||||
SetPanelFont(pItemFont, CaptionFont);
|
||||
|
||||
SetPanelColor(pItemIdleFrame, IdleFrameColor);
|
||||
SetPanelColor(pItemIdleGradientFrom, IdleGradientFromColor);
|
||||
SetPanelColor(pItemIdleGradientTo, IdleGradientToColor);
|
||||
SetComboGradientKind(cbItemIdleGradientKind, IdleGradientType);
|
||||
SetPanelColor(pItemIdleCaptionColor, IdleCaptionColor);
|
||||
SetPanelColor(pItemIdleInnerDark, IdleInnerDarkColor);
|
||||
SetPanelColor(pItemIdleInnerLight, IdleInnerLightColor);
|
||||
|
||||
SetPanelColor(pItemHottrackFrame, HottrackFrameColor);
|
||||
SetPanelColor(pItemHottrackGradientFrom, HottrackGradientFromColor);
|
||||
SetPanelColor(pItemHottrackGradientTo, HottrackGradientToColor);
|
||||
SetComboGradientKind(cbItemHottrackGradientKind, HottrackGradientType);
|
||||
SetPanelColor(pItemHottrackCaptionColor, HottrackCaptionColor);
|
||||
SetPanelColor(pItemHottrackInnerDark, HottrackInnerDarkColor);
|
||||
SetPanelColor(pItemHottrackInnerLight, HottrackInnerLightColor);
|
||||
|
||||
SetPanelColor(pItemActiveFrame, ActiveFrameColor);
|
||||
SetPanelColor(pItemActiveGradientFrom, ActiveGradientFromColor);
|
||||
SetPanelColor(pItemActiveGradientTo, ActiveGradientToColor);
|
||||
SetComboGradientKind(cbItemActiveGradientKind, ActiveGradientType);
|
||||
SetPanelColor(pItemActiveCaptionColor, ActiveCaptionColor);
|
||||
SetPanelColor(pItemActiveInnerDark, ActiveInnerDarkColor);
|
||||
SetPanelColor(pItemActiveInnerLight, ActiveInnerLightColor);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveCaptionColorClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveCaptionColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveFrameClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveFrameColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveGradientFromClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveGradientFromColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.bExportClick(Sender: TObject);
|
||||
|
||||
var Xml : TSpkXMLParser;
|
||||
Node : TSpkXMLNode;
|
||||
|
||||
begin
|
||||
XML:=TSpkXMLParser.Create;
|
||||
try
|
||||
Node:=XML['Appearance',true];
|
||||
tbPreview.Appearance.SaveToXML(Node);
|
||||
|
||||
mXML.Clear;
|
||||
mXml.Text:=XML.Generate;
|
||||
finally
|
||||
XML.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.bImportClick(Sender: TObject);
|
||||
|
||||
var XML : TSpkXMLParser;
|
||||
Node: TSpkXMLNode;
|
||||
|
||||
begin
|
||||
tbPreview.BeginUpdate;
|
||||
XML:=TSpkXMLParser.Create;
|
||||
try
|
||||
XML.Parse(PChar(mXML.text));
|
||||
Node:=XML['Appearance',false];
|
||||
if assigned(Node) then
|
||||
tbPreview.Appearance.LoadFromXML(Node);
|
||||
LoadAppearance(tbPreview.Appearance);
|
||||
finally
|
||||
XML.Free;
|
||||
tbPreview.EndUpdate;
|
||||
tbPreview.ForceRepaint;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.bResetClick(Sender: TObject);
|
||||
begin
|
||||
tbPreview.Appearance.Reset;
|
||||
LoadAppearance(tbPreview.Appearance);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbItemActiveGradientKindChange(Sender: TObject);
|
||||
begin
|
||||
case (Sender as TCombobox).ItemIndex of
|
||||
0 : tbPreview.Appearance.Element.ActiveGradientType:=bkSolid;
|
||||
1 : tbPreview.Appearance.Element.ActiveGradientType:=bkHorizontalGradient;
|
||||
2 : tbPreview.Appearance.Element.ActiveGradientType:=bkVerticalGradient;
|
||||
3 : tbPreview.Appearance.Element.ActiveGradientType:=bkConcave;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveGradientToClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveGradientToColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveInnerDarkClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveInnerDarkColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemActiveInnerLightClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.ActiveInnerLightColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackCaptionColorClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackCaptionColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackFrameClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackFrameColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackGradientFromClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackGradientFromColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackGradientToClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackGradientToColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackInnerDarkClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackInnerDarkColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemHottrackInnerLightClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.HotTrackInnerLightColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleCaptionColorClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.IdleCaptionColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleFrameClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Element.IdleFrameColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkItem.Checked then
|
||||
SetLinkedFrameColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleGradientFromClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Element.IdleGradientFromColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkItem.Checked then
|
||||
SetLinkedGradientFromColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleGradientToClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Element.IdleGradientToColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkItem.Checked then
|
||||
SetLinkedGradientToColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleInnerDarkClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.IdleInnerDarkColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemIdleInnerLightClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.IdleInnerLightColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pItemFontClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeFont(Sender as TPanel) then
|
||||
tbPreview.Appearance.Element.CaptionFont.Assign((Sender as TPanel).Font);
|
||||
tbPreview.ForceRepaint;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneBorderDarkClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Pane.BorderDarkColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkPane.Checked then
|
||||
SetLinkedFrameColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneBorderLightClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Pane.BorderLightColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneCaptionBackgroundClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
tbPreview.Appearance.Pane.CaptionBgColor:=(Sender as TPanel).Color;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneCaptionFontClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeFont(Sender as TPanel) then
|
||||
tbPreview.Appearance.Pane.CaptionFont.Assign((Sender as TPanel).Font);
|
||||
tbPreview.ForceRepaint;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneCaptionFontColorClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Pane.CaptionFont.Color:=((Sender as TPanel).Color);
|
||||
pPaneCaptionFont.Font.color:=((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneGradientFromClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Pane.GradientFromColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkPane.Checked then
|
||||
SetLinkedGradientFromColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.cbPaneGradientKindChange(Sender: TObject);
|
||||
begin
|
||||
case (Sender as TCombobox).ItemIndex of
|
||||
0 : tbPreview.Appearance.Pane.GradientType:=bkSolid;
|
||||
1 : tbPreview.Appearance.Pane.GradientType:=bkHorizontalGradient;
|
||||
2 : tbPreview.Appearance.Pane.GradientType:=bkVerticalGradient;
|
||||
3 : tbPreview.Appearance.Pane.GradientType:=bkConcave;
|
||||
end;
|
||||
|
||||
if cbLinkPane.Checked then
|
||||
SetLinkedGradientKind((Sender as TComboBox).ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pPaneGradientToClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Pane.GradientToColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkPane.Checked then
|
||||
SetLinkedGradientToColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pTabFrameClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Tab.BorderColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkTab.checked then
|
||||
SetLinkedFrameColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pTabGradientFromClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Tab.GradientFromColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkTab.Checked then
|
||||
SetLinkedGradientFromColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pTabGradientToClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Tab.GradientToColor:=(Sender as TPanel).Color;
|
||||
|
||||
if cbLinkTab.Checked then
|
||||
SetLinkedGradientToColor((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pTabHeaderFontClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeFont(Sender as TPanel) then
|
||||
tbPreview.Appearance.Tab.TabHeaderFont.Assign((Sender as TPanel).Font);
|
||||
tbPreview.ForceRepaint;
|
||||
end;
|
||||
|
||||
procedure TfrmAppearanceEditWindow.pTabHeaderFontColorClick(Sender: TObject);
|
||||
begin
|
||||
if ChangeColor(Sender as TPanel) then
|
||||
begin
|
||||
tbPreview.Appearance.Tab.TabHeaderFont.Color:=((Sender as TPanel).Color);
|
||||
pTabHeaderFont.Font.color:=((Sender as TPanel).Color);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
@ -0,0 +1,782 @@
|
||||
object frmEditWindow: TfrmEditWindow
|
||||
Left = 457
|
||||
Top = 186
|
||||
Caption = 'Toolbar contents editor'
|
||||
ClientHeight = 368
|
||||
ClientWidth = 341
|
||||
Color = clBtnFace
|
||||
Font.Charset = DEFAULT_CHARSET
|
||||
Font.Color = clWindowText
|
||||
Font.Height = -11
|
||||
Font.Name = 'Tahoma'
|
||||
Font.Style = []
|
||||
OldCreateOrder = False
|
||||
OnActivate = FormActivate
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
OnShow = FormShow
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 13
|
||||
object tvStructure: TTreeView
|
||||
Left = 0
|
||||
Top = 28
|
||||
Width = 341
|
||||
Height = 340
|
||||
Align = alClient
|
||||
HideSelection = False
|
||||
Images = ilTreeImages
|
||||
Indent = 19
|
||||
MultiSelectStyle = []
|
||||
PopupMenu = pmStructure
|
||||
RightClickSelect = True
|
||||
TabOrder = 0
|
||||
OnChange = tvStructureChange
|
||||
OnEdited = tvStructureEdited
|
||||
OnKeyDown = tvStructureKeyDown
|
||||
ExplicitLeft = 3
|
||||
ExplicitTop = 31
|
||||
end
|
||||
object tbToolBar: TToolBar
|
||||
AlignWithMargins = True
|
||||
Left = 3
|
||||
Top = 3
|
||||
Width = 335
|
||||
Height = 22
|
||||
Caption = 'tbToolBar'
|
||||
DrawingStyle = dsGradient
|
||||
Images = ilActionImages
|
||||
Indent = 4
|
||||
ParentShowHint = False
|
||||
ShowHint = True
|
||||
TabOrder = 1
|
||||
object tbAddTab: TToolButton
|
||||
Left = 4
|
||||
Top = 0
|
||||
Action = aAddTab
|
||||
end
|
||||
object tbRemoveTab: TToolButton
|
||||
Left = 27
|
||||
Top = 0
|
||||
Action = aRemoveTab
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 50
|
||||
Top = 0
|
||||
Width = 8
|
||||
Caption = 'ToolButton3'
|
||||
ImageIndex = 2
|
||||
Style = tbsSeparator
|
||||
end
|
||||
object tbAddPane: TToolButton
|
||||
Left = 58
|
||||
Top = 0
|
||||
Action = aAddPane
|
||||
end
|
||||
object tbRemovePane: TToolButton
|
||||
Left = 81
|
||||
Top = 0
|
||||
Action = aRemovePane
|
||||
end
|
||||
object ToolButton6: TToolButton
|
||||
Left = 104
|
||||
Top = 0
|
||||
Width = 8
|
||||
Caption = 'ToolButton6'
|
||||
ImageIndex = 4
|
||||
Style = tbsSeparator
|
||||
end
|
||||
object tbAddItem: TToolButton
|
||||
Left = 112
|
||||
Top = 0
|
||||
Action = aAddLargeButton
|
||||
DropdownMenu = pmAddItem
|
||||
Style = tbsDropDown
|
||||
end
|
||||
object tbRemoveItem: TToolButton
|
||||
Left = 150
|
||||
Top = 0
|
||||
Action = aRemoveItem
|
||||
end
|
||||
object ToolButton9: TToolButton
|
||||
Left = 173
|
||||
Top = 0
|
||||
Width = 8
|
||||
Caption = 'ToolButton9'
|
||||
ImageIndex = 6
|
||||
Style = tbsSeparator
|
||||
end
|
||||
object tbMoveUp: TToolButton
|
||||
Left = 181
|
||||
Top = 0
|
||||
Action = aMoveUp
|
||||
end
|
||||
object tbMoveDown: TToolButton
|
||||
Left = 204
|
||||
Top = 0
|
||||
Action = aMoveDown
|
||||
end
|
||||
end
|
||||
object ilTreeImages: TImageList
|
||||
Left = 8
|
||||
Top = 32
|
||||
Bitmap = {
|
||||
494C010103000400040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
||||
0000000000003600000028000000400000001000000001002000000000000010
|
||||
000000000000000000000000000000000000F7ECE300F7ECE300F7ECE300F7EC
|
||||
E300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7EC
|
||||
E300F7ECE300F7ECE300F7ECE300F7ECE3000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000F8D2B300F7ECE300F7ECE300F7EC
|
||||
E300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7ECE300F7EC
|
||||
E300F7ECE300F7ECE300F8D2B300ECC2A00000000000D5B49400BC997600BC99
|
||||
7600BC997600BC997600BC997600BC997600BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B4940000000000000000000000000000000000B791
|
||||
6B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B791
|
||||
6B00B7916B000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000EBC59400F8D2B400F6EBE200F7EC
|
||||
E300F7EBE300F7EBE300F6EBE200F7EBE300F6EBE300F6EBE200F6ECE300F7EB
|
||||
E300F7EBE300F8D2B400EBC5940000000000D2AF8E00B9967300FDE8D500FFF0
|
||||
E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E000000000000000000B7916B00FFED
|
||||
DF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000ECC1A000F8EDE500F8ED
|
||||
E500F8EDE400F8EDE500F8EDE500F8EDE500F8EDE500F8EDE500F8EDE500F8EC
|
||||
E500F8EDE500ECC1A0000000000000000000B9947000FDE5D200EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FDE5D200B99470000000000000000000B7916B00FFED
|
||||
DF00F1C9A200F0CAA100F1C9A200F0C9A100F0C9A200F1C9A100F0CAA100F1C9
|
||||
A100FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000E2B28E00F9EFE700F9EE
|
||||
E600F9EFE700F9EFE700F9EEE700F9EEE700F9EFE700F9EFE700F9EEE700F9EF
|
||||
E700F9EEE700E2B28E000000000000000000B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00EEC49C00EEC49C00EEC59C00EEC49B00EEC49B00EEC49B00EEC49B00EFC4
|
||||
9C00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000E2B28E00FAF0E800FAF0
|
||||
E900FAF1E900FAF0E800FAF1E800FBF0E900FAF0E900FAF0E800FAF0E800FAF1
|
||||
E900FAF0E900E2B28E000000000000000000B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00ECBF9600EBBF9600EBBF9600ECBF9600ECBF9600EBBF9600ECBF9500ECBF
|
||||
9600FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000E2B28E00FBF2EB00FBF2
|
||||
EA00FBF1EB00FBF2EB00FBF2EB00FBF2EA00FCF2EB00FBF1EB00FBF1EB00FBF2
|
||||
EB00FBF1EA00E2B28E000000000000000000B7916B00FFEDDF00F2CCA400F2CC
|
||||
A400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CC
|
||||
A400F2CCA400F2CCA400FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00E9B99000E9BA9000E9BA9100E9BA9100E9BA9000E9BA9000E9BA9000E9BA
|
||||
9000FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000E2B28E00FCF3ED00FCF4
|
||||
ED00FDF3ED00FCF3ED00FCF4ED00FCF3ED00FDF3ED00FCF3ED00FCF4ED00FCF3
|
||||
ED00FCF4ED00E2B28E000000000000000000B7916B00FFEDDF00EABF9400EABF
|
||||
9400EABF9400EABF9400EABF9400EABF9400EABF9400EABF9400EABF9400EABF
|
||||
9400EABF9400EABF9400FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00E6B48A00E6B58A00E7B48A00E6B48A00E6B58B00E6B58A00E7B58B00E7B5
|
||||
8A00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000ECC1A000FBEDC600FEF5
|
||||
EF00FDF6EE00FDF5EF00FDF5EF00FEF6EF00FDF6EF00FDF5EF00FDF5EF00FEF5
|
||||
EF00FBEDC600ECC1A0000000000000000000B7916B00FFEDDF00E5B18900E5B1
|
||||
8900E5B18900E5B18900E5B18900E5B18900E5B18900E5B18900E5B18900E5B1
|
||||
8900E5B18900E5B18900FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00E4B08500E4B08500E4AF8500E4B08500E4B08500E4AF8500E4AF8500E4B0
|
||||
8500FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000F8D2B400EBC59400F9EA
|
||||
D900FFF6F000FEF6F000FEF6F000FEF6F000FEF6F000FEF6F000FFF6F000F9EA
|
||||
D900EBC59400F8D2B4000000000000000000B7916B00FFEDDF00E2AC8100E2AC
|
||||
8100E2AC8100E2AC8100E2AC8100E2AC8100E2AC8100E2AC8100E2AC8100E2AC
|
||||
8100E2AC8100E2AC8100FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00E2AC8100E2AC8100E2AC8100E2AC8100E2AC8100E1AC8000E2AC8100E2AC
|
||||
8100FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000F8D2B300ECC2
|
||||
A000E5B89700E5B89700E5B89700E5B89700E5B89700E5B89700E5B89700ECC2
|
||||
A000F8D2B300000000000000000000000000B7916B00FFEDDF00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FFEDDF00B7916B000000000000000000B7916B00FFED
|
||||
DF00E7B68C00E7B68C00E7B68C00E7B68C00E7B68C00E7B68C00E7B68C00E7B6
|
||||
8C00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000B9947000FDE5D200E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FDE5D200B99470000000000000000000B7916B00FFED
|
||||
DF00E9BA9100E9BA9100E9BA9100E9BA9100E9BA9100E9BA9100E9BA9100E9BA
|
||||
9100FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000D2AF8E00B9967300FDE8D500FFF0
|
||||
E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E000000000000000000B7916B00FFED
|
||||
DF00EEC49B00EEC49B00EEC49B00EEC49B00EEC49B00EEC49B00EEC49B00EEC4
|
||||
9B00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000D5B49400BC997600BC99
|
||||
7600BC997600BC997600BC997600BC997600BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B49400000000000000000000000000B7916B00FFED
|
||||
DF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000B791
|
||||
6B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B791
|
||||
6B00B7916B000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000424D3E000000000000003E000000
|
||||
2800000040000000100000000100010000000000800000000000000000000000
|
||||
000000000000000000000000FFFFFF000000FFFFFFFF000000008001E0070000
|
||||
00010000C003000080030000C003000080030000C003000080030000C0030000
|
||||
80030000C003000080030000C003000080030000C003000080030000C0030000
|
||||
C0070000C0030000FFFF0000C0030000FFFF0000C0030000FFFF8001C0030000
|
||||
FFFFFFFFE0070000FFFFFFFFFFFF000000000000000000000000000000000000
|
||||
000000000000}
|
||||
end
|
||||
object ilActionImages: TImageList
|
||||
Left = 40
|
||||
Top = 32
|
||||
Bitmap = {
|
||||
494C010108000C00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
||||
0000000000003600000028000000400000003000000001002000000000000030
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000D0966B000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000000000000000000B791
|
||||
6B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B791
|
||||
6B00B7916B00000000000000000000000000000000000000000000000000B791
|
||||
6B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B791
|
||||
6B00B7916B000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00E8DACE00E8DACE00E8DACE00E8DACE00E7DACE00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000D0966B00F0E6DE00D0966B0000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000B7916B00FFED
|
||||
DF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B0000000000000000000000000000000000B7916B00FFED
|
||||
DF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000D0966B00F0E6DE00F0E6DE00F0E6DE00D0966B00000000000000
|
||||
0000000000000000000000000000000000000000000000000000B7916B00FFED
|
||||
DF00F1C9A200F0CAA100F1C9A200F0C9A100F0C9A200F1C9A100F0CAA100F1C9
|
||||
A100FFEDDF00B7916B0000000000000000000000000000000000B7916B00FFED
|
||||
DF00F1C9A200F0CAA100F1C9A200F0C9A100F0C9A200F1C9A100F0CAA100F1C9
|
||||
A100FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00F0E5DE00F0E5DE00F0E5DE00F0E5DE00F0E5DE00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000B7916B00FFED
|
||||
DF00EEC49C00EEC49C00EEC59C00EEC49B00EEC49B00EEC49B00EEC49B00EFC4
|
||||
9C00FFEDDF00B7916B0000000000000000000000000000000000B7916B00FFED
|
||||
DF00EEC49C00EEC49C00EEC59C00EEC49B00EEC49B00EEC49B00EEC49B00EFC4
|
||||
9C00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
000000000000000000000000000000000000000000000000000000000000D096
|
||||
6B00EEE4DC00EEE4DC00EFE4DC00EEE4DB00EFE4DC00EFE4DC00EFE4DC00D096
|
||||
6B00000000000000000000000000000000000000000000000000B7916B00FFED
|
||||
DF000235CC00EBBF9600EBBF9600ECBF9600ECBF9600EBBF9600ECBF9500ECBF
|
||||
9600FFEDDF00B7916B0000000000000000000000000000000000B7916B00FFED
|
||||
DF00ECBF9600EBBF9600EBBF9600ECBF9600ECBF9600EBBF9600ECBF9500ECBF
|
||||
9600FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00EBDED400EADFD400EADED400EBDED400EBDED400D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000D0966B00EEE3
|
||||
DB00EEE3DB00EEE3DB00EEE3DA00EEE3DB00EEE4DA00EEE3DA00EEE3DA00EEE3
|
||||
DA00D0966B000000000000000000000000000000000000000000B7916B00FFED
|
||||
DF000235CC00E9BA9000E9BA9100E9BA9100E9BA9000E9BA9000E9BA9000E9BA
|
||||
9000FFEDDF00B7916B0000000000000000000000000000000000B7916B00FFED
|
||||
DF00E9B99000E9BA9000E9BA9100E9BA9100E9BA9000E9BA9000E9BA9000E9BA
|
||||
9000FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00ECE0D600ECDFD500ECDFD600ECDFD600ECE0D500D0966B000000
|
||||
00000000000000000000000000000000000000000000D0966B00EDE2D800EDE2
|
||||
D800EDE2D900EDE2D900EDE2D900EDE2D800EDE2D900EDE2D900EDE2D800EDE2
|
||||
D800EDE2D800D0966B000000000000000000000000000468FF00B7916B00FFED
|
||||
DF000235CC00E6B58A00E7B48A000436CD00E6B58B00E6B58A00E7B58B00E7B5
|
||||
8A00FFEDDF00B7916B0000000000000000001A47D200002EC300000D8F00000D
|
||||
8F00E6B48A00000D8F00000D8F00000D8F00000D8F00E6B58A00E7B58B00E7B5
|
||||
8A00FFEDDF00B7916B00000000000000000000000000D0966B00D0966B00D096
|
||||
6B00D0966B00EDE1D700EDE1D700ECE1D700ECE1D700EDE1D700D0966B00D096
|
||||
6B00D0966B00D0966B00000000000000000000000000D0966B00D0966B00D096
|
||||
6B00D0966B00EDE1D700EDE1D700ECE1D700ECE1D700EDE1D700D0966B00D096
|
||||
6B00D0966B00D0966B00000000000000000000000000000000000436CD00FFED
|
||||
DF000235CC00E4B085000267FF00E4B08500E4B08500E4AF8500E4AF8500E4B0
|
||||
8500FFEDDF00B7916B00000000000000000000000000466BDD001947D200000D
|
||||
8F00E4B08500000D8F00001094001C299E00E4B08500E4AF8500E4AF8500E4B0
|
||||
8500FFEDDF00B7916B00000000000000000000000000D0966B00EDE2D800EDE2
|
||||
D800EDE2D900EDE2D900EDE2D900EDE2D800EDE2D900EDE2D900EDE2D800EDE2
|
||||
D800EDE2D800D0966B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00ECE0D600ECDFD500ECDFD600ECDFD600ECE0D500D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000B7916B000267
|
||||
FF000235CC000267FF00E2AC8100E2AC8100E2AC8100E1AC8000E2AC8100E2AC
|
||||
8100FFEDDF00B7916B00000000000000000000000000000000005D7DE3000025
|
||||
B6000012970000159C00001FAC00E2AC8100E2AC8100E1AC8000E2AC8100E2AC
|
||||
8100FFEDDF00B7916B0000000000000000000000000000000000D0966B00EEE3
|
||||
DB00EEE3DB00EEE3DB00EEE3DA00EEE3DB00EEE4DA00EEE3DA00EEE3DA00EEE3
|
||||
DA00D0966B000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00EBDED400EADFD400EADED400EBDED400EBDED400D0966B000000
|
||||
000000000000000000000000000000000000000000000235CC000235CC000033
|
||||
CC0033CCFF000234CC000234CC000234CC00E7B68C00E7B68C00E7B68C00E7B6
|
||||
8C00FFEDDF00B7916B0000000000000000000000000000000000B7916B002752
|
||||
D600002CC0000019A200E7B68C00E7B68C00E7B68C00E7B68C00E7B68C00E7B6
|
||||
8C00FFEDDF00B7916B000000000000000000000000000000000000000000D096
|
||||
6B00EEE4DC00EEE4DC00EFE4DC00EEE4DB00EFE4DC00EFE4DC00EFE4DC00D096
|
||||
6B00000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000B7916B000267
|
||||
FF000235CC000267FF00E9BA9100E9BA9100E9BA9100E9BA9100E9BA9100E9BA
|
||||
9100FFEDDF00B7916B0000000000000000000000000000000000B7916B002F59
|
||||
D8000033CC0000119500E9BA9100E9BA9100E9BA9100E9BA9100E9BA9100E9BA
|
||||
9100FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
0000D0966B00F0E5DE00F0E5DE00F0E5DE00F0E5DE00F0E5DE00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000468FF00FFED
|
||||
DF000235CC00EEC49B000468FF00EEC49B00EEC49B00EEC49B00EEC49B00EEC4
|
||||
9B00FFEDDF00B7916B00000000000000000000000000000000000C3DCF002D57
|
||||
D7002F59D8001242D100000D8F00EEC49B00EEC49B00EEC49B00EEC49B00EEC4
|
||||
9B00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
000000000000D0966B00F0E6DE00F0E6DE00F0E6DE00D0966B00000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
000000000000000000000000000000000000000000000436CD00B7916B00FFED
|
||||
DF000235CC00FFEDDF00FFEDDF000436CD00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B000000000000000000000000002D57D700325BD800355D
|
||||
D900FFEDDF005073E0000020AE00000D8F00FFEDDF00FFEDDF00FFEDDF00FFED
|
||||
DF00FFEDDF00B7916B0000000000000000000000000000000000000000000000
|
||||
00000000000000000000D0966B00F0E6DE00D0966B0000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00E8DACE00E8DACE00E8DACE00E8DACE00E7DACE00D0966B000000
|
||||
000000000000000000000000000000000000000000000000000000000000B791
|
||||
6B000235CC00B7916B00B7916B00B7916B00B7916B00B7916B00B7916B00B791
|
||||
6B00B7916B000000000000000000000000004B6FDF005879E2004E71DF00365E
|
||||
DA00B7916B005C7DE300335CD9000030C700001BA600B7916B00B7916B00B791
|
||||
6B00B7916B000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000D0966B000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000D0966B00D0966B00D0966B00D0966B00D0966B00D0966B00D0966B000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000235CC000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000E8B78F00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E8B78F00D9A37700E8B78F00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9CD00E7D9
|
||||
CD00E7D9CD00E7D9CD00E8B78F00D9A3770000000000D5B49400BC997600BC99
|
||||
7600BC997600BC997600BC997600BC997600BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B494000000000000000000D5B49400BC997600BC99
|
||||
7600BC997600BC997600BC997600BC997600BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B4940000000000D8A76700E8B79100E6D8CC00E7D9
|
||||
CD00E7D8CD00E7D8CD00E6D8CC00E7D8CD00E6D8CD00E6D8CC00E6D9CD00E7D8
|
||||
CD00E7D8CD00E8B79100D8A7670000000000D8A76700E8B79100E6D8CC00E7D9
|
||||
CD00E7D8CD00E7D8CD00E6D8CC00E7D8CD00E6D8CD00E6D8CC00E6D9CD00E7D8
|
||||
CD00E7D8CD00E8B79100D8A7670000000000D2AF8E00B9967300FDE8D500FFF0
|
||||
E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E00D2AF8E00B9967300FDE8D500FFF0
|
||||
E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E0000000000D9A17700E8DAD000E8DA
|
||||
D000E8DACF00E8DAD000E8DAD000E8DAD000E8DAD000E8DAD000E8DAD000E8D9
|
||||
D000E8DAD000D9A17700000000000000000000000000D9A17700E8DAD000E8DA
|
||||
D000E8DACF00E8DAD000E8DAD000E8DAD000E8DAD000E8DAD000E8DAD000E8D9
|
||||
D000E8DAD000D9A177000000000000000000B9947000FDE5D200EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FDE5D200B9947000B9947000FDE5D200EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FDE5D200B994700000000000CC8E6000EADDD300EADC
|
||||
D100EADDD300EADDD300EADCD300EADCD300EADDD300EADDD300EADCD300EADD
|
||||
D300EADCD300CC8E6000000000000000000000000000CC8E6000EADDD300EADC
|
||||
D100EADDD300EADDD300EADCD300EADCD300EADDD300EADDD300EADCD300EADD
|
||||
D300EADCD300CC8E60000000000000000000B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B00B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B0000000000CC8E6000EBDED400EBDE
|
||||
D5000235CC00EBDED400EBDFD400ECDED500EBDED500EBDED400EBDED400EBDF
|
||||
D500EBDED500CC8E6000000000000000000000000000CC8E6000EBDED400EBDE
|
||||
D500EBDFD500EBDED400EBDFD400ECDED500EBDED500EBDED400EBDED400EBDF
|
||||
D500EBDED500CC8E60000000000000000000B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E000235CC00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B00B7916B00FFEDDF00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF6E00EDAF
|
||||
6E00EDAF6E00EDAF6E00FFEDDF00B7916B0000000000CC8E6000ECE1D800ECE1
|
||||
D6000235CC00ECE1D800ECE1D800ECE1D600EEE1D800ECDFD800ECDFD800ECE1
|
||||
D800ECDFD600CC8E6000000000000000000000000000CC8E6000ECE1D800ECE1
|
||||
D600ECDFD800ECE1D800ECE1D800ECE1D600EEE1D800ECDFD800ECDFD800ECE1
|
||||
D800ECDFD600CC8E60000000000000000000B7916B00FFEDDF00F2CCA400F2CC
|
||||
A4000235CC00F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CC
|
||||
A400F2CCA400F2CCA400FFEDDF00B7916B00B7916B00FFEDDF00F2CCA400F2CC
|
||||
A400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CCA400F2CC
|
||||
A400F2CCA400F2CCA400FFEDDF00B7916B00000000000468FF00EEE2DA00EEE3
|
||||
DA000235CC00EEE2DA00EEE3DA000436CD00EFE2DA00EEE2DA00EEE3DA00EEE2
|
||||
DA00EEE3DA00CC8E600000000000000000001A47D200002EC300000D8F00000D
|
||||
8F00EFE2DA00000D8F00000D8F00000D8F00000D8F00EEE2DA00EEE3DA00EEE2
|
||||
DA00EEE3DA00CC8E60000000000000000000B7916B000468FF00EABF9400EABF
|
||||
94000235CC00EABF9400EABF94000436CD00EABF9400EABF9400EABF9400EABF
|
||||
9400EABF9400EABF9400FFEDDF00B7916B001A47D200002EC300000D8F00000D
|
||||
8F00EABF9400000D8F00000D8F00000D8F00000D8F00EABF9400EABF9400EABF
|
||||
9400EABF9400EABF9400FFEDDF00B7916B0000000000D9A177000436CD00F0E5
|
||||
DD000235CC00EFE5DD000267FF00F0E6DD00EFE6DD00EFE5DD00EFE5DD00F0E5
|
||||
DD00ECDAA800D9A17700000000000000000000000000466BDD001947D200000D
|
||||
8F00EFE6DC00000D8F00001094001C299E00EFE6DD00EFE5DD00EFE5DD00F0E5
|
||||
DD00ECDAA800D9A177000000000000000000B7916B00FFEDDF000436CD00E5B1
|
||||
89000235CC00E5B189000267FF00E5B18900E5B18900E5B18900E5B18900E5B1
|
||||
8900E5B18900E5B18900FFEDDF00B7916B00B7916B00466BDD001947D200000D
|
||||
8F00E5B18900000D8F00001094001C299E00E5B18900E5B18900E5B18900E5B1
|
||||
8900E5B18900E5B18900FFEDDF00B7916B0000000000E8B79100D8A767000267
|
||||
FF000235CC000267FF00F0E6DE00F0E6DE00F0E6DE00F0E6DE00F1E6DE00EAD6
|
||||
C000D8A76700E8B79100000000000000000000000000E8B791005D7DE3000025
|
||||
B6000012970000159C00001FAC00F0E6DE00F0E6DE00F0E6DE00F1E6DE00EAD6
|
||||
C000D8A76700E8B791000000000000000000B7916B00FFEDDF00E2AC81000267
|
||||
FF000235CC000267FF00E2AC8100E2AC8100E2AC8100E2AC8100E2AC8100E2AC
|
||||
8100E2AC8100E2AC8100FFEDDF00B7916B00B7916B00FFEDDF005D7DE3000025
|
||||
B6000012970000159C00001FAC00E2AC8100E2AC8100E2AC8100E2AC8100E2AC
|
||||
8100E2AC8100E2AC8100FFEDDF00B7916B00000000000235CC000235CC000033
|
||||
CC0033CCFF000234CC000234CC000234CC00D0966B00D0966B00D0966B00D9A3
|
||||
7700E8B78F000000000000000000000000000000000000000000E8B78F002752
|
||||
D600002CC0000019A200D0966B00D0966B00D0966B00D0966B00D0966B00D9A3
|
||||
7700E8B78F00000000000000000000000000B7916B000235CC000235CC000033
|
||||
CC0033CCFF000234CC000234CC000234CC00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FFEDDF00B7916B00B7916B00FFEDDF00E8B48B002752
|
||||
D600002CC0000019A200E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FFEDDF00B7916B000000000000000000000000000267
|
||||
FF000235CC000267FF0000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000002F59
|
||||
D8000033CC000011950000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000B9947000FDE5D200E8B48B000267
|
||||
FF000235CC000267FF00E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FDE5D200B9947000B9947000FDE5D200E8B48B002F59
|
||||
D8000033CC0000119500E8B48B00E8B48B00E8B48B00E8B48B00E8B48B00E8B4
|
||||
8B00E8B48B00E8B48B00FDE5D200B994700000000000000000000468FF000000
|
||||
00000235CC00000000000468FF00000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000C3DCF002D57
|
||||
D7002F59D8001242D100000D8F00000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000D2AF8E00B99673000468FF00FFF0
|
||||
E2000235CC00FFF0E2000468FF00FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E00D2AF8E00B99673000C3DCF002D57
|
||||
D7002F59D8001242D100000D8F00FFF0E200FFF0E200FFF0E200FFF0E200FFF0
|
||||
E200FFF0E200FDE8D500B9967300D2AF8E00000000000436CD00000000000000
|
||||
00000235CC0000000000000000000436CD000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000002D57D700325BD800355D
|
||||
D900000000005073E0000020AE00000D8F000000000000000000000000000000
|
||||
000000000000000000000000000000000000000000000436CD00BC997600BC99
|
||||
76000235CC00BC997600BC9976000436CD00BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B4940000000000000000002D57D700325BD800355D
|
||||
D900BC9976005073E0000020AE00000D8F00BC997600BC997600BC997600BC99
|
||||
7600BC997600BC997600D5B49400000000000000000000000000000000000000
|
||||
00000235CC000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000004B6FDF005879E2004E71DF00365E
|
||||
DA00000000005C7DE300335CD9000030C700001BA60000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000235CC000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000004B6FDF005879E2004E71DF00365E
|
||||
DA00000000005C7DE300335CD9000030C700001BA60000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000235CC000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000235CC000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
000000000000000000000000000000000000424D3E000000000000003E000000
|
||||
2800000040000000300000000100010000000000800100000000000000000000
|
||||
000000000000000000000000FFFFFF0000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000FFFFFFFFF01FFEFFE007E007F01FFC7F
|
||||
C003C003F01FF83FC003C003FFFFF01FC003C003F01FE00FC003C003F01FC007
|
||||
C003C003F01F80038003000380038003C00380038003F01FC003C003C007F01F
|
||||
8003C003E00FF01FC003C003F01FFFFFC003C003F83FF01F80038003FC7FF01F
|
||||
E0070007FEFFF01FF7FFFFFFFFFFFFFF00000000FFFFFFFF0000000080018001
|
||||
0001000100000000800380030000000080038003000000008003800300000000
|
||||
8003800300000000800300030000000080038003000000008003800300000000
|
||||
8007C00700000000E3FFE3FF00000000D5FFC1FF00000000B6FF88FF80018001
|
||||
F7FF087FF7FF087FF7FFFFFFF7FFFFFF00000000000000000000000000000000
|
||||
000000000000}
|
||||
end
|
||||
object ActionList1: TActionList
|
||||
Images = ilActionImages
|
||||
Left = 72
|
||||
Top = 32
|
||||
object aAddTab: TAction
|
||||
Caption = 'Add tab'
|
||||
Hint = 'Add tab'
|
||||
ImageIndex = 0
|
||||
OnExecute = aAddTabExecute
|
||||
end
|
||||
object aRemoveTab: TAction
|
||||
Caption = 'Remove tab'
|
||||
Hint = 'Remove tab'
|
||||
ImageIndex = 1
|
||||
OnExecute = aRemoveTabExecute
|
||||
end
|
||||
object aAddPane: TAction
|
||||
Caption = 'Add pane'
|
||||
Hint = 'Add pane'
|
||||
ImageIndex = 2
|
||||
OnExecute = aAddPaneExecute
|
||||
end
|
||||
object aRemovePane: TAction
|
||||
Caption = 'Remove pane'
|
||||
Hint = 'Remove pane'
|
||||
ImageIndex = 3
|
||||
OnExecute = aRemovePaneExecute
|
||||
end
|
||||
object aAddSmallButton: TAction
|
||||
Caption = 'SpkSmallButton'
|
||||
Hint = 'Add SmallButton'
|
||||
ImageIndex = 4
|
||||
OnExecute = aAddSmallButtonExecute
|
||||
end
|
||||
object aAddLargeButton: TAction
|
||||
Caption = 'SpkLargeButton'
|
||||
Hint = 'Add SpkLargeButton'
|
||||
ImageIndex = 4
|
||||
OnExecute = aAddLargeButtonExecute
|
||||
end
|
||||
object aRemoveItem: TAction
|
||||
Caption = 'Remove item'
|
||||
Hint = 'Remove item'
|
||||
ImageIndex = 5
|
||||
OnExecute = aRemoveItemExecute
|
||||
end
|
||||
object aMoveUp: TAction
|
||||
Caption = 'Move up'
|
||||
Hint = 'Move item up'
|
||||
ImageIndex = 6
|
||||
OnExecute = aMoveUpExecute
|
||||
end
|
||||
object aMoveDown: TAction
|
||||
Caption = 'Move down'
|
||||
Hint = 'Move item down'
|
||||
ImageIndex = 7
|
||||
OnExecute = aMoveDownExecute
|
||||
end
|
||||
end
|
||||
object pmAddItem: TPopupMenu
|
||||
Left = 8
|
||||
Top = 64
|
||||
object SpkLargeButton1: TMenuItem
|
||||
Action = aAddLargeButton
|
||||
end
|
||||
object SpkSmallButton1: TMenuItem
|
||||
Action = aAddSmallButton
|
||||
end
|
||||
end
|
||||
object pmStructure: TPopupMenu
|
||||
Images = ilActionImages
|
||||
Left = 40
|
||||
Top = 64
|
||||
object Addtab1: TMenuItem
|
||||
Action = aAddTab
|
||||
end
|
||||
object Removetab1: TMenuItem
|
||||
Action = aRemoveTab
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object Addpane1: TMenuItem
|
||||
Action = aAddPane
|
||||
end
|
||||
object Removepane1: TMenuItem
|
||||
Action = aRemovePane
|
||||
end
|
||||
object N2: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object Additem1: TMenuItem
|
||||
Caption = 'Add item'
|
||||
object SpkLargeButton2: TMenuItem
|
||||
Action = aAddLargeButton
|
||||
end
|
||||
object SpkSmallButton2: TMenuItem
|
||||
Action = aAddSmallButton
|
||||
end
|
||||
end
|
||||
object Removeitem1: TMenuItem
|
||||
Action = aRemoveItem
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object Moveup1: TMenuItem
|
||||
Action = aMoveUp
|
||||
end
|
||||
object Movedown1: TMenuItem
|
||||
Action = aMoveDown
|
||||
end
|
||||
end
|
||||
end
|
1174
components/spktoolbar/SpkToolbar - designtime/spkte_EditWindow.pas
Normal file
1485
components/spktoolbar/SpkToolbar/SpkToolbar.pas
Normal file
1171
components/spktoolbar/SpkToolbar/spkt_Appearance.pas
Normal file
154
components/spktoolbar/SpkToolbar/spkt_BaseItem.pas
Normal file
@ -0,0 +1,154 @@
|
||||
unit spkt_BaseItem;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_BaseItem.pas *
|
||||
* Opis: Modu� zawieraj�cy bazow� klas� dla elementu tafli. *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Graphics, Classes, Controls,
|
||||
SpkMath, SpkGUITools, SpkGraphTools,
|
||||
spkt_Appearance, spkt_Exceptions, spkt_Dispatch, spkt_Types;
|
||||
|
||||
type TSpkItemSize = (isLarge, isNormal);
|
||||
TSpkItemTableBehaviour = (tbBeginsRow, tbBeginsColumn, tbContinuesRow);
|
||||
TSpkItemGroupBehaviour = (gbSingleItem, gbBeginsGroup, gbContinuesGroup, gbEndsGroup);
|
||||
|
||||
type TSpkBaseItem = class abstract(TSpkComponent)
|
||||
private
|
||||
protected
|
||||
FRect : T2DIntRect;
|
||||
FToolbarDispatch : TSpkBaseToolbarDispatch;
|
||||
FAppearance : TSpkToolbarAppearance;
|
||||
FImages : TImageList;
|
||||
FDisabledImages : TImageList;
|
||||
FLargeImages : TImageList;
|
||||
FDisabledLargeImages : TImageList;
|
||||
FVisible : boolean;
|
||||
FEnabled : boolean;
|
||||
|
||||
procedure SetVisible(const Value: boolean); virtual;
|
||||
procedure SetEnabled(const Value: boolean); virtual;
|
||||
procedure SetRect(const Value: T2DIntRect); virtual;
|
||||
procedure SetImages(const Value: TImageList); virtual;
|
||||
procedure SetDisabledImages(const Value : TImageList); virtual;
|
||||
procedure SetLargeImages(const Value: TImageList); virtual;
|
||||
procedure SetDisabledLargeImages(const Value: TImageList); virtual;
|
||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
public
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure MouseLeave; virtual; abstract;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer); virtual; abstract;
|
||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual; abstract;
|
||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer); virtual; abstract;
|
||||
|
||||
function GetWidth : integer; virtual; abstract;
|
||||
function GetTableBehaviour : TSpkItemTableBehaviour; virtual; abstract;
|
||||
function GetGroupBehaviour : TSpkItemGroupBehaviour; virtual; abstract;
|
||||
function GetSize : TSpkItemSize; virtual; abstract;
|
||||
procedure Draw(ABuffer : TBitmap; ClipRect : T2DIntRect); virtual; abstract;
|
||||
|
||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write FToolbarDispatch;
|
||||
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
||||
property Images : TImageList read FImages write SetImages;
|
||||
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
||||
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
||||
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
||||
|
||||
property Rect : T2DIntRect read FRect write SetRect;
|
||||
published
|
||||
property Visible : boolean read FVisible write SetVisible;
|
||||
property Enabled : boolean read FEnabled write SetEnabled;
|
||||
end;
|
||||
|
||||
type TSpkBaseItemClass = class of TSpkBaseItem;
|
||||
|
||||
implementation
|
||||
|
||||
{ TSpkBaseItem }
|
||||
|
||||
constructor TSpkBaseItem.Create(AOwner : TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
FRect:=T2DIntRect.create(0, 0, 0, 0);
|
||||
FToolbarDispatch:=nil;
|
||||
FAppearance:=nil;
|
||||
FImages:=nil;
|
||||
FDisabledImages:=nil;
|
||||
FLargeImages:=nil;
|
||||
FDisabledLargeImages:=nil;
|
||||
FVisible:=true;
|
||||
FEnabled:=true;
|
||||
end;
|
||||
|
||||
destructor TSpkBaseItem.Destroy;
|
||||
begin
|
||||
{ Pozosta�e operacje }
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
begin
|
||||
FAppearance := Value;
|
||||
|
||||
if assigned(FToolbarDispatch) then
|
||||
FToolbarDispatch.NotifyMetricsChanged;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetDisabledImages(const Value: TImageList);
|
||||
begin
|
||||
FDisabledImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetDisabledLargeImages(const Value: TImageList);
|
||||
begin
|
||||
FDisabledLargeImages:=Value;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetEnabled(const Value: boolean);
|
||||
begin
|
||||
if Value<>FEnabled then
|
||||
begin
|
||||
FEnabled:=Value;
|
||||
if FToolbarDispatch<>nil then
|
||||
FToolbarDispatch.NotifyVisualsChanged;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetImages(const Value: TImageList);
|
||||
begin
|
||||
FImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetLargeImages(const Value: TImageList);
|
||||
begin
|
||||
FLargeImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetRect(const Value: T2DIntRect);
|
||||
begin
|
||||
FRect := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkBaseItem.SetVisible(const Value: boolean);
|
||||
begin
|
||||
if Value<>FVisible then
|
||||
begin
|
||||
FVisible:=Value;
|
||||
if FToolbarDispatch<>nil then
|
||||
FToolbarDispatch.NotifyMetricsChanged;
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
2022
components/spktoolbar/SpkToolbar/spkt_Buttons.pas
Normal file
190
components/spktoolbar/SpkToolbar/spkt_Const.pas
Normal file
@ -0,0 +1,190 @@
|
||||
unit spkt_Const;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Const.pas *
|
||||
* Opis: Sta�e wykorzystywane do obliczania geometrii toolbara *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
const // ****************
|
||||
// *** Elementy ***
|
||||
// ****************
|
||||
|
||||
LARGEBUTTON_DROPDOWN_FIELD_SIZE = 29;
|
||||
LARGEBUTTON_GLYPH_MARGIN = 1;
|
||||
LARGEBUTTON_CAPTION_HMARGIN = 3;
|
||||
LARGEBUTTON_MIN_WIDTH = 24;
|
||||
LARGEBUTTON_RADIUS = 4;
|
||||
LARGEBUTTON_BORDER_SIZE = 2;
|
||||
LARGEBUTTON_CHEVRON_HMARGIN = 4;
|
||||
LARGEBUTTON_CAPTION_TOP_RAIL = 45;
|
||||
LARGEBUTTON_CAPTION_BOTTOM_RAIL = 58;
|
||||
|
||||
SMALLBUTTON_GLYPH_WIDTH = 16;
|
||||
SMALLBUTTON_BORDER_WIDTH = 2;
|
||||
SMALLBUTTON_HALF_BORDER_WIDTH = 1;
|
||||
SMALLBUTTON_PADDING = 2;
|
||||
SMALLBUTTON_DROPDOWN_WIDTH = 11;
|
||||
SMALLBUTTON_RADIUS = 4;
|
||||
SMALLBUTTON_MIN_WIDTH = 2 * SMALLBUTTON_PADDING + SMALLBUTTON_GLYPH_WIDTH;
|
||||
|
||||
// ********************
|
||||
// *** Obszar tafli ***
|
||||
// ********************
|
||||
|
||||
/// <summary>Maksymalna wysoko�� obszaru, kt�ry mo�e zaj�� zawarto��
|
||||
/// tafli z elementami</summary>
|
||||
MAX_ELEMENT_HEIGHT = 67;
|
||||
|
||||
/// <summary>Wysoko�� pojedynczego wiersza element�w tafli</summary>
|
||||
PANE_ROW_HEIGHT = 22;
|
||||
|
||||
PANE_FULL_ROW_HEIGHT = 3 * PANE_ROW_HEIGHT;
|
||||
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
||||
/// tafl� w przypadku wersji jednowierszowej</summary>
|
||||
PANE_ONE_ROW_TOPPADDING = 22;
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
||||
/// a tafl� w przypadku wersji jednowierszowej</summary>
|
||||
PANE_ONE_ROW_BOTTOMPADDING = 23;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy wierszami w przypadku wersji dwuwierszowej
|
||||
/// </summary>
|
||||
PANE_TWO_ROWS_VSPACER = 7;
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
||||
/// tafl� w przypadku wersji dwuwierszowej</summary>
|
||||
PANE_TWO_ROWS_TOPPADDING = 8;
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
||||
/// a tafl� w przypadku wersji dwuwierszowej</summary>
|
||||
PANE_TWO_ROWS_BOTTOMPADDING = 8;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy wierszami w przypadku wersji
|
||||
/// trzywierszowej</summary>
|
||||
PANE_THREE_ROWS_VSPACER = 0;
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
||||
/// tafl� w przypadku wersji trzywierszowej</summary>
|
||||
PANE_THREE_ROWS_TOPPADDING = 0;
|
||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
||||
/// a tafl� w przypadku wersji trzywierszowej</summary>
|
||||
PANE_THREE_ROWS_BOTTOMPADDING = 1;
|
||||
|
||||
PANE_FULL_ROW_TOPPADDING = PANE_THREE_ROWS_TOPPADDING;
|
||||
|
||||
PANE_FULL_ROW_BOTTOMPADDING = PANE_THREE_ROWS_BOTTOMPADDING;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy lew� kraw�dzi� a pierwszym elementem
|
||||
/// tafli</summary>
|
||||
PANE_LEFT_PADDING = 2;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy ostatnim elementem tafli a praw� kraw�dzi�
|
||||
/// </summary>
|
||||
PANE_RIGHT_PADDING = 2;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy dwoma kolumnami wewn�trz tafli</summary>
|
||||
PANE_COLUMN_SPACER = 4;
|
||||
|
||||
/// <summary>Odleg�o�� pomi�dzy dwoma osobnymi grupami wewn�trz wiersza
|
||||
/// w tafli</summary>
|
||||
PANE_GROUP_SPACER = 4;
|
||||
|
||||
// *************
|
||||
// *** Tafla ***
|
||||
// *************
|
||||
|
||||
/// <summary>Wysoko�� obszaru tytu�u tafli</summary>
|
||||
PANE_CAPTION_HEIGHT = 15;
|
||||
|
||||
PANE_CORNER_RADIUS = 3;
|
||||
|
||||
/// <summary>Szeroko��/wysoko�� ramki tafli</summary>
|
||||
/// <remarks>Nie nale�y zmienia� tej sta�ej!</remarks>
|
||||
PANE_BORDER_SIZE = 2;
|
||||
|
||||
/// <summary>Po�owa szeroko�ci ramki tafli</summary>
|
||||
/// <remarks>Nie nale�y zmienia� tej sta�ej!</remarks>
|
||||
PANE_BORDER_HALF_SIZE = 1;
|
||||
|
||||
/// <summary>Wysoko�� ca�ej tafli (uwzgl�dniaj�c ramk�)</summary>
|
||||
PANE_HEIGHT = MAX_ELEMENT_HEIGHT + PANE_CAPTION_HEIGHT + 2 * PANE_BORDER_SIZE;
|
||||
|
||||
/// <summary>Poziomy margines etykiety zak�adki</summary>
|
||||
PANE_CAPTION_HMARGIN = 6;
|
||||
|
||||
// ***********************
|
||||
// *** Obszar zak�adki ***
|
||||
// ***********************
|
||||
|
||||
/// <summary>Promie� zaokr�glenia zak�adki</summary>
|
||||
TAB_CORNER_RADIUS = 4;
|
||||
|
||||
/// <summary>Lewy wewn�trzny margines zak�adki</summary>
|
||||
TAB_PANE_LEFTPADDING = 2;
|
||||
/// <summary>Prawy wewn�trzny margines zak�adki</summary>
|
||||
TAB_PANE_RIGHTPADDING = 2;
|
||||
/// <summary>G�rny wewn�trzny margines zak�adki</summary>
|
||||
TAB_PANE_TOPPADDING = 2;
|
||||
/// <summary>Dolny wewn�trzny margines zak�adki</summary>
|
||||
TAB_PANE_BOTTOMPADDING = 1;
|
||||
/// <summary>Odleg�o�� pomi�dzy taflami</summary>
|
||||
TAB_PANE_HSPACING = 3;
|
||||
|
||||
/// <summary>Szeroko��/wysoko�� ramki zak�adki (nie nale�y zmienia�!)
|
||||
/// </summary>
|
||||
TAB_BORDER_SIZE = 1;
|
||||
/// <summary>Wysoko�� zak�adki</summary>
|
||||
TAB_HEIGHT = PANE_HEIGHT + TAB_PANE_TOPPADDING + TAB_PANE_BOTTOMPADDING + TAB_BORDER_SIZE;
|
||||
|
||||
// ***************
|
||||
// *** Toolbar ***
|
||||
// ***************
|
||||
|
||||
TOOLBAR_BORDER_WIDTH = 1;
|
||||
|
||||
TOOLBAR_CORNER_RADIUS = 3;
|
||||
|
||||
/// <summary>Wysoko�� etykiet z nazwami zak�adek</summary>
|
||||
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
||||
/// <summary>Poziomy margines wewn�trznego tytu�u zak�adki</summary>
|
||||
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
||||
|
||||
TOOLBAR_MIN_TAB_CAPTION_WIDTH = 32;
|
||||
|
||||
/// <summary>Sumaryczna wysoko�� toolbara</summary>
|
||||
TOOLBAR_HEIGHT = TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
||||
TAB_HEIGHT;
|
||||
|
||||
implementation
|
||||
|
||||
initialization
|
||||
|
||||
{$IFDEF DEBUG}
|
||||
// Sprawdzanie poprawno�ci
|
||||
|
||||
// �uk du�ego przycisku
|
||||
assert(LARGEBUTTON_RADIUS * 2 <= LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
||||
|
||||
// Tafla, wersja z jednym wierszem
|
||||
assert(PANE_ROW_HEIGHT +
|
||||
PANE_ONE_ROW_TOPPADDING +
|
||||
PANE_ONE_ROW_BOTTOMPADDING <= MAX_ELEMENT_HEIGHT);
|
||||
|
||||
// Tafla, wersja z dwoma wierszami
|
||||
assert(2*PANE_ROW_HEIGHT +
|
||||
PANE_TWO_ROWS_TOPPADDING +
|
||||
PANE_TWO_ROWS_VSPACER +
|
||||
PANE_TWO_ROWS_BOTTOMPADDING <= MAX_ELEMENT_HEIGHT);
|
||||
|
||||
// Tafla, wersja z trzema wierszami
|
||||
assert(3*PANE_ROW_HEIGHT +
|
||||
PANE_THREE_ROWS_TOPPADDING +
|
||||
2*PANE_THREE_ROWS_VSPACER +
|
||||
PANE_THREE_ROWS_BOTTOMPADDING <= MAX_ELEMENT_HEIGHT);
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
45
components/spktoolbar/SpkToolbar/spkt_Dispatch.pas
Normal file
@ -0,0 +1,45 @@
|
||||
unit spkt_Dispatch;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Dispatch.pas *
|
||||
* Opis: Bazowe klasy dyspozytor�w po�rednicz�cych pomi�dzy elementami *
|
||||
* toolbara. *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Classes, Controls, Graphics,
|
||||
SpkMath;
|
||||
|
||||
type TSpkBaseDispatch = class abstract(TObject)
|
||||
private
|
||||
protected
|
||||
public
|
||||
end;
|
||||
|
||||
type TSpkBaseAppearanceDispatch = class abstract(TSpkBaseDispatch)
|
||||
private
|
||||
protected
|
||||
public
|
||||
procedure NotifyAppearanceChanged; virtual; abstract;
|
||||
end;
|
||||
|
||||
type TSpkBaseToolbarDispatch = class abstract(TSpkBaseAppearanceDispatch)
|
||||
private
|
||||
protected
|
||||
public
|
||||
procedure NotifyItemsChanged; virtual; abstract;
|
||||
procedure NotifyMetricsChanged; virtual; abstract;
|
||||
procedure NotifyVisualsChanged; virtual; abstract;
|
||||
function GetTempBitmap : TBitmap; virtual; abstract;
|
||||
function ClientToScreen(Point : T2DIntPoint) : T2DIntPoint; virtual; abstract;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
24
components/spktoolbar/SpkToolbar/spkt_Exceptions.pas
Normal file
@ -0,0 +1,24 @@
|
||||
unit spkt_Exceptions;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Exceptions.pas *
|
||||
* Opis: Klasy wyj�tk�w toolbara *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses SysUtils;
|
||||
|
||||
type InternalException = class(Exception);
|
||||
AssignException = class(Exception);
|
||||
RuntimeException = class(Exception);
|
||||
ListException = class(Exception);
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
253
components/spktoolbar/SpkToolbar/spkt_Items.pas
Normal file
@ -0,0 +1,253 @@
|
||||
unit spkt_Items;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Items.pas *
|
||||
* Opis: Modu� zawiera klas� kolekcji element�w tafli. *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Classes, Controls, SysUtils, Dialogs,
|
||||
SpkXMLParser,
|
||||
spkt_Appearance, spkt_Dispatch, spkt_BaseItem, spkt_Exceptions, spkt_Types,
|
||||
spkt_Buttons;
|
||||
|
||||
type TSpkItems = class(TSpkCollection)
|
||||
private
|
||||
FToolbarDispatch : TSpkBaseToolbarDispatch;
|
||||
FAppearance : TSpkToolbarAppearance;
|
||||
FImages : TImageList;
|
||||
FDisabledImages : TImageList;
|
||||
FLargeImages : TImageList;
|
||||
FDisabledLargeImages : TImageList;
|
||||
|
||||
// *** Gettery i settery ***
|
||||
procedure SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
function GetItems(index: integer): TSpkBaseItem; reintroduce;
|
||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
procedure SetImages(const Value: TImageList);
|
||||
procedure SetDisabledImages(const Value : TImageList);
|
||||
procedure SetLargeImages(const Value : TImageList);
|
||||
procedure SetDisabledLargeImages(const Value : TImageList);
|
||||
public
|
||||
// *** Konstruktor, destruktor ***
|
||||
constructor Create(RootComponent : TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function AddLargeButton : TSpkLargeButton;
|
||||
function AddSmallButton : TSpkSmallButton;
|
||||
|
||||
// *** Reakcja na zmiany listy ***
|
||||
procedure Notify(Item: TComponent; Operation : TOperation); override;
|
||||
procedure Update; override;
|
||||
|
||||
property Items[index : integer] : TSpkBaseItem read GetItems; default;
|
||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
||||
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
||||
property Images : TImageList read FImages write SetImages;
|
||||
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
||||
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
||||
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TSpkItems }
|
||||
|
||||
function TSpkItems.AddLargeButton: TSpkLargeButton;
|
||||
|
||||
var Owner, Parent : TComponent;
|
||||
i: Integer;
|
||||
|
||||
begin
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
Owner:=FRootComponent.Owner;
|
||||
Parent:=FRootComponent;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Owner:=nil;
|
||||
Parent:=nil;
|
||||
end;
|
||||
|
||||
result:=TSpkLargeButton.Create(Owner);
|
||||
result.Parent:=Parent;
|
||||
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
i:=1;
|
||||
while FRootComponent.Owner.FindComponent('SpkLargeButton'+inttostr(i))<>nil do
|
||||
inc(i);
|
||||
|
||||
result.Name:='SpkLargeButton'+inttostr(i);
|
||||
end;
|
||||
|
||||
AddItem(result);
|
||||
end;
|
||||
|
||||
function TSpkItems.AddSmallButton: TSpkSmallButton;
|
||||
|
||||
var Owner, Parent : TComponent;
|
||||
i: Integer;
|
||||
|
||||
begin
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
Owner:=FRootComponent.Owner;
|
||||
Parent:=FRootComponent;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Owner:=nil;
|
||||
Parent:=nil;
|
||||
end;
|
||||
|
||||
result:=TSpkSmallButton.Create(Owner);
|
||||
result.Parent:=Parent;
|
||||
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
i:=1;
|
||||
while FRootComponent.Owner.FindComponent('SpkSmallButton'+inttostr(i))<>nil do
|
||||
inc(i);
|
||||
|
||||
result.Name:='SpkSmallButton'+inttostr(i);
|
||||
end;
|
||||
|
||||
AddItem(result);
|
||||
end;
|
||||
|
||||
constructor TSpkItems.Create(RootComponent : TComponent);
|
||||
begin
|
||||
inherited Create(RootComponent);
|
||||
FToolbarDispatch:=nil;
|
||||
FAppearance:=nil;
|
||||
FImages:=nil;
|
||||
FDisabledImages:=nil;
|
||||
FLargeImages:=nil;
|
||||
FDisabledLargeImages:=nil;
|
||||
end;
|
||||
|
||||
destructor TSpkItems.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TSpkItems.GetItems(index: integer): TSpkBaseItem;
|
||||
begin
|
||||
result:=TSpkBaseItem(inherited Items[index]);
|
||||
end;
|
||||
|
||||
procedure TSpkItems.Notify(Item: TComponent;
|
||||
Operation : TOperation);
|
||||
begin
|
||||
inherited Notify(Item, Operation);
|
||||
|
||||
case Operation of
|
||||
opInsert: begin
|
||||
// Ustawienie dyspozytora na nil spowoduje, �e podczas
|
||||
// przypisywania w�asno�ci nie b�d� wo�ane metody Notify*
|
||||
TSpkBaseItem(Item).ToolbarDispatch:=nil;
|
||||
|
||||
TSpkBaseItem(Item).Appearance:=FAppearance;
|
||||
TSpkBaseItem(Item).Images:=FImages;
|
||||
TSpkBaseItem(Item).DisabledImages:=FDisabledImages;
|
||||
TSpkBaseItem(Item).LargeImages:=FLargeImages;
|
||||
TSpkBaseItem(Item).DisabledLargeImages:=FDisabledLargeImages;
|
||||
TSpkBaseItem(Item).ToolbarDispatch:=FToolbarDispatch;
|
||||
end;
|
||||
opRemove: begin
|
||||
if not(csDestroying in Item.ComponentState) then
|
||||
begin
|
||||
TSpkBaseItem(Item).ToolbarDispatch:=nil;
|
||||
TSpkBaseItem(Item).Appearance:=nil;
|
||||
TSpkBaseItem(Item).Images:=nil;
|
||||
TSpkBaseItem(Item).DisabledImages:=nil;
|
||||
TSpkBaseItem(Item).LargeImages:=nil;
|
||||
TSpkBaseItem(Item).DisabledLargeImages:=nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FAppearance := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].Appearance:=FAppearance;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetDisabledImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FDisabledImages := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].DisabledImages:=FDisabledImages;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetDisabledLargeImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FDisabledLargeImages := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].DisabledLargeImages:=FDisabledLargeImages;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FImages := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].Images:=FImages;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetLargeImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FLargeImages := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].LargeImages:=FLargeImages;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
FToolbarDispatch := Value;
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].ToolbarDispatch:=FToolbarDispatch;
|
||||
end;
|
||||
|
||||
procedure TSpkItems.Update;
|
||||
begin
|
||||
inherited Update;
|
||||
|
||||
if assigned(FToolbarDispatch) then
|
||||
FToolbarDispatch.NotifyItemsChanged;
|
||||
end;
|
||||
|
||||
end.
|
1065
components/spktoolbar/SpkToolbar/spkt_Pane.pas
Normal file
805
components/spktoolbar/SpkToolbar/spkt_Tab.pas
Normal file
@ -0,0 +1,805 @@
|
||||
unit spkt_Tab;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Tab.pas *
|
||||
* Opis: Komponent zak�adki toolbara *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Graphics, Controls, Classes, SysUtils,
|
||||
SpkGraphTools, SpkGUITools, SpkMath,
|
||||
spkt_Appearance, spkt_Const, spkt_Dispatch, spkt_Exceptions,
|
||||
spkt_Pane, spkt_Types;
|
||||
|
||||
type TSpkTab = class;
|
||||
|
||||
TSpkMouseTabElementType = (etNone, etTabArea, etPane);
|
||||
|
||||
TSpkMouseTabElement = record
|
||||
ElementType : TSpkMouseTabElementType;
|
||||
ElementIndex : integer;
|
||||
end;
|
||||
|
||||
TSpkTabAppearanceDispatch = class(TSpkBaseAppearanceDispatch)
|
||||
private
|
||||
FTab : TSpkTab;
|
||||
protected
|
||||
public
|
||||
// *** Konstruktor ***
|
||||
constructor Create(ATab : TSpkTab);
|
||||
|
||||
// *** Implementacja metod odziedziczonych po TSpkBaseTabDispatch ***
|
||||
procedure NotifyAppearanceChanged; override;
|
||||
end;
|
||||
|
||||
TSpkTab = class(TSpkComponent)
|
||||
private
|
||||
FAppearanceDispatch : TSpkTabAppearanceDispatch;
|
||||
FAppearance : TSpkToolbarAppearance;
|
||||
|
||||
FMouseHoverElement : TSpkMouseTabElement;
|
||||
FMouseActiveElement : TSpkMouseTabElement;
|
||||
protected
|
||||
FToolbarDispatch : TSpkBaseToolbarDispatch;
|
||||
FCaption : string;
|
||||
FVisible : boolean;
|
||||
FOverrideAppearance : boolean;
|
||||
FCustomAppearance : TSpkToolbarAppearance;
|
||||
|
||||
FPanes : TSpkPanes;
|
||||
FRect : T2DIntRect;
|
||||
|
||||
FImages : TImageList;
|
||||
FDisabledImages : TImageList;
|
||||
FLargeImages : TImageList;
|
||||
FDisabledLargeImages : TImageList;
|
||||
|
||||
// *** Makro ustawia odpowiednie appearance taflom ***
|
||||
procedure SetPaneAppearance; inline;
|
||||
|
||||
// *** Wyszukiwanie tafli ***
|
||||
function FindPaneAt(x, y : integer) : integer;
|
||||
|
||||
// *** Obs�uga designtime i DFM ***
|
||||
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
||||
procedure DefineProperties(Filer : TFiler); override;
|
||||
procedure Loaded; override;
|
||||
|
||||
// *** Gettery i settery ***
|
||||
procedure SetCaption(const Value: string);
|
||||
procedure SetCustomAppearance(const Value: TSpkToolbarAppearance);
|
||||
procedure SetOverrideAppearance(const Value: boolean);
|
||||
procedure SetVisible(const Value: boolean);
|
||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
procedure SetImages(const Value: TImageList);
|
||||
procedure SetDisabledImages(const Value : TImageList);
|
||||
procedure SetLargeImages(const Value : TImageList);
|
||||
procedure SetDisabledLargeImages(const Value : TImageList);
|
||||
procedure SetRect(ARect : T2DIntRect);
|
||||
procedure SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
public
|
||||
// *** Konstruktor, destruktor ***
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
// *** Geometria, obs�uga tafli, rysowanie ***
|
||||
function AtLeastOnePaneVisible: boolean;
|
||||
procedure Draw(ABuffer : TBitmap; AClipRect : T2DIntRect);
|
||||
|
||||
// *** Obs�uga gryzonia ***
|
||||
procedure MouseLeave;
|
||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||
X, Y: Integer);
|
||||
|
||||
// *** Obs�uga zdarze� dyspozytora ***
|
||||
procedure NotifyAppearanceChanged;
|
||||
|
||||
// *** Obs�uga element�w ***
|
||||
procedure FreeingPane(APane : TSpkPane);
|
||||
|
||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
||||
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
||||
|
||||
property Panes : TSpkPanes read FPanes;
|
||||
property Rect : T2DIntRect read FRect write SetRect;
|
||||
property Images : TImageList read FImages write SetImages;
|
||||
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
||||
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
||||
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
||||
published
|
||||
property CustomAppearance : TSpkToolbarAppearance read FCustomAppearance write SetCustomAppearance;
|
||||
property Caption : string read FCaption write SetCaption;
|
||||
property OverrideAppearance : boolean read FOverrideAppearance write SetOverrideAppearance;
|
||||
property Visible : boolean read FVisible write SetVisible;
|
||||
end;
|
||||
|
||||
type TSpkTabs = class(TSpkCollection)
|
||||
private
|
||||
protected
|
||||
FToolbarDispatch : TSpkBaseToolbarDispatch;
|
||||
FAppearance : TSpkToolbarAppearance;
|
||||
FImages : TImageList;
|
||||
FDisabledImages : TImageList;
|
||||
FLargeImages : TImageList;
|
||||
FDisabledLargeImages : TImageList;
|
||||
|
||||
procedure SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
function GetItems(index: integer): TSpkTab; reintroduce;
|
||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
procedure SetImages(const Value: TImageList);
|
||||
procedure SetDisabledImages(const Value : TImageList);
|
||||
procedure SetLargeImages(const Value : TImageList);
|
||||
procedure SetDisabledLargeImages(const Value : TImageList);
|
||||
public
|
||||
constructor Create(RootComponent : TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
function Add : TSpkTab;
|
||||
function Insert(index : integer) : TSpkTab;
|
||||
|
||||
procedure Notify(Item: TComponent; Operation : TOperation); override;
|
||||
procedure Update; override;
|
||||
|
||||
property Items[index : integer] : TSpkTab read GetItems; default;
|
||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
||||
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
||||
property Images : TImageList read FImages write SetImages;
|
||||
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
||||
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
||||
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TSpkTabDispatch }
|
||||
|
||||
constructor TSpkTabAppearanceDispatch.Create(ATab: TSpkTab);
|
||||
begin
|
||||
inherited Create;
|
||||
FTab:=ATab;
|
||||
end;
|
||||
|
||||
procedure TSpkTabAppearanceDispatch.NotifyAppearanceChanged;
|
||||
begin
|
||||
if assigned(FTab) then
|
||||
FTab.NotifyAppearanceChanged;
|
||||
end;
|
||||
|
||||
{ TSpkTab }
|
||||
|
||||
function TSpkTab.AtLeastOnePaneVisible: boolean;
|
||||
|
||||
var i : integer;
|
||||
PaneVisible : boolean;
|
||||
|
||||
begin
|
||||
result:=FPanes.count>0;
|
||||
if result then
|
||||
begin
|
||||
PaneVisible:=false;
|
||||
i:=FPanes.count-1;
|
||||
while (i>=0) and not(PaneVisible) do
|
||||
begin
|
||||
PaneVisible:=FPanes[i].Visible;
|
||||
dec(i);
|
||||
end;
|
||||
result:=result and PaneVisible;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetRect(ARect: T2DIntRect);
|
||||
|
||||
var x, i : integer;
|
||||
tw : integer;
|
||||
tmpRect : T2DIntRect;
|
||||
|
||||
begin
|
||||
FRect:=ARect;
|
||||
|
||||
if AtLeastOnePaneVisible then
|
||||
begin
|
||||
x:=ARect.left;
|
||||
for i := 0 to FPanes.count - 1 do
|
||||
if FPanes[i].Visible then
|
||||
begin
|
||||
tw:=FPanes[i].GetWidth;
|
||||
|
||||
tmpRect.Left:=x;
|
||||
tmpRect.top:=ARect.Top;
|
||||
tmpRect.right:=x + tw - 1;
|
||||
tmpRect.bottom:=ARect.bottom;
|
||||
|
||||
FPanes[i].Rect:=tmpRect;
|
||||
|
||||
x:=x + tw + TAB_PANE_HSPACING;
|
||||
end
|
||||
else
|
||||
begin
|
||||
FPanes[i].Rect:=T2DIntRect.create(-1,-1,-1,-1);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
|
||||
begin
|
||||
FToolbarDispatch := Value;
|
||||
FPanes.ToolbarDispatch:=FToolbarDispatch;
|
||||
end;
|
||||
|
||||
constructor TSpkTab.Create(AOwner : TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
FAppearanceDispatch:=TSpkTabAppearanceDispatch.create(self);
|
||||
FAppearance:=nil;
|
||||
FMouseHoverElement.ElementType:=etNone;
|
||||
FMouseHoverElement.ElementIndex:=-1;
|
||||
FMouseActiveElement.ElementType:=etNone;
|
||||
FMouseActiveElement.ElementIndex:=-1;
|
||||
|
||||
FToolbarDispatch:=nil;
|
||||
FCaption:='Tab';
|
||||
FVisible:=true;
|
||||
FOverrideAppearance:=false;
|
||||
FCustomAppearance:=TSpkToolbarAppearance.Create(FAppearanceDispatch);
|
||||
|
||||
FPanes:=TSpkPanes.Create(self);
|
||||
FPanes.ToolbarDispatch:=FToolbarDispatch;
|
||||
|
||||
FRect:=T2DIntRect.create(0,0,0,0);
|
||||
|
||||
FImages:=nil;
|
||||
FDisabledImages:=nil;
|
||||
FLargeImages:=nil;
|
||||
FDisabledLargeImages:=nil;
|
||||
|
||||
SetPaneAppearance;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.DefineProperties(Filer: TFiler);
|
||||
begin
|
||||
inherited DefineProperties(Filer);
|
||||
|
||||
Filer.DefineProperty('Panes',FPanes.ReadNames,FPanes.WriteNames,true);
|
||||
end;
|
||||
|
||||
destructor TSpkTab.Destroy;
|
||||
begin
|
||||
FPanes.Free;
|
||||
FCustomAppearance.Free;
|
||||
FAppearanceDispatch.Free;
|
||||
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.Draw(ABuffer: TBitmap; AClipRect: T2DIntRect);
|
||||
|
||||
var LocalClipRect : T2DIntRect;
|
||||
i : integer;
|
||||
|
||||
begin
|
||||
if AtLeastOnePaneVisible then
|
||||
for i := 0 to FPanes.Count - 1 do
|
||||
if FPanes[i].visible then
|
||||
begin
|
||||
if AClipRect.IntersectsWith(FPanes[i].Rect, LocalClipRect) then
|
||||
FPanes[i].Draw(ABuffer, LocalClipRect);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TSpkTab.FindPaneAt(x, y: integer): integer;
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
result:=-1;
|
||||
i:=FPanes.count-1;
|
||||
while (i>=0) and (result=-1) do
|
||||
begin
|
||||
if FPanes[i].Visible then
|
||||
begin
|
||||
if FPanes[i].Rect.Contains(T2DIntVector.create(x,y)) then
|
||||
result:=i;
|
||||
end;
|
||||
dec(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.FreeingPane(APane: TSpkPane);
|
||||
begin
|
||||
FPanes.RemoveReference(APane);
|
||||
end;
|
||||
|
||||
procedure TSpkTab.GetChildren(Proc: TGetChildProc; Root: TComponent);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if FPanes.Count>0 then
|
||||
for i := 0 to FPanes.Count - 1 do
|
||||
Proc(FPanes.Items[i]);
|
||||
end;
|
||||
|
||||
procedure TSpkTab.Loaded;
|
||||
begin
|
||||
inherited;
|
||||
|
||||
if FPanes.ListState = lsNeedsProcessing then
|
||||
FPanes.ProcessNames(self.Owner);
|
||||
end;
|
||||
|
||||
procedure TSpkTab.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
|
||||
Y: Integer);
|
||||
begin
|
||||
if FMouseActiveElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseActiveElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseActiveElement.ElementIndex].MouseDown(Button, Shift, X, Y);
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etNone then
|
||||
begin
|
||||
if FMouseHoverElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseHoverElement.ElementIndex<>-1 then
|
||||
begin
|
||||
FMouseActiveElement.ElementType:=etPane;
|
||||
FMouseActiveElement.ElementIndex:=FMouseHoverElement.ElementIndex;
|
||||
|
||||
FPanes[FMouseHoverElement.ElementIndex].MouseDown(Button, Shift, X, Y);
|
||||
end
|
||||
else
|
||||
begin
|
||||
FMouseActiveElement.ElementType:=etTabArea;
|
||||
FMouseActiveElement.ElementIndex:=-1;
|
||||
end;
|
||||
end else
|
||||
if FMouseHoverElement.ElementType = etTabArea then
|
||||
begin
|
||||
FMouseActiveElement.ElementType:=etTabArea;
|
||||
FMouseActiveElement.ElementIndex:=-1;
|
||||
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.MouseLeave;
|
||||
begin
|
||||
if FMouseActiveElement.ElementType = etNone then
|
||||
begin
|
||||
if FMouseHoverElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseHoverElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseHoverElement.ElementIndex].MouseLeave;
|
||||
end else
|
||||
if FMouseHoverElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end;
|
||||
end;
|
||||
|
||||
FMouseHoverElement.ElementType:=etNone;
|
||||
FMouseHoverElement.ElementIndex:=-1;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.MouseMove(Shift: TShiftState; X, Y: Integer);
|
||||
|
||||
var i : integer;
|
||||
NewMouseHoverElement : TSpkMouseTabElement;
|
||||
|
||||
begin
|
||||
// Szukamy obiektu pod mysz�
|
||||
i:=FindPaneAt(x, y);
|
||||
if i<>-1 then
|
||||
begin
|
||||
NewMouseHoverElement.ElementType:=etPane;
|
||||
NewMouseHoverElement.ElementIndex:=i;
|
||||
end else
|
||||
if (X>=FRect.left) and (Y>=FRect.top) and
|
||||
(X<=FRect.right) and (Y<=FRect.bottom) then
|
||||
begin
|
||||
NewMouseHoverElement.ElementType:=etTabArea;
|
||||
NewMouseHoverElement.ElementIndex:=-1;
|
||||
end else
|
||||
begin
|
||||
NewMouseHoverElement.ElementType:=etNone;
|
||||
NewMouseHoverElement.ElementIndex:=-1;
|
||||
end;
|
||||
|
||||
if FMouseActiveElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseActiveElement.ElementIndex<>-1 then
|
||||
begin
|
||||
FPanes[FMouseActiveElement.ElementIndex].MouseMove(Shift, X, Y);
|
||||
end;
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etNone then
|
||||
begin
|
||||
// Je�li element pod mysz� si� zmienia, informujemy poprzedni element o
|
||||
// tym, �e mysz opuszcza jego obszar
|
||||
if (NewMouseHoverElement.ElementType<>FMouseHoverElement.ElementType) or
|
||||
(NewMouseHoverElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
||||
begin
|
||||
if FMouseHoverElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseHoverElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseHoverElement.ElementIndex].MouseLeave;
|
||||
end else
|
||||
if FMouseHoverElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
||||
end;
|
||||
end;
|
||||
|
||||
if NewMouseHoverElement.ElementType = etPane then
|
||||
begin
|
||||
if NewMouseHoverElement.ElementIndex<>-1 then
|
||||
FPanes[NewMouseHoverElement.ElementIndex].MouseMove(Shift, X, Y);
|
||||
end else
|
||||
if NewMouseHoverElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
||||
end;
|
||||
end;
|
||||
|
||||
FMouseHoverElement:=NewMouseHoverElement;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
|
||||
Y: Integer);
|
||||
|
||||
var ClearActive : boolean;
|
||||
|
||||
begin
|
||||
ClearActive:=not(ssLeft in Shift) and not(ssMiddle in Shift) and not(ssRight in Shift);
|
||||
|
||||
if FMouseActiveElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseActiveElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseActiveElement.ElementIndex].MouseUp(Button, Shift, X, Y);
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end;
|
||||
|
||||
if ClearActive and
|
||||
(FMouseActiveElement.ElementType<>FMouseHoverElement.ElementType) or
|
||||
(FMouseActiveElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
||||
begin
|
||||
if FMouseActiveElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseActiveElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseActiveElement.ElementIndex].MouseLeave;
|
||||
end else
|
||||
if FMouseActiveElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end;
|
||||
|
||||
if FMouseHoverElement.ElementType = etPane then
|
||||
begin
|
||||
if FMouseHoverElement.ElementIndex<>-1 then
|
||||
FPanes[FMouseHoverElement.ElementIndex].MouseMove(Shift, X, Y);
|
||||
end else
|
||||
if FMouseHoverElement.ElementType = etTabArea then
|
||||
begin
|
||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
||||
end;
|
||||
end;
|
||||
|
||||
if ClearActive then
|
||||
begin
|
||||
FMouseActiveElement.ElementType:=etNone;
|
||||
FMouseActiveElement.ElementIndex:=-1;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.NotifyAppearanceChanged;
|
||||
begin
|
||||
if assigned(FToolbarDispatch) then
|
||||
FToolbarDispatch.NotifyAppearanceChanged;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetCustomAppearance(const Value: TSpkToolbarAppearance);
|
||||
begin
|
||||
FCustomAppearance.assign(Value);
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetDisabledImages(const Value: TImageList);
|
||||
begin
|
||||
FDisabledImages := Value;
|
||||
FPanes.DisabledImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetDisabledLargeImages(const Value: TImageList);
|
||||
begin
|
||||
FDisabledLargeImages := Value;
|
||||
FPanes.DisabledLargeImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetImages(const Value: TImageList);
|
||||
begin
|
||||
FImages := Value;
|
||||
FPanes.Images := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetLargeImages(const Value: TImageList);
|
||||
begin
|
||||
FLargeImages := Value;
|
||||
FPanes.LargeImages := Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
begin
|
||||
FAppearance:=Value;
|
||||
|
||||
SetPaneAppearance;
|
||||
|
||||
if FToolbarDispatch<>nil then
|
||||
FToolbarDispatch.NotifyMetricsChanged;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetCaption(const Value: string);
|
||||
begin
|
||||
FCaption := Value;
|
||||
if assigned(FToolbarDispatch) then
|
||||
FToolbarDispatch.NotifyMetricsChanged;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetOverrideAppearance(const Value: boolean);
|
||||
begin
|
||||
FOverrideAppearance := Value;
|
||||
|
||||
SetPaneAppearance;
|
||||
|
||||
if FToolbarDispatch<>nil then
|
||||
FToolbarDispatch.NotifyMetricsChanged;
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetPaneAppearance;
|
||||
begin
|
||||
if FOverrideAppearance then
|
||||
FPanes.Appearance:=FCustomAppearance else
|
||||
FPanes.Appearance:=FAppearance;
|
||||
|
||||
// Metoda pe�ni rol� makra - dlatego nie powiadamia dyspozytora o zmianie.
|
||||
end;
|
||||
|
||||
procedure TSpkTab.SetVisible(const Value: boolean);
|
||||
begin
|
||||
FVisible := Value;
|
||||
if FToolbarDispatch<>nil then
|
||||
FToolbarDispatch.NotifyItemsChanged;
|
||||
end;
|
||||
|
||||
{ TSpkTabs }
|
||||
|
||||
function TSpkTabs.Add: TSpkTab;
|
||||
|
||||
var Owner, Parent : TComponent;
|
||||
i: Integer;
|
||||
|
||||
begin
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
Owner:=FRootComponent.Owner;
|
||||
Parent:=FRootComponent;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Owner:=nil;
|
||||
Parent:=nil;
|
||||
end;
|
||||
|
||||
result:=TSpkTab.create(Owner);
|
||||
result.Parent:=Parent;
|
||||
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
i:=1;
|
||||
while FRootComponent.Owner.FindComponent('SpkTab'+inttostr(i))<>nil do
|
||||
inc(i);
|
||||
|
||||
result.Name:='SpkTab'+inttostr(i);
|
||||
end;
|
||||
|
||||
AddItem(result);
|
||||
end;
|
||||
|
||||
constructor TSpkTabs.Create(RootComponent : TComponent);
|
||||
begin
|
||||
inherited Create(RootComponent);
|
||||
FToolbarDispatch:=nil;
|
||||
FAppearance:=nil;
|
||||
FImages:=nil;
|
||||
FDisabledImages:=nil;
|
||||
FLargeImages:=nil;
|
||||
FDisabledLargeImages:=nil;
|
||||
end;
|
||||
|
||||
destructor TSpkTabs.Destroy;
|
||||
begin
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
function TSpkTabs.GetItems(index: integer): TSpkTab;
|
||||
begin
|
||||
result:=TSpkTab(inherited Items[index]);
|
||||
end;
|
||||
|
||||
function TSpkTabs.Insert(index: integer): TSpkTab;
|
||||
|
||||
var Owner, Parent : TComponent;
|
||||
i: Integer;
|
||||
|
||||
begin
|
||||
if (index<0) or (index>=self.Count) then
|
||||
raise InternalException.create('TSpkTabs.Insert: Nieprawid�owy indeks!');
|
||||
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
Owner:=FRootComponent.Owner;
|
||||
Parent:=FRootComponent;
|
||||
end
|
||||
else
|
||||
begin
|
||||
Owner:=nil;
|
||||
Parent:=nil;
|
||||
end;
|
||||
|
||||
result:=TSpkTab.create(Owner);
|
||||
result.Parent:=Parent;
|
||||
|
||||
if FRootComponent<>nil then
|
||||
begin
|
||||
i:=1;
|
||||
while FRootComponent.Owner.FindComponent('SpkTab'+inttostr(i))<>nil do
|
||||
inc(i);
|
||||
|
||||
result.Name:='SpkTab'+inttostr(i);
|
||||
end;
|
||||
InsertItem(index, result);
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.Notify(Item: TComponent;
|
||||
Operation : TOperation);
|
||||
begin
|
||||
inherited Notify(Item, Operation);
|
||||
|
||||
case Operation of
|
||||
opInsert: begin
|
||||
// Ustawienie dyspozytora na nil spowoduje, �e podczas
|
||||
// przypisywania w�asno�ci nie b�d� wo�ane metody Notify*
|
||||
TSpkTab(Item).ToolbarDispatch:=nil;
|
||||
|
||||
TSpkTab(Item).Appearance:=self.FAppearance;
|
||||
TSpkTab(Item).Images:=self.FImages;
|
||||
TSpkTab(Item).DisabledImages:=self.FDisabledImages;
|
||||
TSpkTab(Item).LargeImages:=self.FLargeImages;
|
||||
TSpkTab(Item).DisabledLargeImages:=self.FDisabledLargeImages;
|
||||
TSpkTab(Item).ToolbarDispatch:=self.FToolbarDispatch;
|
||||
end;
|
||||
opRemove: begin
|
||||
if not(csDestroying in Item.ComponentState) then
|
||||
begin
|
||||
TSpkTab(Item).ToolbarDispatch:=nil;
|
||||
TSpkTab(Item).Appearance:=nil;
|
||||
TSpkTab(Item).Images:=nil;
|
||||
TSpkTab(Item).DisabledImages:=nil;
|
||||
TSpkTab(Item).LargeImages:=nil;
|
||||
TSpkTab(Item).DisabledLargeImages:=nil;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FAppearance := Value;
|
||||
|
||||
if self.count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
self.Items[i].Appearance:=FAppearance;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetDisabledImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FDisabledImages := Value;
|
||||
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].DisabledImages:=Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetDisabledLargeImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FDisabledLargeImages := Value;
|
||||
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].DisabledLargeImages:=Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FImages := Value;
|
||||
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].Images:=Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetLargeImages(const Value: TImageList);
|
||||
|
||||
var i: Integer;
|
||||
|
||||
begin
|
||||
FLargeImages := Value;
|
||||
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
Items[i].LargeImages:=Value;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.SetToolbarDispatch(const Value: TSpkBaseToolbarDispatch);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
FToolbarDispatch := Value;
|
||||
|
||||
if self.Count>0 then
|
||||
for i := 0 to self.count - 1 do
|
||||
self.Items[i].ToolbarDispatch:=FToolbarDispatch;
|
||||
end;
|
||||
|
||||
procedure TSpkTabs.Update;
|
||||
begin
|
||||
inherited Update;
|
||||
|
||||
if assigned(FToolbarDispatch) then
|
||||
FToolbarDispatch.NotifyItemsChanged;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
RegisterClass(TSpkTab);
|
||||
|
||||
finalization
|
||||
|
||||
UnRegisterClass(TSpkTab);
|
||||
|
||||
end.
|
196
components/spktoolbar/SpkToolbar/spkt_Tools.pas
Normal file
@ -0,0 +1,196 @@
|
||||
unit spkt_Tools;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Tools.pas *
|
||||
* Opis: Klasy narz�dziowe u�atwiaj�ce renderowanie toolbara. *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Graphics, SysUtils,
|
||||
SpkMath, SpkGraphTools, SpkGUITools;
|
||||
|
||||
type TButtonTools = class sealed(TObject)
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure DrawButton(Bitmap : TBitmap;
|
||||
Rect : T2DIntRect;
|
||||
FrameColor,
|
||||
InnerLightColor,
|
||||
InnerDarkColor,
|
||||
GradientFrom,
|
||||
GradientTo : TColor;
|
||||
GradientKind : TBackgroundKind;
|
||||
LeftEdgeOpen,
|
||||
RightEdgeOpen,
|
||||
TopEdgeOpen,
|
||||
BottomEdgeOpen : boolean;
|
||||
Radius : integer;
|
||||
ClipRect : T2DIntRect);
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TButtonTools }
|
||||
|
||||
class procedure TButtonTools.DrawButton(Bitmap: TBitmap;
|
||||
Rect: T2DIntRect; FrameColor, InnerLightColor, InnerDarkColor, GradientFrom,
|
||||
GradientTo: TColor; GradientKind: TBackgroundKind; LeftEdgeOpen,
|
||||
RightEdgeOpen, TopEdgeOpen, BottomEdgeOpen: boolean; Radius: integer;
|
||||
ClipRect : T2DIntRect);
|
||||
|
||||
var x1, x2, y1, y2 : integer;
|
||||
LeftClosed, TopClosed, RightClosed, BottomClosed : byte;
|
||||
|
||||
begin
|
||||
if (Rect.Width<6) or (Rect.Height<6) or
|
||||
(Rect.Width < 2*radius) or (Rect.Height < 2*Radius) then
|
||||
exit;
|
||||
|
||||
if LeftEdgeOpen then LeftClosed:=0 else LeftClosed:=1;
|
||||
if RightEdgeOpen then RightClosed:=0 else RightClosed:=1;
|
||||
if TopEdgeOpen then TopClosed:=0 else TopClosed:=1;
|
||||
if BottomEdgeOpen then BottomClosed:=0 else BottomClosed:=1;
|
||||
|
||||
TGuiTools.DrawRoundRect(Bitmap.Canvas,
|
||||
Rect,
|
||||
Radius,
|
||||
GradientFrom,
|
||||
GradientTo,
|
||||
GradientKind,
|
||||
ClipRect,
|
||||
not(LeftEdgeOpen or TopEdgeOpen),
|
||||
not(RightEdgeOpen or TopEdgeOpen),
|
||||
not(LeftEdgeOpen or BottomEdgeOpen),
|
||||
not(RightEdgeOpen or BottomEdgeOpen));
|
||||
|
||||
// Wewn�trzna kraw�d�
|
||||
// *** G�ra ***
|
||||
x1:=Rect.Left + radius * TopClosed * LeftClosed + LeftClosed;
|
||||
x2:=Rect.Right - radius * TopClosed * RightClosed - RightClosed;
|
||||
y1:=Rect.Top + TopClosed;
|
||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, InnerLightColor, ClipRect);
|
||||
|
||||
// *** D�� ***
|
||||
x1:=Rect.Left + radius * BottomClosed * LeftClosed + LeftClosed;
|
||||
x2:=Rect.Right - radius * BottomClosed * RightClosed - RightClosed;
|
||||
y1:=Rect.Bottom - BottomClosed;
|
||||
if BottomEdgeOpen then
|
||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, InnerDarkColor, ClipRect) else
|
||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, InnerLightColor, ClipRect);
|
||||
|
||||
// *** Lewo ***
|
||||
y1:=Rect.Top + Radius * LeftClosed * TopClosed + TopClosed;
|
||||
y2:=Rect.Bottom - Radius * LeftClosed * BottomClosed - BottomClosed;
|
||||
x1:=Rect.Left + LeftClosed;
|
||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerLightColor, ClipRect);
|
||||
|
||||
// *** Prawo ***
|
||||
y1:=Rect.Top + Radius * RightClosed * TopClosed + TopClosed;
|
||||
y2:=Rect.Bottom - Radius * RightClosed * BottomClosed - BottomClosed;
|
||||
x1:=Rect.Right - RightClosed;
|
||||
if RightEdgeOpen then
|
||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerDarkColor, ClipRect) else
|
||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerLightColor, ClipRect);
|
||||
|
||||
// Zaokr�glone naro�niki
|
||||
if not(LeftEdgeOpen or TopEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.left + 1, Rect.Top + 1),
|
||||
Radius,
|
||||
cpLeftTop,
|
||||
InnerLightColor,
|
||||
ClipRect);
|
||||
if not(RightEdgeOpen or TopEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.right - radius, Rect.Top + 1),
|
||||
Radius,
|
||||
cpRightTop,
|
||||
InnerLightColor,
|
||||
ClipRect);
|
||||
if not(LeftEdgeOpen or BottomEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.left + 1, Rect.bottom - radius),
|
||||
Radius,
|
||||
cpLeftBottom,
|
||||
InnerLightColor,
|
||||
ClipRect);
|
||||
if not(RightEdgeOpen or BottomEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.right - radius, Rect.bottom - radius),
|
||||
Radius,
|
||||
cpRightBottom,
|
||||
InnerLightColor,
|
||||
ClipRect);
|
||||
|
||||
// Zewn�trzna kraw�d�
|
||||
// Zaokr�glone naro�niki
|
||||
if not(TopEdgeOpen) then
|
||||
begin
|
||||
x1:=Rect.Left + Radius * LeftClosed;
|
||||
x2:=Rect.Right - Radius * RightClosed;
|
||||
y1:=Rect.Top;
|
||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, FrameColor, ClipRect);
|
||||
end;
|
||||
|
||||
if not(BottomEdgeOpen) then
|
||||
begin
|
||||
x1:=Rect.Left + Radius * LeftClosed;
|
||||
x2:=Rect.Right - Radius * RightClosed;
|
||||
y1:=Rect.Bottom;
|
||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, FrameColor, ClipRect);
|
||||
end;
|
||||
|
||||
if not(LeftEdgeOpen) then
|
||||
begin
|
||||
y1:=Rect.Top + Radius * TopClosed;
|
||||
y2:=Rect.Bottom - Radius * BottomClosed;
|
||||
x1:=Rect.Left;
|
||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, FrameColor, ClipRect);
|
||||
end;
|
||||
|
||||
if not(RightEdgeOpen) then
|
||||
begin
|
||||
y1:=Rect.Top + Radius * TopClosed;
|
||||
y2:=Rect.Bottom - Radius * BottomClosed;
|
||||
x1:=Rect.Right;
|
||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, FrameColor, ClipRect);
|
||||
end;
|
||||
|
||||
if not(LeftEdgeOpen or TopEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.left, Rect.Top),
|
||||
Radius,
|
||||
cpLeftTop,
|
||||
FrameColor,
|
||||
ClipRect);
|
||||
if not(RightEdgeOpen or TopEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.right - radius + 1, Rect.Top),
|
||||
Radius,
|
||||
cpRightTop,
|
||||
FrameColor,
|
||||
ClipRect);
|
||||
if not(LeftEdgeOpen or BottomEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.left, Rect.bottom - radius + 1),
|
||||
Radius,
|
||||
cpLeftBottom,
|
||||
FrameColor,
|
||||
ClipRect);
|
||||
if not(RightEdgeOpen or BottomEdgeOpen) then
|
||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||
T2DIntPoint.create(Rect.right - radius + 1, Rect.bottom - radius + 1),
|
||||
Radius,
|
||||
cpRightBottom,
|
||||
FrameColor,
|
||||
ClipRect);
|
||||
end;
|
||||
|
||||
end.
|
302
components/spktoolbar/SpkToolbar/spkt_Types.pas
Normal file
@ -0,0 +1,302 @@
|
||||
unit spkt_Types;
|
||||
|
||||
(*******************************************************************************
|
||||
* *
|
||||
* Plik: spkt_Types.pas *
|
||||
* Opis: Definicje typ�w u�ywanych podczas pracy toolbara *
|
||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
||||
* prawa autorskiego! *
|
||||
* *
|
||||
*******************************************************************************)
|
||||
|
||||
interface
|
||||
|
||||
uses Windows, Controls, Classes, ContNrs, SysUtils, Dialogs,
|
||||
spkt_Exceptions;
|
||||
|
||||
type TSpkListState = (lsNeedsProcessing, lsReady);
|
||||
|
||||
type TSpkComponent = class(TComponent)
|
||||
private
|
||||
protected
|
||||
FParent : TComponent;
|
||||
|
||||
// *** Gettery i settery ***
|
||||
function GetParent: TComponent;
|
||||
procedure SetParent(const Value: TComponent);
|
||||
public
|
||||
// *** Konstruktor ***
|
||||
constructor Create(AOwner : TComponent); override;
|
||||
|
||||
// *** Obs�uga parenta ***
|
||||
function HasParent : boolean; override;
|
||||
function GetParentComponent : TComponent; override;
|
||||
procedure SetParentComponent(Value : TComponent); override;
|
||||
|
||||
property Parent : TComponent read GetParent write SetParent;
|
||||
end;
|
||||
|
||||
type TSpkCollection = class(TPersistent)
|
||||
private
|
||||
protected
|
||||
FList : TObjectList;
|
||||
FNames : TStringList;
|
||||
FListState : TSpkListState;
|
||||
FRootComponent : TComponent;
|
||||
|
||||
// *** Metody reakcji na zmiany w li�cie ***
|
||||
procedure Notify(Item : TComponent; Operation : TOperation); virtual;
|
||||
procedure Update; virtual;
|
||||
|
||||
// *** Wewn�trzne metody dodawania i wstawiania element�w ***
|
||||
procedure AddItem(AItem : TComponent);
|
||||
procedure InsertItem(index : integer; AItem : TComponent);
|
||||
|
||||
// *** Gettery i settery ***
|
||||
function GetItems(index: integer): TComponent; virtual;
|
||||
public
|
||||
// *** Konstruktor, destruktor ***
|
||||
constructor Create(RootComponent : TComponent); reintroduce; virtual;
|
||||
destructor Destroy; override;
|
||||
|
||||
// *** Obs�uga listy ***
|
||||
procedure Clear;
|
||||
function Count : integer;
|
||||
procedure Delete(index : integer); virtual;
|
||||
function IndexOf(Item : TComponent) : integer;
|
||||
procedure Remove(Item : TComponent); virtual;
|
||||
procedure RemoveReference(Item : TComponent);
|
||||
procedure Exchange(item1, item2 : integer);
|
||||
procedure Move(IndexFrom, IndexTo : integer);
|
||||
|
||||
// *** Reader, writer i obs�uga designtime i DFM ***
|
||||
procedure WriteNames(Writer : TWriter); virtual;
|
||||
procedure ReadNames(Reader : TReader); virtual;
|
||||
procedure ProcessNames(Owner : TComponent); virtual;
|
||||
|
||||
property ListState : TSpkListState read FListState;
|
||||
property Items[index : integer] : TComponent read GetItems; default;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
{ TSpkCollection }
|
||||
|
||||
procedure TSpkCollection.AddItem(AItem: TComponent);
|
||||
begin
|
||||
// Ta metoda mo�e by� wywo�ywana bez przetworzenia nazw (w szczeg�lno�ci, metoda
|
||||
// przetwarzaj�ca nazwy korzysta z AddItem)
|
||||
|
||||
Notify(AItem, opInsert);
|
||||
FList.Add(AItem);
|
||||
|
||||
Update;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Clear;
|
||||
begin
|
||||
FList.Clear;
|
||||
|
||||
Update;
|
||||
end;
|
||||
|
||||
function TSpkCollection.Count: integer;
|
||||
begin
|
||||
result:=FList.Count;
|
||||
end;
|
||||
|
||||
constructor TSpkCollection.Create(RootComponent : TComponent);
|
||||
begin
|
||||
inherited Create;
|
||||
FRootComponent:=RootComponent;
|
||||
|
||||
FNames:=TStringList.create;
|
||||
|
||||
FList:=TObjectList.Create;
|
||||
FList.OwnsObjects:=true;
|
||||
|
||||
FListState:=lsReady;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Delete(index: integer);
|
||||
begin
|
||||
if (index<0) or (index>=FList.count) then
|
||||
raise InternalException.Create('TSpkCollection.Delete: Nieprawid�owy indeks!');
|
||||
|
||||
Notify(TComponent(FList[index]), opRemove);
|
||||
|
||||
FList.Delete(index);
|
||||
|
||||
Update;
|
||||
end;
|
||||
|
||||
destructor TSpkCollection.Destroy;
|
||||
begin
|
||||
FNames.Free;
|
||||
FList.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Exchange(item1, item2: integer);
|
||||
begin
|
||||
FList.Exchange(item1, item2);
|
||||
Update;
|
||||
end;
|
||||
|
||||
function TSpkCollection.GetItems(index: integer): TComponent;
|
||||
begin
|
||||
if (index<0) or (index>=FList.Count) then
|
||||
raise InternalException.create('TSpkCollection.GetItems: Nieprawid�owy indeks!');
|
||||
|
||||
result:=TComponent(FList[index]);
|
||||
end;
|
||||
|
||||
function TSpkCollection.IndexOf(Item: TComponent): integer;
|
||||
begin
|
||||
result:=FList.IndexOf(Item);
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.InsertItem(index: integer; AItem: TComponent);
|
||||
begin
|
||||
if (index<0) or (index>FList.Count) then
|
||||
raise InternalException.Create('TSpkCollection.Insert: Nieprawid�owy indeks!');
|
||||
|
||||
Notify(AItem, opInsert);
|
||||
|
||||
FList.Insert(index, AItem);
|
||||
|
||||
Update;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Move(IndexFrom, IndexTo: integer);
|
||||
begin
|
||||
if (indexFrom<0) or (indexFrom>=FList.Count) or
|
||||
(indexTo<0) or (indexTo>=FList.Count) then
|
||||
raise InternalException.Create('TSpkCollection.Move: Nieprawid�owy indeks!');
|
||||
|
||||
FList.Move(IndexFrom, IndexTo);
|
||||
|
||||
Update;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Notify(Item: TComponent; Operation: TOperation);
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.ProcessNames(Owner : TComponent);
|
||||
|
||||
var s : string;
|
||||
|
||||
begin
|
||||
FList.Clear;
|
||||
|
||||
if Owner<>nil then
|
||||
for s in FNames do
|
||||
AddItem(Owner.FindComponent(s));
|
||||
|
||||
FNames.Clear;
|
||||
FListState:=lsReady;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.ReadNames(Reader: TReader);
|
||||
|
||||
begin
|
||||
Reader.ReadListBegin;
|
||||
|
||||
FNames.Clear;
|
||||
while not(Reader.EndOfList) do
|
||||
FNames.Add(Reader.ReadString);
|
||||
|
||||
Reader.ReadListEnd;
|
||||
|
||||
FListState:=lsNeedsProcessing;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Remove(Item: TComponent);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
i:=FList.IndexOf(Item);
|
||||
|
||||
if i>=0 then
|
||||
begin
|
||||
Notify(Item, opRemove);
|
||||
|
||||
FList.Delete(i);
|
||||
|
||||
Update;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.RemoveReference(Item: TComponent);
|
||||
|
||||
var i : integer;
|
||||
|
||||
begin
|
||||
i:=FList.IndexOf(Item);
|
||||
|
||||
if i>=0 then
|
||||
begin
|
||||
Notify(Item, opRemove);
|
||||
|
||||
FList.Extract(Item);
|
||||
|
||||
Update;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.Update;
|
||||
begin
|
||||
//
|
||||
end;
|
||||
|
||||
procedure TSpkCollection.WriteNames(Writer: TWriter);
|
||||
|
||||
var Item : pointer;
|
||||
|
||||
begin
|
||||
Writer.WriteListBegin;
|
||||
|
||||
for Item in FList do
|
||||
Writer.WriteString(TComponent(Item).Name);
|
||||
|
||||
Writer.WriteListEnd;
|
||||
end;
|
||||
|
||||
{ TSpkComponent }
|
||||
|
||||
constructor TSpkComponent.Create(AOwner: TComponent);
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
FParent:=nil;
|
||||
end;
|
||||
|
||||
function TSpkComponent.GetParent: TComponent;
|
||||
begin
|
||||
result:=GetParentComponent;
|
||||
end;
|
||||
|
||||
function TSpkComponent.GetParentComponent: TComponent;
|
||||
begin
|
||||
result:=FParent;
|
||||
end;
|
||||
|
||||
function TSpkComponent.HasParent: boolean;
|
||||
begin
|
||||
result:=FParent<>nil;
|
||||
end;
|
||||
|
||||
procedure TSpkComponent.SetParent(const Value: TComponent);
|
||||
begin
|
||||
SetParentComponent(Value);
|
||||
end;
|
||||
|
||||
procedure TSpkComponent.SetParentComponent(Value: TComponent);
|
||||
begin
|
||||
FParent:=Value;
|
||||
end;
|
||||
|
||||
end.
|