You've already forked lazarus-ccr
* converted source files to utf-8
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1693 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,10 +1,10 @@
|
|||||||
unit SpkGuiTools;
|
unit SpkGuiTools;
|
||||||
|
|
||||||
{$DEFINE SPKGUITOOLS}
|
{$DEFINE SPKGUITOOLS}
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{$MESSAGE HINT 'W tym module konsekwentnie ka�dy rect opisuje dok�adny prostok�t (a nie, jak w przypadku WINAPI - bez dolnej i prawej kraw�dzi)'}
|
{$MESSAGE HINT 'W tym module konsekwentnie ka¿dy rect opisuje dok³adny prostok¹t (a nie, jak w przypadku WINAPI - bez dolnej i prawej krawêdzi)'}
|
||||||
|
|
||||||
uses Windows, Graphics, SysUtils, Math, Classes, Controls, ImgList,
|
uses Windows, Graphics, SysUtils, Math, Classes, Controls, ImgList,
|
||||||
SpkGraphTools, SpkMath;
|
SpkGraphTools, SpkMath;
|
||||||
@ -387,9 +387,9 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -417,7 +417,7 @@ Offset:=DstPoint - SrcPoint;
|
|||||||
|
|
||||||
if not(OrgSrcRect.IntersectsWith(OrgDstRect - Offset, SrcRect)) then exit;
|
if not(OrgSrcRect.IntersectsWith(OrgDstRect - Offset, SrcRect)) then exit;
|
||||||
|
|
||||||
// Ustalamy pozycj� �rodka �uku
|
// Ustalamy pozycjê œrodka ³uku
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(SrcPoint.x, SrcPoint.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(SrcPoint.x, SrcPoint.y + Radius - 1);
|
||||||
@ -476,9 +476,9 @@ class procedure TGUITools.CopyRoundRect(ABuffer, ABitmap: TBitmap; SrcPoint,
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyBackground: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyBackground: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzamy poprawno��
|
// Sprawdzamy poprawnoϾ
|
||||||
if Radius<0 then
|
if Radius<0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -487,8 +487,8 @@ if (Radius>Width div 2) or (Radius>Height div 2) then exit;
|
|||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
{$REGION 'Wype�niamy prostok�ty'}
|
{$REGION 'Wype³niamy prostok¹ty'}
|
||||||
// G�ra
|
// Góra
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
||||||
@ -496,7 +496,7 @@ CopyRectangle(ABuffer,
|
|||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius,
|
radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
// D��
|
// Dó³
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
@ -504,7 +504,7 @@ CopyRectangle(ABuffer,
|
|||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius,
|
radius,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
// �rodek
|
// Œrodek
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
||||||
@ -514,9 +514,9 @@ CopyRectangle(ABuffer,
|
|||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
// Wype�niamy naro�niki
|
// Wype³niamy naro¿niki
|
||||||
|
|
||||||
{$REGION 'Lewy g�rny'}
|
{$REGION 'Lewy górny'}
|
||||||
if LeftTopRound then
|
if LeftTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
@ -535,7 +535,7 @@ else
|
|||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'Prawy g�rny'}
|
{$REGION 'Prawy górny'}
|
||||||
if RightTopRound then
|
if RightTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
@ -599,9 +599,9 @@ class procedure TGUITools.CopyRoundRect(ABuffer : TBitmap; ABitmap: TBitmap; Src
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyBackground: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyBackground: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzamy poprawno��
|
// Sprawdzamy poprawnoϾ
|
||||||
if Radius<0 then
|
if Radius<0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -610,22 +610,22 @@ if (Radius>Width div 2) or (Radius>Height div 2) then exit;
|
|||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
{$REGION 'Wype�niamy prostok�ty'}
|
{$REGION 'Wype³niamy prostok¹ty'}
|
||||||
// G�ra
|
// Góra
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y),
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius);
|
radius);
|
||||||
// D��
|
// Dó³
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
T2DIntPoint.create(SrcPoint.x + radius, SrcPoint.y + height - radius),
|
||||||
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
T2DIntPoint.create(DstPoint.x + radius, DstPoint.y + height - radius),
|
||||||
width - 2*radius,
|
width - 2*radius,
|
||||||
radius);
|
radius);
|
||||||
// �rodek
|
// Œrodek
|
||||||
CopyRectangle(ABuffer,
|
CopyRectangle(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
T2DIntPoint.create(SrcPoint.x, SrcPoint.y + radius),
|
||||||
@ -634,8 +634,8 @@ CopyRectangle(ABuffer,
|
|||||||
height - 2*radius);
|
height - 2*radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
// Wype�niamy naro�niki
|
// Wype³niamy naro¿niki
|
||||||
{$REGION 'Lewy g�rny'}
|
{$REGION 'Lewy górny'}
|
||||||
if LeftTopRound then
|
if LeftTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
@ -652,7 +652,7 @@ else
|
|||||||
Radius);
|
Radius);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'Prawy g�rny'}
|
{$REGION 'Prawy górny'}
|
||||||
if RightTopRound then
|
if RightTopRound then
|
||||||
TGUITools.CopyRoundCorner(ABuffer,
|
TGUITools.CopyRoundCorner(ABuffer,
|
||||||
ABitmap,
|
ABitmap,
|
||||||
@ -717,16 +717,16 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if (Width<1) or (Height<1) then
|
if (Width<1) or (Height<1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
// Przycinamy �r�d�owy rect do obszaru �r�d�owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
@ -743,14 +743,14 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
|
||||||
// Liczymy offset �r�d�owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
|
|
||||||
// Sprawdzamy, czy na�o�one na siebie recty: �r�d�owy i docelowy przesuni�ty o
|
// Sprawdzamy, czy na³o¿one na siebie recty: Ÿród³owy i docelowy przesuniêty o
|
||||||
// offset maj� jak�� cz��� wsp�ln�
|
// offset maj¹ jak¹œ czêœæ wspóln¹
|
||||||
if not(SrcRect.IntersectsWith(DstRect - Offset, ClippedSrcRect)) then exit;
|
if not(SrcRect.IntersectsWith(DstRect - Offset, ClippedSrcRect)) then exit;
|
||||||
|
|
||||||
// Je�li jest cokolwiek do przetworzenia, wykonaj operacj�
|
// Jeœli jest cokolwiek do przetworzenia, wykonaj operacjê
|
||||||
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
||||||
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
||||||
begin
|
begin
|
||||||
@ -791,12 +791,12 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
if (AMask.PixelFormat<>pf8bit) then
|
if (AMask.PixelFormat<>pf8bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 8-bitowe maski s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 8-bitowe maski s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if (Width<1) or (Height<1) then
|
if (Width<1) or (Height<1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -806,7 +806,7 @@ if (ABuffer.width=0) or (ABuffer.height=0) or
|
|||||||
if (ABuffer.Width<>AMask.Width) or
|
if (ABuffer.Width<>AMask.Width) or
|
||||||
(ABuffer.Height<>AMask.Height) then exit;
|
(ABuffer.Height<>AMask.Height) then exit;
|
||||||
|
|
||||||
// Przycinamy �r�d�owy rect do obszaru �r�d�owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
|
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
@ -823,14 +823,14 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
DstPoint.y+Height-1),
|
DstPoint.y+Height-1),
|
||||||
DstRect)) then exit;
|
DstRect)) then exit;
|
||||||
|
|
||||||
// Liczymy offset �r�d�owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
|
|
||||||
// Sprawdzamy, czy na�o�one na siebie recty: �r�d�owy i docelowy przesuni�ty o
|
// Sprawdzamy, czy na³o¿one na siebie recty: Ÿród³owy i docelowy przesuniêty o
|
||||||
// offset maj� jak�� cz��� wsp�ln�
|
// offset maj¹ jak¹œ czêœæ wspóln¹
|
||||||
if not(SrcRect.IntersectsWith(DstRect - Offset, ClippedSrcRect)) then exit;
|
if not(SrcRect.IntersectsWith(DstRect - Offset, ClippedSrcRect)) then exit;
|
||||||
|
|
||||||
// Je�li jest cokolwiek do przetworzenia, wykonaj operacj�
|
// Jeœli jest cokolwiek do przetworzenia, wykonaj operacjê
|
||||||
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
||||||
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
||||||
begin
|
begin
|
||||||
@ -871,11 +871,11 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyMaskRectangle: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyMaskRectangle: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
if AMask.PixelFormat<>pf8bit then
|
if AMask.PixelFormat<>pf8bit then
|
||||||
raise exception.create('TSpkGUITools.CopyMaskRectangle: Tylko 8-bitowe maski s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyMaskRectangle: Tylko 8-bitowe maski s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if (Width<1) or (Height<1) then
|
if (Width<1) or (Height<1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -884,9 +884,9 @@ if (ABuffer.width=0) or (ABuffer.height=0) or
|
|||||||
|
|
||||||
if (ABuffer.Width<>AMask.Width) or
|
if (ABuffer.Width<>AMask.Width) or
|
||||||
(ABuffer.Height<>AMask.Height) then
|
(ABuffer.Height<>AMask.Height) then
|
||||||
raise exception.create('TSpkGUITools.CopyMaskRectangle: Maska ma nieprawid�owe rozmiary!');
|
raise exception.create('TSpkGUITools.CopyMaskRectangle: Maska ma nieprawid³owe rozmiary!');
|
||||||
|
|
||||||
// Przycinamy �r�d�owy rect do obszaru �r�d�owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
SrcPoint.y,
|
SrcPoint.y,
|
||||||
@ -906,14 +906,14 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
// Liczymy offset �r�d�owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
|
|
||||||
// Sprawdzamy, czy na�o�one na siebie recty: �r�d�owy i docelowy przesuni�ty o
|
// Sprawdzamy, czy na³o¿one na siebie recty: Ÿród³owy i docelowy przesuniêty o
|
||||||
// offset maj� jak�� cz��� wsp�ln�
|
// offset maj¹ jak¹œ czêœæ wspóln¹
|
||||||
if not(SrcRect.IntersectsWith(ClippedDstRect - Offset, ClippedSrcRect)) then exit;
|
if not(SrcRect.IntersectsWith(ClippedDstRect - Offset, ClippedSrcRect)) then exit;
|
||||||
|
|
||||||
// Je�li jest cokolwiek do przetworzenia, wykonaj operacj�
|
// Jeœli jest cokolwiek do przetworzenia, wykonaj operacjê
|
||||||
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
||||||
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
||||||
begin
|
begin
|
||||||
@ -951,16 +951,16 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if (Width<1) or (Height<1) then
|
if (Width<1) or (Height<1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if (ABuffer.width=0) or (ABuffer.height=0) or
|
if (ABuffer.width=0) or (ABuffer.height=0) or
|
||||||
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
(ABitmap.width=0) or (ABitmap.height=0) then exit;
|
||||||
|
|
||||||
// Przycinamy �r�d�owy rect do obszaru �r�d�owej bitmapy
|
// Przycinamy Ÿród³owy rect do obszaru Ÿród³owej bitmapy
|
||||||
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
BufferRect:=T2DIntRect.create(0, 0, ABuffer.width-1, ABuffer.height-1);
|
||||||
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
if not(BufferRect.IntersectsWith(T2DIntRect.create(SrcPoint.x,
|
||||||
SrcPoint.y,
|
SrcPoint.y,
|
||||||
@ -980,14 +980,14 @@ if not(BitmapRect.IntersectsWith(T2DIntRect.create(DstPoint.x,
|
|||||||
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
if not(DstRect.IntersectsWith(ClipRect, ClippedDstRect)) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
// Liczymy offset �r�d�owego do docelowego recta
|
// Liczymy offset Ÿród³owego do docelowego recta
|
||||||
Offset:=DstPoint - SrcPoint;
|
Offset:=DstPoint - SrcPoint;
|
||||||
|
|
||||||
// Sprawdzamy, czy na�o�one na siebie recty: �r�d�owy i docelowy przesuni�ty o
|
// Sprawdzamy, czy na³o¿one na siebie recty: Ÿród³owy i docelowy przesuniêty o
|
||||||
// offset maj� jak�� cz��� wsp�ln�
|
// offset maj¹ jak¹œ czêœæ wspóln¹
|
||||||
if not(SrcRect.IntersectsWith(ClippedDstRect - Offset, ClippedSrcRect)) then exit;
|
if not(SrcRect.IntersectsWith(ClippedDstRect - Offset, ClippedSrcRect)) then exit;
|
||||||
|
|
||||||
// Je�li jest cokolwiek do przetworzenia, wykonaj operacj�
|
// Jeœli jest cokolwiek do przetworzenia, wykonaj operacjê
|
||||||
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
if (ClippedSrcRect.left<=ClippedSrcRect.right) and (ClippedSrcRect.top<=ClippedSrcRect.bottom) then
|
||||||
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
for y := ClippedSrcRect.top to ClippedSrcRect.bottom do
|
||||||
begin
|
begin
|
||||||
@ -1018,9 +1018,9 @@ var BufferRect, BitmapRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
if (ABuffer.PixelFormat<>pf24bit) or (ABitmap.PixelFormat<>pf24bit) then
|
||||||
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s� akceptowane!');
|
raise exception.create('TSpkGUITools.CopyRoundCorner: Tylko 24-bitowe bitmapy s¹ akceptowane!');
|
||||||
|
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -1045,7 +1045,7 @@ Offset:=DstPoint - SrcPoint;
|
|||||||
|
|
||||||
if not(OrgSrcRect.IntersectsWith(OrgDstRect - Offset, SrcRect)) then exit;
|
if not(OrgSrcRect.IntersectsWith(OrgDstRect - Offset, SrcRect)) then exit;
|
||||||
|
|
||||||
// Ustalamy pozycj� �rodka �uku
|
// Ustalamy pozycjê œrodka ³uku
|
||||||
|
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(SrcPoint.x + radius - 1, SrcPoint.y + Radius - 1);
|
||||||
@ -1114,30 +1114,30 @@ var CornerRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TSpkGUITools.DrawAARoundCorner: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TSpkGUITools.DrawAARoundCorner: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
// Sprawdzamy poprawno��
|
// Sprawdzamy poprawnoϾ
|
||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
if (ABitmap.width=0) or (ABitmap.height=0) then
|
if (ABitmap.width=0) or (ABitmap.height=0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// �r�d�owy rect...
|
// ród³owy rect...
|
||||||
OrgCornerRect:=T2DIntRect.create(Point.x,
|
OrgCornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
Point.x + radius - 1,
|
Point.x + radius - 1,
|
||||||
Point.y + radius - 1);
|
Point.y + radius - 1);
|
||||||
|
|
||||||
// ...przycinamy do rozmiar�w bitmapy
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.intersectsWith(OrgCornerRect, CornerRect)) then
|
if not(BitmapRect.intersectsWith(OrgCornerRect, CornerRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Je�li nie ma czego rysowa�, wychodzimy
|
// Jeœli nie ma czego rysowaæ, wychodzimy
|
||||||
if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Szukamy �rodka �uku - zale�nie od rodzaju naro�nika
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
||||||
@ -1185,21 +1185,21 @@ var CornerRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TSpkGUITools.DrawAARoundCorner: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TSpkGUITools.DrawAARoundCorner: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
// Sprawdzamy poprawno��
|
// Sprawdzamy poprawnoϾ
|
||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
if (ABitmap.width=0) or (ABitmap.height=0) then
|
if (ABitmap.width=0) or (ABitmap.height=0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// �r�d�owy rect...
|
// ród³owy rect...
|
||||||
OrgCornerRect:=T2DIntRect.create(Point.x,
|
OrgCornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
Point.x + radius - 1,
|
Point.x + radius - 1,
|
||||||
Point.y + radius - 1);
|
Point.y + radius - 1);
|
||||||
|
|
||||||
// ...przycinamy do rozmiar�w bitmapy
|
// ...przycinamy do rozmiarów bitmapy
|
||||||
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
BitmapRect:=T2DIntRect.create(0, 0, ABitmap.width-1, ABitmap.height-1);
|
||||||
if not(BitmapRect.intersectsWith(OrgCornerRect, UnClippedCornerRect)) then
|
if not(BitmapRect.intersectsWith(OrgCornerRect, UnClippedCornerRect)) then
|
||||||
exit;
|
exit;
|
||||||
@ -1208,11 +1208,11 @@ if not(BitmapRect.intersectsWith(OrgCornerRect, UnClippedCornerRect)) then
|
|||||||
if not(UnClippedCornerRect.IntersectsWith(ClipRect, CornerRect)) then
|
if not(UnClippedCornerRect.IntersectsWith(ClipRect, CornerRect)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Je�li nie ma czego rysowa�, wychodzimy
|
// Jeœli nie ma czego rysowaæ, wychodzimy
|
||||||
if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
if (CornerRect.left>CornerRect.right) or (CornerRect.top>CornerRect.bottom) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Szukamy �rodka �uku - zale�nie od rodzaju naro�nika
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
||||||
@ -1253,17 +1253,17 @@ var Center : T2DIntVector;
|
|||||||
CornerRect: T2DIntRect;
|
CornerRect: T2DIntRect;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Sprawdzamy poprawno��
|
// Sprawdzamy poprawnoϾ
|
||||||
if Radius<1 then
|
if Radius<1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// �r�d�owy rect...
|
// ród³owy rect...
|
||||||
CornerRect:=T2DIntRect.create(Point.x,
|
CornerRect:=T2DIntRect.create(Point.x,
|
||||||
Point.y,
|
Point.y,
|
||||||
Point.x + radius - 1,
|
Point.x + radius - 1,
|
||||||
Point.y + radius - 1);
|
Point.y + radius - 1);
|
||||||
|
|
||||||
// Szukamy �rodka �uku - zale�nie od rodzaju naro�nika
|
// Szukamy œrodka ³uku - zale¿nie od rodzaju naro¿nika
|
||||||
case CornerPos of
|
case CornerPos of
|
||||||
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
cpLeftTop: Center:=T2DIntVector.create(Point.x + radius - 1, Point.y + Radius - 1);
|
||||||
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
cpRightTop: Center:=T2DIntVector.create(Point.x, Point.y + Radius - 1);
|
||||||
@ -1296,7 +1296,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1307,7 +1307,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawAARoundCorner(ACanvas, Point, Radius, CornerPos, Color);
|
DrawAARoundCorner(ACanvas, Point, Radius, CornerPos, Color);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -1316,7 +1316,7 @@ class procedure TGUITools.DrawAARoundFrame(ABitmap: TBitmap; Rect: T2DIntRect;
|
|||||||
Radius: integer; Color: TColor; ClipRect: T2DIntRect);
|
Radius: integer; Color: TColor; ClipRect: T2DIntRect);
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawAARoundFrame: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawAARoundFrame: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if (Radius<1) then
|
if (Radius<1) then
|
||||||
exit;
|
exit;
|
||||||
@ -1333,7 +1333,7 @@ DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bot
|
|||||||
ABitmap.Canvas.Pen.color:=Color;
|
ABitmap.Canvas.Pen.color:=Color;
|
||||||
ABitmap.Canvas.pen.style:=psSolid;
|
ABitmap.Canvas.pen.style:=psSolid;
|
||||||
|
|
||||||
// Draw*Line s� zabezpieczone przed rysowaniem poza obszarem
|
// Draw*Line s¹ zabezpieczone przed rysowaniem poza obszarem
|
||||||
DrawVLine(ABitmap, Rect.left, rect.top + Radius, rect.bottom - Radius, Color, ClipRect);
|
DrawVLine(ABitmap, Rect.left, rect.top + Radius, rect.bottom - Radius, Color, ClipRect);
|
||||||
DrawVLine(ABitmap, Rect.right, rect.top + Radius, rect.bottom - Radius, Color, ClipRect);
|
DrawVLine(ABitmap, Rect.right, rect.top + Radius, rect.bottom - Radius, Color, ClipRect);
|
||||||
DrawHLine(ABitmap, Rect.left + Radius, Rect.right - Radius, rect.top, Color, ClipRect);
|
DrawHLine(ABitmap, Rect.left + Radius, Rect.right - Radius, rect.top, Color, ClipRect);
|
||||||
@ -1345,7 +1345,7 @@ class procedure TGUITools.DrawAARoundFrame(ABitmap: TBitmap; Rect: T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawAARoundFrame: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawAARoundFrame: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if (Radius<1) then
|
if (Radius<1) then
|
||||||
exit;
|
exit;
|
||||||
@ -1362,7 +1362,7 @@ DrawAARoundCorner(ABitmap, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bot
|
|||||||
ABitmap.canvas.Pen.color:=Color;
|
ABitmap.canvas.Pen.color:=Color;
|
||||||
ABitmap.canvas.pen.style:=psSolid;
|
ABitmap.canvas.pen.style:=psSolid;
|
||||||
|
|
||||||
// Draw*Line s� zabezpieczone przed rysowaniem poza obszarem
|
// Draw*Line s¹ zabezpieczone przed rysowaniem poza obszarem
|
||||||
DrawVLine(ABitmap, Rect.left, rect.top + Radius, rect.bottom - Radius, Color);
|
DrawVLine(ABitmap, Rect.left, rect.top + Radius, rect.bottom - Radius, Color);
|
||||||
DrawVLine(ABitmap, Rect.right, rect.top + Radius, rect.bottom - Radius, Color);
|
DrawVLine(ABitmap, Rect.right, rect.top + Radius, rect.bottom - Radius, Color);
|
||||||
DrawHLine(ABitmap, Rect.left + Radius, Rect.right - Radius, rect.top, Color);
|
DrawHLine(ABitmap, Rect.left + Radius, Rect.right - Radius, rect.top, Color);
|
||||||
@ -1380,7 +1380,7 @@ with ABitmap.Canvas do
|
|||||||
begin
|
begin
|
||||||
s:=AText;
|
s:=AText;
|
||||||
tw:=TextWidth(s);
|
tw:=TextWidth(s);
|
||||||
// Je�li tekst si� zmie�ci, rysujemy
|
// Jeœli tekst siê zmieœci, rysujemy
|
||||||
if tw<=(x2-x1+1) then
|
if tw<=(x2-x1+1) then
|
||||||
case Align of
|
case Align of
|
||||||
taLeftJustify : TextOut(x1,y,AText);
|
taLeftJustify : TextOut(x1,y,AText);
|
||||||
@ -1426,7 +1426,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1437,7 +1437,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawHLine(ACanvas, x1, x2, y, Color);
|
DrawHLine(ACanvas, x1, x2, y, Color);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -1463,7 +1463,7 @@ var UseOrgClipRgn: Boolean;
|
|||||||
ClipRgn: HRGN;
|
ClipRgn: HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1486,7 +1486,7 @@ var UseOrgClipRgn: Boolean;
|
|||||||
ClipRgn: HRGN;
|
ClipRgn: HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1536,7 +1536,7 @@ while MarkPos>0 do
|
|||||||
begin
|
begin
|
||||||
if MarkPos>1 then
|
if MarkPos>1 then
|
||||||
begin
|
begin
|
||||||
// Rysowanie tekstu przed wyr��nionym
|
// Rysowanie tekstu przed wyró¿nionym
|
||||||
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
ACanvas.Font.Style:=ACanvas.Font.Style - [fsBold];
|
||||||
s:=copy(DrawText, 1, MarkPos-1);
|
s:=copy(DrawText, 1, MarkPos-1);
|
||||||
|
|
||||||
@ -1547,7 +1547,7 @@ while MarkPos>0 do
|
|||||||
delete(BaseText, 1, MarkPos-1);
|
delete(BaseText, 1, MarkPos-1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Rysowanie wyr��nionego tekstu
|
// Rysowanie wyró¿nionego tekstu
|
||||||
ACanvas.Font.Style:=ACanvas.Font.Style + [fsBold];
|
ACanvas.Font.Style:=ACanvas.Font.Style + [fsBold];
|
||||||
s:=copy(DrawText, 1, MarkTextLength);
|
s:=copy(DrawText, 1, MarkTextLength);
|
||||||
|
|
||||||
@ -1628,7 +1628,7 @@ var LineRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawHLine: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawHLine: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if x2<x1 then
|
if x2<x1 then
|
||||||
begin
|
begin
|
||||||
@ -1657,7 +1657,7 @@ var OrgLineRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawHLine: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawHLine: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if x2<x1 then
|
if x2<x1 then
|
||||||
begin
|
begin
|
||||||
@ -1711,7 +1711,7 @@ var UseOrgClipRgn: Boolean;
|
|||||||
OrgRgn: HRGN;
|
OrgRgn: HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
SelectClipRgn(ACanvas.Handle, Region);
|
SelectClipRgn(ACanvas.Handle, Region);
|
||||||
|
|
||||||
@ -1728,7 +1728,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1739,7 +1739,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawRegion(ACanvas, Region, Rect, ColorFrom, ColorTo, GradientKind);
|
DrawRegion(ACanvas, Region, Rect, ColorFrom, ColorTo, GradientKind);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -1754,7 +1754,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -1765,7 +1765,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawRoundRect(ACanvas, Rect, Radius, ColorFrom, ColorTo, GradientKind, LeftTopRound, RightTopRound, LeftBottomRound, RightBottomRound);
|
DrawRoundRect(ACanvas, Rect, Radius, ColorFrom, ColorTo, GradientKind, LeftTopRound, RightTopRound, LeftBottomRound, RightBottomRound);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -1812,7 +1812,7 @@ if Radius<1 then
|
|||||||
if (Radius*2>Rect.width) or (Radius*2>Rect.height) then
|
if (Radius*2>Rect.width) or (Radius*2>Rect.height) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
if not(LeftTopRound) and not(RightTopRound) and not(LeftBottomRound) and not (RightBottomRound) then
|
if not(LeftTopRound) and not(RightTopRound) and not(LeftBottomRound) and not (RightBottomRound) then
|
||||||
@ -1862,7 +1862,7 @@ ColorTo:=ColorToRGB(ColorTo);
|
|||||||
|
|
||||||
FillGradientRectangle(ACanvas, Rect, ColorFrom, ColorTo, GradientKind);
|
FillGradientRectangle(ACanvas, Rect, ColorFrom, ColorTo, GradientKind);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(RoundRgn);
|
DeleteObject(RoundRgn);
|
||||||
end;
|
end;
|
||||||
@ -1914,7 +1914,7 @@ with ABitmap.Canvas do
|
|||||||
begin
|
begin
|
||||||
s:=AText;
|
s:=AText;
|
||||||
tw:=TextWidth(s) + 2;
|
tw:=TextWidth(s) + 2;
|
||||||
// Je�li tekst si� zmie�ci, rysujemy
|
// Jeœli tekst siê zmieœci, rysujemy
|
||||||
if tw<=(x2-x1+1) then
|
if tw<=(x2-x1+1) then
|
||||||
case Align of
|
case Align of
|
||||||
taLeftJustify : TGUITools.DrawOutlinedText(ABitmap,x1, y, AText, TextColor, OutlineColor);
|
taLeftJustify : TGUITools.DrawOutlinedText(ABitmap,x1, y, AText, TextColor, OutlineColor);
|
||||||
@ -1946,7 +1946,7 @@ with ACanvas do
|
|||||||
begin
|
begin
|
||||||
s:=AText;
|
s:=AText;
|
||||||
tw:=TextWidth(s) + 2;
|
tw:=TextWidth(s) + 2;
|
||||||
// Je�li tekst si� zmie�ci, rysujemy
|
// Jeœli tekst siê zmieœci, rysujemy
|
||||||
if tw<=(x2-x1+1) then
|
if tw<=(x2-x1+1) then
|
||||||
case Align of
|
case Align of
|
||||||
taLeftJustify : TGUITools.DrawOutlinedText(ACanvas,x1, y, AText, TextColor, OutlineColor);
|
taLeftJustify : TGUITools.DrawOutlinedText(ACanvas,x1, y, AText, TextColor, OutlineColor);
|
||||||
@ -2069,7 +2069,7 @@ with ACanvas do
|
|||||||
begin
|
begin
|
||||||
s:=AText;
|
s:=AText;
|
||||||
tw:=TextWidth(s);
|
tw:=TextWidth(s);
|
||||||
// Je�li tekst si� zmie�ci, rysujemy
|
// Jeœli tekst siê zmieœci, rysujemy
|
||||||
if tw<=(x2-x1+1) then
|
if tw<=(x2-x1+1) then
|
||||||
case Align of
|
case Align of
|
||||||
taLeftJustify : TextOut(x1,y,AText);
|
taLeftJustify : TextOut(x1,y,AText);
|
||||||
@ -2096,12 +2096,12 @@ var TempRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABuffer.PixelFormat<>pf24bit then
|
if ABuffer.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.RenderBackground: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.RenderBackground: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
if (rect.left>rect.right) or (rect.top>rect.bottom) then
|
if (rect.left>rect.right) or (rect.top>rect.bottom) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Zar�wno metoda FillRect jak i WinAPI'owe rysowanie gradient�w jest
|
// Zarówno metoda FillRect jak i WinAPI'owe rysowanie gradientów jest
|
||||||
// zabezpieczone przed rysowaniem poza obszarem p��tna.
|
// zabezpieczone przed rysowaniem poza obszarem p³ótna.
|
||||||
case BackgroundKind of
|
case BackgroundKind of
|
||||||
bkSolid: begin
|
bkSolid: begin
|
||||||
ABuffer.Canvas.brush.Color:=Color1;
|
ABuffer.Canvas.brush.Color:=Color1;
|
||||||
@ -2180,7 +2180,7 @@ var LineRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawHLine: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawHLine: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if y2<y1 then
|
if y2<y1 then
|
||||||
begin
|
begin
|
||||||
@ -2209,7 +2209,7 @@ var OrgLineRect : T2DIntRect;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if ABitmap.PixelFormat<>pf24bit then
|
if ABitmap.PixelFormat<>pf24bit then
|
||||||
raise exception.create('TGUITools.DrawHLine: Bitmapa musi by� w trybie 24-bitowym!');
|
raise exception.create('TGUITools.DrawHLine: Bitmapa musi byæ w trybie 24-bitowym!');
|
||||||
|
|
||||||
if y2<y1 then
|
if y2<y1 then
|
||||||
begin
|
begin
|
||||||
@ -2257,7 +2257,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -2268,7 +2268,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawVLine(ACanvas, x, y1, y2, Color);
|
DrawVLine(ACanvas, x, y1, y2, Color);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -2292,7 +2292,7 @@ DrawAARoundCorner(ACanvas, T2DIntVector.create(Rect.Right - Radius + 1, Rect.Bot
|
|||||||
ACanvas.Pen.color:=Color;
|
ACanvas.Pen.color:=Color;
|
||||||
ACanvas.pen.style:=psSolid;
|
ACanvas.pen.style:=psSolid;
|
||||||
|
|
||||||
// Draw*Line s� zabezpieczone przed rysowaniem poza obszarem
|
// Draw*Line s¹ zabezpieczone przed rysowaniem poza obszarem
|
||||||
DrawVLine(ACanvas, Rect.left, rect.top + Radius, rect.bottom - Radius, Color);
|
DrawVLine(ACanvas, Rect.left, rect.top + Radius, rect.bottom - Radius, Color);
|
||||||
DrawVLine(ACanvas, Rect.right, rect.top + Radius, rect.bottom - Radius, Color);
|
DrawVLine(ACanvas, Rect.right, rect.top + Radius, rect.bottom - Radius, Color);
|
||||||
DrawHLine(ACanvas, Rect.left + Radius, Rect.right - Radius, rect.top, Color);
|
DrawHLine(ACanvas, Rect.left + Radius, Rect.right - Radius, rect.top, Color);
|
||||||
@ -2307,7 +2307,7 @@ var UseOrgClipRgn : boolean;
|
|||||||
OrgRgn : HRGN;
|
OrgRgn : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -2318,7 +2318,7 @@ SelectClipRgn(ACanvas.Handle, ClipRgn);
|
|||||||
|
|
||||||
DrawAARoundFrame(ACanvas, Rect, Radius, Color);
|
DrawAARoundFrame(ACanvas, Rect, Radius, Color);
|
||||||
|
|
||||||
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych region�w
|
// Przywracanie poprzedniego ClipRgn i usuwanie wykorzystanych regionów
|
||||||
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
RestoreClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
DeleteObject(ClipRgn);
|
DeleteObject(ClipRgn);
|
||||||
end;
|
end;
|
||||||
@ -2346,7 +2346,7 @@ var UseOrgClipRgn: Boolean;
|
|||||||
DCStackPos : integer;
|
DCStackPos : integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zapami�tywanie oryginalnego ClipRgn i ustawianie nowego
|
// Zapamiêtywanie oryginalnego ClipRgn i ustawianie nowego
|
||||||
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
SaveClipRgn(ACanvas.Handle, UseOrgClipRgn, OrgRgn);
|
||||||
|
|
||||||
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
ClipRgn:=CreateRectRgn(ClipRect.left, ClipRect.Top, ClipRect.Right+1, ClipRect.Bottom+1);
|
||||||
@ -2355,8 +2355,8 @@ if UseOrgClipRgn then
|
|||||||
|
|
||||||
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
SelectClipRgn(ACanvas.Handle, ClipRgn);
|
||||||
|
|
||||||
// Hack poprawiaj�cy b��d w ImageList.Draw, kt�ry nie przywraca poprzedniego
|
// Hack poprawiaj¹cy b³¹d w ImageList.Draw, który nie przywraca poprzedniego
|
||||||
// koloru czcionki dla p��tna
|
// koloru czcionki dla p³ótna
|
||||||
DcStackPos:=SaveDC(ACanvas.Handle);
|
DcStackPos:=SaveDC(ACanvas.Handle);
|
||||||
ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex, false);
|
ImageList.Draw(ACanvas, Point.x, Point.y, ImageIndex, false);
|
||||||
RestoreDC(ACanvas.Handle, DcStackPos);
|
RestoreDC(ACanvas.Handle, DcStackPos);
|
||||||
|
@ -15,16 +15,16 @@ const NUM_ZERO = 0.00000001;
|
|||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
|
|
||||||
type // Wska�nik do tablicy TRGBTriple
|
type // WskaŸnik do tablicy TRGBTriple
|
||||||
PRGBTripleArray = ^TRGBTripleArray;
|
PRGBTripleArray = ^TRGBTripleArray;
|
||||||
// Tablica TRGBTriple (u�ywana podczas operacji ze ScanLine)
|
// Tablica TRGBTriple (u¿ywana podczas operacji ze ScanLine)
|
||||||
TRGBTripleArray = array[word] of TRGBTriple;
|
TRGBTripleArray = array[word] of TRGBTriple;
|
||||||
|
|
||||||
type THSLTriple = record
|
type THSLTriple = record
|
||||||
H, S, L : extended;
|
H, S, L : extended;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type // Typ u�ywany podczas rysowania gradient�w
|
type // Typ u¿ywany podczas rysowania gradientów
|
||||||
TRIVERTEX = packed record
|
TRIVERTEX = packed record
|
||||||
x,y : DWORD;
|
x,y : DWORD;
|
||||||
Red,
|
Red,
|
||||||
@ -37,12 +37,12 @@ type // Rodzaj gradientu
|
|||||||
TGradientType = (gtVertical, gtHorizontal);
|
TGradientType = (gtVertical, gtHorizontal);
|
||||||
// Rodzaj linii gradientowej (miejsce rozmycia)
|
// Rodzaj linii gradientowej (miejsce rozmycia)
|
||||||
TGradientLineShade = (lsShadeStart, lsShadeEnds, lsShadeCenter, lsShadeEnd);
|
TGradientLineShade = (lsShadeStart, lsShadeEnds, lsShadeCenter, lsShadeEnd);
|
||||||
// Rodzaj linii gradientowej (wypuk�o��)
|
// Rodzaj linii gradientowej (wypuk³oœæ)
|
||||||
TGradient3dLine = (glRaised, glLowered);
|
TGradient3dLine = (glRaised, glLowered);
|
||||||
|
|
||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Nag��wki dla zewn�trznych funkcji *
|
* Nag³ówki dla zewnêtrznych funkcji *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ function GradientFill(DC : hDC; pVertex : Pointer; dwNumVertex : DWORD; pMesh :
|
|||||||
|
|
||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Klasy narz�dziowe *
|
* Klasy narzêdziowe *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ if max=min then result:=max else
|
|||||||
result:=round((pos-min)*100/(max-min));
|
result:=round((pos-min)*100/(max-min));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{.$MESSAGE WARN 'Por�wnywanie liczb rzeczywistych? Trzeba poprawi�'}
|
{.$MESSAGE WARN 'Porównywanie liczb rzeczywistych? Trzeba poprawiæ'}
|
||||||
class function TColorTools.RGB2HSL(ARGB : TRGBTriple) : THSLTriple;
|
class function TColorTools.RGB2HSL(ARGB : TRGBTriple) : THSLTriple;
|
||||||
|
|
||||||
var RGBmin, RGBmax : extended;
|
var RGBmin, RGBmax : extended;
|
||||||
@ -209,7 +209,7 @@ RGBmax:=max(R,min(G,B));
|
|||||||
H:=0;
|
H:=0;
|
||||||
if RGBmax=RGBmin then
|
if RGBmax=RGBmin then
|
||||||
begin
|
begin
|
||||||
// H jest nieoznaczone, ale przyjmijmy zero dla sensowno�ci oblicze�
|
// H jest nieoznaczone, ale przyjmijmy zero dla sensownoœci obliczeñ
|
||||||
H:=0;
|
H:=0;
|
||||||
end else
|
end else
|
||||||
if (R=RGBmax) and (G>=B) then
|
if (R=RGBmax) and (G>=B) then
|
||||||
|
@ -4,7 +4,7 @@ unit SpkMath;
|
|||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
{TODO: Zastanowi� si�, czy wszystkie niejawne casty maj� sens}
|
{TODO: Zastanowiæ siê, czy wszystkie niejawne casty maj¹ sens}
|
||||||
|
|
||||||
uses Windows, Math, SysUtils;
|
uses Windows, Math, SysUtils;
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ const NUM_ZERO = 1e-12;
|
|||||||
|
|
||||||
type TRectCorner = (rcLeftTop, rcRightTop, rcLeftBottom, rcRightBottom);
|
type TRectCorner = (rcLeftTop, rcRightTop, rcLeftBottom, rcRightBottom);
|
||||||
|
|
||||||
type // Dwuwymiarowy wektor o ca�kowitych wsp��rz�dnych
|
type // Dwuwymiarowy wektor o ca³kowitych wspó³rzêdnych
|
||||||
T2DIntVector = record
|
T2DIntVector = record
|
||||||
x, y : integer;
|
x, y : integer;
|
||||||
public
|
public
|
||||||
@ -38,10 +38,10 @@ type // Dwuwymiarowy wektor o ca
|
|||||||
function DistanceTo(AVector : T2DIntVector) : double;
|
function DistanceTo(AVector : T2DIntVector) : double;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type // Punkt w przestrzeni dwuwymiarowej o ca�kowitych wsp��rz�dnych
|
type // Punkt w przestrzeni dwuwymiarowej o ca³kowitych wspó³rzêdnych
|
||||||
T2DIntPoint = T2DIntVector;
|
T2DIntPoint = T2DIntVector;
|
||||||
|
|
||||||
type // Prostok�t w przestrzeni dwuwymiarowej o ca�kowitych wsp��rz�dnych
|
type // Prostok¹t w przestrzeni dwuwymiarowej o ca³kowitych wspó³rzêdnych
|
||||||
T2DIntRect = record
|
T2DIntRect = record
|
||||||
public
|
public
|
||||||
constructor Create(ALeft, ATop, ARight, ABottom : integer); overload;
|
constructor Create(ALeft, ATop, ARight, ABottom : integer); overload;
|
||||||
@ -75,7 +75,7 @@ type // Prostok
|
|||||||
1 : (TopLeft : T2DIntVector; BottomRight : T2DIntVector);
|
1 : (TopLeft : T2DIntVector; BottomRight : T2DIntVector);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type // Wektor w przestrzeni dwuwymiarowej o rzeczywistych wsp��rz�dnych
|
type // Wektor w przestrzeni dwuwymiarowej o rzeczywistych wspó³rzêdnych
|
||||||
T2DVector = record
|
T2DVector = record
|
||||||
x, y : extended;
|
x, y : extended;
|
||||||
public
|
public
|
||||||
@ -115,10 +115,10 @@ type // Wektor w przestrzeni dwuwymiarowej o rzeczywistych wsp
|
|||||||
function DistanceFromAxis(APoint : T2DVector; AVector : T2DVector) : extended;
|
function DistanceFromAxis(APoint : T2DVector; AVector : T2DVector) : extended;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type // Punkt w przestrzeni dwuwymiarowej o rzeczywistych wsp��rz�dnych
|
type // Punkt w przestrzeni dwuwymiarowej o rzeczywistych wspó³rzêdnych
|
||||||
T2DPoint = T2DVector;
|
T2DPoint = T2DVector;
|
||||||
|
|
||||||
type // Prostok�t w przestrzeni dwuwymiarowej o rzeczywistych wsp��rz�dnych
|
type // Prostok¹t w przestrzeni dwuwymiarowej o rzeczywistych wspó³rzêdnych
|
||||||
T2DRect = record
|
T2DRect = record
|
||||||
public
|
public
|
||||||
constructor Create(ALeft, ATop, ARight, ABottom : extended); overload;
|
constructor Create(ALeft, ATop, ARight, ABottom : extended); overload;
|
||||||
@ -152,7 +152,7 @@ type // Prostok
|
|||||||
1 : (TopLeft : T2DVector; BottomRight : T2DVector);
|
1 : (TopLeft : T2DVector; BottomRight : T2DVector);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
type // Wektor w przestrzeni tr�jwymiarowej o rzeczywistych wsp��rz�dnych
|
type // Wektor w przestrzeni trójwymiarowej o rzeczywistych wspó³rzêdnych
|
||||||
T3DVector = record
|
T3DVector = record
|
||||||
x, y, z : extended;
|
x, y, z : extended;
|
||||||
public
|
public
|
||||||
@ -356,7 +356,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.DownNormal: Nie mog� obliczy� normalnej do wektora zerowego!');
|
raise exception.create('T2DVector.DownNormal: Nie mogê obliczyæ normalnej do wektora zerowego!');
|
||||||
|
|
||||||
if self.x>0 then
|
if self.x>0 then
|
||||||
begin
|
begin
|
||||||
@ -474,7 +474,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.Normalize: Nie mo�na znormalizowa� wektora zerowego!');
|
raise exception.create('T2DVector.Normalize: Nie mo¿na znormalizowaæ wektora zerowego!');
|
||||||
self.x:=self.x/len;
|
self.x:=self.x/len;
|
||||||
self.y:=self.y/len;
|
self.y:=self.y/len;
|
||||||
end;
|
end;
|
||||||
@ -486,7 +486,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.Normalized: Nie mo�na obliczy� normy wektora zerowego!');
|
raise exception.create('T2DVector.Normalized: Nie mo¿na obliczyæ normy wektora zerowego!');
|
||||||
result.x:=self.x/len;
|
result.x:=self.x/len;
|
||||||
result.y:=self.y/len;
|
result.y:=self.y/len;
|
||||||
end;
|
end;
|
||||||
@ -521,7 +521,7 @@ var product : extended;
|
|||||||
begin
|
begin
|
||||||
len:=vector.Length;
|
len:=vector.Length;
|
||||||
if abs(len)<NUM_ZERO then
|
if abs(len)<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.ProjectedTo: Nie mo�na rzutowa� na wektor zerowy!');
|
raise exception.create('T2DVector.ProjectedTo: Nie mo¿na rzutowaæ na wektor zerowy!');
|
||||||
|
|
||||||
product:=self.x*vector.x + self.y*vector.y;
|
product:=self.x*vector.x + self.y*vector.y;
|
||||||
result.x:=(vector.x * product) / sqr(len);
|
result.x:=(vector.x * product) / sqr(len);
|
||||||
@ -536,7 +536,7 @@ var product : extended;
|
|||||||
begin
|
begin
|
||||||
len:=vector.Length;
|
len:=vector.Length;
|
||||||
if abs(len)<NUM_ZERO then
|
if abs(len)<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.ProjectTo: Nie mo�na rzutowa� na wektor zerowy!');
|
raise exception.create('T2DVector.ProjectTo: Nie mo¿na rzutowaæ na wektor zerowy!');
|
||||||
|
|
||||||
product:=self.x*vector.x + self.y*vector.y;
|
product:=self.x*vector.x + self.y*vector.y;
|
||||||
|
|
||||||
@ -575,7 +575,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T2DVector.UpNormal: Nie mog� obliczy� normalnej do wektora zerowego!');
|
raise exception.create('T2DVector.UpNormal: Nie mogê obliczyæ normalnej do wektora zerowego!');
|
||||||
|
|
||||||
if self.x>0 then
|
if self.x>0 then
|
||||||
begin
|
begin
|
||||||
@ -634,7 +634,7 @@ result.y:=-(self.x * vector.z - self.z * vector.x);
|
|||||||
result.z:=self.x * vector.y - self.y * vector.x;
|
result.z:=self.x * vector.y - self.y * vector.x;
|
||||||
len:=result.Length;
|
len:=result.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.DownNormalTo: Nie mog� obliczy� normalnej: wektory le�� na wsp�lnej prostej!');
|
raise exception.create('T3DVector.DownNormalTo: Nie mogê obliczyæ normalnej: wektory le¿¹ na wspólnej prostej!');
|
||||||
result.x:=result.x/len;
|
result.x:=result.x/len;
|
||||||
result.y:=result.y/len;
|
result.y:=result.y/len;
|
||||||
result.z:=result.z/len;
|
result.z:=result.z/len;
|
||||||
@ -762,7 +762,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.Normalize: Nie mo�na znormalizowa� wektora zerowego!');
|
raise exception.create('T3DVector.Normalize: Nie mo¿na znormalizowaæ wektora zerowego!');
|
||||||
self.x:=self.x/len;
|
self.x:=self.x/len;
|
||||||
self.y:=self.y/len;
|
self.y:=self.y/len;
|
||||||
self.z:=self.z/len;
|
self.z:=self.z/len;
|
||||||
@ -775,7 +775,7 @@ var len : extended;
|
|||||||
begin
|
begin
|
||||||
len:=self.Length;
|
len:=self.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.Normalized: Nie mo�na obliczy� normy wektora zerowego!');
|
raise exception.create('T3DVector.Normalized: Nie mo¿na obliczyæ normy wektora zerowego!');
|
||||||
result.x:=self.x/len;
|
result.x:=self.x/len;
|
||||||
result.y:=self.y/len;
|
result.y:=self.y/len;
|
||||||
result.z:=self.z/len;
|
result.z:=self.z/len;
|
||||||
@ -796,7 +796,7 @@ var product : extended;
|
|||||||
begin
|
begin
|
||||||
len:=vector.Length;
|
len:=vector.Length;
|
||||||
if abs(len)<NUM_ZERO then
|
if abs(len)<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.ProjectedTo: Nie mo�na rzutowa� na wektor zerowy!');
|
raise exception.create('T3DVector.ProjectedTo: Nie mo¿na rzutowaæ na wektor zerowy!');
|
||||||
|
|
||||||
product:=self.x*vector.x + self.y*vector.y + self.z*vector.z;
|
product:=self.x*vector.x + self.y*vector.y + self.z*vector.z;
|
||||||
result.x:=(vector.x * product) / sqr(len);
|
result.x:=(vector.x * product) / sqr(len);
|
||||||
@ -812,7 +812,7 @@ var product : extended;
|
|||||||
begin
|
begin
|
||||||
len:=vector.Length;
|
len:=vector.Length;
|
||||||
if abs(len)<NUM_ZERO then
|
if abs(len)<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.ProjectTo: Nie mo�na rzutowa� na wektor zerowy!');
|
raise exception.create('T3DVector.ProjectTo: Nie mo¿na rzutowaæ na wektor zerowy!');
|
||||||
|
|
||||||
product:=self.x*vector.x + self.y*vector.y + self.z*vector.z;
|
product:=self.x*vector.x + self.y*vector.y + self.z*vector.z;
|
||||||
self.x:=(vector.x * product) / sqr(len);
|
self.x:=(vector.x * product) / sqr(len);
|
||||||
@ -845,7 +845,7 @@ result.z:=self.x * vector.y - self.y * vector.x;
|
|||||||
|
|
||||||
len:=result.Length;
|
len:=result.Length;
|
||||||
if len<NUM_ZERO then
|
if len<NUM_ZERO then
|
||||||
raise exception.create('T3DVector.UpNormalTo: Nie mog� obliczy� normalnej: wektory le�� na wsp�lnej prostej!');
|
raise exception.create('T3DVector.UpNormalTo: Nie mogê obliczyæ normalnej: wektory le¿¹ na wspólnej prostej!');
|
||||||
result.x:=result.x/len;
|
result.x:=result.x/len;
|
||||||
result.y:=result.y/len;
|
result.y:=result.y/len;
|
||||||
result.z:=result.z/len;
|
result.z:=result.z/len;
|
||||||
@ -1311,7 +1311,7 @@ var center : extended;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ANewHeight<0) then
|
if (ANewHeight<0) then
|
||||||
raise exception.create('T2DRect.SetCenteredHeight: Nowa wysoko�� mniejsza od zera!');
|
raise exception.create('T2DRect.SetCenteredHeight: Nowa wysokoϾ mniejsza od zera!');
|
||||||
|
|
||||||
center:=self.top+(self.bottom-self.top)/2;
|
center:=self.top+(self.bottom-self.top)/2;
|
||||||
self.top:=center-(ANewHeight/2);
|
self.top:=center-(ANewHeight/2);
|
||||||
@ -1324,7 +1324,7 @@ var center : extended;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (ANewWidth<0) then
|
if (ANewWidth<0) then
|
||||||
raise exception.create('T2DRect.SetCenteredWidth: Nowa szeroko�� mniejsza od zera!');
|
raise exception.create('T2DRect.SetCenteredWidth: Nowa szerokoϾ mniejsza od zera!');
|
||||||
|
|
||||||
center:=self.left+(self.right-self.left)/2;
|
center:=self.left+(self.right-self.left)/2;
|
||||||
self.left:=center-(ANewWidth/2);
|
self.left:=center-(ANewWidth/2);
|
||||||
|
@ -3,9 +3,9 @@ unit SpkToolbar;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: SpkToolbar.pas *
|
* Plik: SpkToolbar.pas *
|
||||||
* Opis: G��wny komponent toolbara *
|
* Opis: G³ówny komponent toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -18,18 +18,18 @@ uses Windows, Graphics, SysUtils, Controls, Classes, Messages, Math, Dialogs,
|
|||||||
spkt_Appearance, spkt_BaseItem, spkt_Const, spkt_Dispatch, spkt_Tab,
|
spkt_Appearance, spkt_BaseItem, spkt_Const, spkt_Dispatch, spkt_Tab,
|
||||||
spkt_Pane, spkt_Exceptions, spkt_Types;
|
spkt_Pane, spkt_Exceptions, spkt_Types;
|
||||||
|
|
||||||
type /// <summary>Typ opisuj�cy regiony toolbara, kt�re s� u�ywane podczas
|
type /// <summary>Typ opisuj¹cy regiony toolbara, które s¹ u¿ywane podczas
|
||||||
/// obs�ugi interakcji z mysz�</summary>
|
/// obs³ugi interakcji z mysz¹</summary>
|
||||||
TSpkMouseToolbarElement = (teNone, teToolbarArea, teTabs, teTabContents);
|
TSpkMouseToolbarElement = (teNone, teToolbarArea, teTabs, teTabContents);
|
||||||
|
|
||||||
type TSpkToolbar = class;
|
type TSpkToolbar = class;
|
||||||
|
|
||||||
/// <summary>Klasa dyspozytora s�u��ca do bezpiecznego przyjmowania
|
/// <summary>Klasa dyspozytora s³u¿¹ca do bezpiecznego przyjmowania
|
||||||
/// informacji oraz ��da� od pod-element�w</summary>
|
/// informacji oraz ¿¹dañ od pod-elementów</summary>
|
||||||
TSpkToolbarDispatch = class(TSpkBaseToolbarDispatch)
|
TSpkToolbarDispatch = class(TSpkBaseToolbarDispatch)
|
||||||
private
|
private
|
||||||
/// <summary>Komponent toolbara, kt�ry przyjmuje informacje i ��dania
|
/// <summary>Komponent toolbara, który przyjmuje informacje i ¿¹dania
|
||||||
/// od pod-element�w</summary>
|
/// od pod-elementów</summary>
|
||||||
FToolbar : TSpkToolbar;
|
FToolbar : TSpkToolbar;
|
||||||
protected
|
protected
|
||||||
public
|
public
|
||||||
@ -44,29 +44,29 @@ type TSpkToolbar = class;
|
|||||||
// *** Implementacja abstrakcyjnych metod TSpkBaseToolbarDispatch ***
|
// *** Implementacja abstrakcyjnych metod TSpkBaseToolbarDispatch ***
|
||||||
// ******************************************************************
|
// ******************************************************************
|
||||||
|
|
||||||
/// <summary>Metoda wywo�ywana, gdy zmieni si� zawarto�� obiektu wygl�du
|
/// <summary>Metoda wywo³ywana, gdy zmieni siê zawartoœæ obiektu wygl¹du
|
||||||
/// zawieraj�cego kolory i czcionki u�ywane do rysowania toolbara.
|
/// zawieraj¹cego kolory i czcionki u¿ywane do rysowania toolbara.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
procedure NotifyAppearanceChanged; override;
|
procedure NotifyAppearanceChanged; override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy zmieni si� lista pod-element�w jednego
|
/// <summary>Metoda wywo³ywana, gdy zmieni siê lista pod-elementów jednego
|
||||||
/// z element�w toolbara</summary>
|
/// z elementów toolbara</summary>
|
||||||
procedure NotifyItemsChanged; override;
|
procedure NotifyItemsChanged; override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy zmieni si� rozmiar lub po�o�enie
|
/// <summary>Metoda wywo³ywana, gdy zmieni siê rozmiar lub po³o¿enie
|
||||||
/// (metryka) jednego z element�w toolbara</summary>
|
/// (metryka) jednego z elementów toolbara</summary>
|
||||||
procedure NotifyMetricsChanged; override;
|
procedure NotifyMetricsChanged; override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy zmieni si� wygl�d jednego z element�w
|
/// <summary>Metoda wywo³ywana, gdy zmieni siê wygl¹d jednego z elementów
|
||||||
/// toolbara, nie wymagaj�cy jednak przebudowania metryk.</summary>
|
/// toolbara, nie wymagaj¹cy jednak przebudowania metryk.</summary>
|
||||||
procedure NotifyVisualsChanged; override;
|
procedure NotifyVisualsChanged; override;
|
||||||
/// <summary>Metoda ��da dostarczenia przez toolbar pomocniczej
|
/// <summary>Metoda ¿¹da dostarczenia przez toolbar pomocniczej
|
||||||
/// bitmapy u�ywanej - przyk�adowo - do obliczania rozmiar�w renderowanego
|
/// bitmapy u¿ywanej - przyk³adowo - do obliczania rozmiarów renderowanego
|
||||||
/// tekstu</summary>
|
/// tekstu</summary>
|
||||||
function GetTempBitmap : TBitmap; override;
|
function GetTempBitmap : TBitmap; override;
|
||||||
/// <summary>Metoda przelicza wsp��rz�dne toolbara na wsp��rz�dne
|
/// <summary>Metoda przelicza wspó³rzêdne toolbara na wspó³rzêdne
|
||||||
/// ekranu, co umo�liwia - na przyk�ad - rozwini�cie popup menu.</summary>
|
/// ekranu, co umo¿liwia - na przyk³ad - rozwiniêcie popup menu.</summary>
|
||||||
function ClientToScreen(Point : T2DIntPoint) : T2DIntPoint; override;
|
function ClientToScreen(Point : T2DIntPoint) : T2DIntPoint; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
/// <summary>Rozszerzony pasek narz�dzi inspirowany Microsoft Fluent
|
/// <summary>Rozszerzony pasek narzêdzi inspirowany Microsoft Fluent
|
||||||
/// UI</summary>
|
/// UI</summary>
|
||||||
TSpkToolbar = class(TCustomControl)
|
TSpkToolbar = class(TCustomControl)
|
||||||
private
|
private
|
||||||
@ -74,81 +74,81 @@ type TSpkToolbar = class;
|
|||||||
/// toolbara</summary>
|
/// toolbara</summary>
|
||||||
FToolbarDispatch : TSpkToolbarDispatch;
|
FToolbarDispatch : TSpkToolbarDispatch;
|
||||||
|
|
||||||
/// <summary>Bufor w kt�rym rysowany jest toolbar</summary>
|
/// <summary>Bufor w którym rysowany jest toolbar</summary>
|
||||||
FBuffer : TBitmap;
|
FBuffer : TBitmap;
|
||||||
/// <summary>Pomocnicza bitmapa przekazywana na �yczenie elementom
|
/// <summary>Pomocnicza bitmapa przekazywana na ¿yczenie elementom
|
||||||
/// toolbara</summary>
|
/// toolbara</summary>
|
||||||
FTemporary : TBitmap;
|
FTemporary : TBitmap;
|
||||||
|
|
||||||
/// <summary>Tablica rect�w "uchwyt�w" zak�adek</summary>
|
/// <summary>Tablica rectów "uchwytów" zak³adek</summary>
|
||||||
FTabRects : array of T2DIntRect;
|
FTabRects : array of T2DIntRect;
|
||||||
/// <summary>Cliprect obszaru "uchwyt�w" zak�adek</summary>
|
/// <summary>Cliprect obszaru "uchwytów" zak³adek</summary>
|
||||||
FTabClipRect : T2DIntRect;
|
FTabClipRect : T2DIntRect;
|
||||||
/// <summary>Cliprect obszaru zawarto�ci zak�adki</summary>
|
/// <summary>Cliprect obszaru zawartoœci zak³adki</summary>
|
||||||
FTabContentsClipRect : T2DIntRect;
|
FTabContentsClipRect : T2DIntRect;
|
||||||
|
|
||||||
/// <summary>Element toolbara znajduj�cy si� obecnie pod myszk�</summary>
|
/// <summary>Element toolbara znajduj¹cy siê obecnie pod myszk¹</summary>
|
||||||
FMouseHoverElement : TSpkMouseToolbarElement;
|
FMouseHoverElement : TSpkMouseToolbarElement;
|
||||||
/// <summary>Element toolbara maj�cy obecnie wy��czno�� na otrzymywanie
|
/// <summary>Element toolbara maj¹cy obecnie wy³¹cznoœæ na otrzymywanie
|
||||||
/// komunikat�w od myszy</summary>
|
/// komunikatów od myszy</summary>
|
||||||
FMouseActiveElement : TSpkMouseToolbarElement;
|
FMouseActiveElement : TSpkMouseToolbarElement;
|
||||||
|
|
||||||
/// <summary>"Uchwyt" zak�adki, nad kt�rym znajduje si� obecnie mysz
|
/// <summary>"Uchwyt" zak³adki, nad którym znajduje siê obecnie mysz
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FTabHover : integer;
|
FTabHover : integer;
|
||||||
|
|
||||||
/// <summary>Flaga informuj�ca o tym, czy metryki toolbara i jego element�w
|
/// <summary>Flaga informuj¹ca o tym, czy metryki toolbara i jego elementów
|
||||||
/// s� aktualne</summary>
|
/// s¹ aktualne</summary>
|
||||||
FMetricsValid : boolean;
|
FMetricsValid : boolean;
|
||||||
/// <summary>Flaga informuj�ca o tym, czy zawarto�� bufora jest aktualna
|
/// <summary>Flaga informuj¹ca o tym, czy zawartoœæ bufora jest aktualna
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FBufferValid : boolean;
|
FBufferValid : boolean;
|
||||||
/// <summary>Flaga InternalUpdating pozwala na zablokowanie walidacji
|
/// <summary>Flaga InternalUpdating pozwala na zablokowanie walidacji
|
||||||
/// metryk i bufora w momencie, gdy komponent przebudowuje swoj� zawarto��.
|
/// metryk i bufora w momencie, gdy komponent przebudowuje swoj¹ zawartoœæ.
|
||||||
/// FInternalUpdating jest zapalana i gaszona wewn�trznie, przez komponent.
|
/// FInternalUpdating jest zapalana i gaszona wewnêtrznie, przez komponent.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FInternalUpdating : boolean;
|
FInternalUpdating : boolean;
|
||||||
/// <summary>Flaga IUpdating pozwala na zablokowanie walidacji
|
/// <summary>Flaga IUpdating pozwala na zablokowanie walidacji
|
||||||
/// metryk i bufora w momencie, gdy u�ytkownik przebudowuje zawarto��
|
/// metryk i bufora w momencie, gdy u¿ytkownik przebudowuje zawartoœæ
|
||||||
/// komponentu. FUpdating jest sterowana przez u�ytkownika.</summary>
|
/// komponentu. FUpdating jest sterowana przez u¿ytkownika.</summary>
|
||||||
FUpdating : boolean;
|
FUpdating : boolean;
|
||||||
protected
|
protected
|
||||||
/// <summary>Instancja obiektu wygl�du, przechowuj�cego kolory i czcionki
|
/// <summary>Instancja obiektu wygl¹du, przechowuj¹cego kolory i czcionki
|
||||||
/// u�ywane podczas renderowania komponentu</summary>
|
/// u¿ywane podczas renderowania komponentu</summary>
|
||||||
FAppearance : TSpkToolbarAppearance;
|
FAppearance : TSpkToolbarAppearance;
|
||||||
/// <summary>Zak�adki toolbara</summary>
|
/// <summary>Zak³adki toolbara</summary>
|
||||||
FTabs : TSpkTabs;
|
FTabs : TSpkTabs;
|
||||||
/// <summary>Indeks wybranej zak�adki</summary>
|
/// <summary>Indeks wybranej zak³adki</summary>
|
||||||
FTabIndex : integer;
|
FTabIndex : integer;
|
||||||
/// <summary>Lista ma�ych obrazk�w element�w toolbara</summary>
|
/// <summary>Lista ma³ych obrazków elementów toolbara</summary>
|
||||||
FImages : TImageList;
|
FImages : TImageList;
|
||||||
/// <summary>Lista ma�ych obrazk�w w stanie "disabled". Je�li nie jest
|
/// <summary>Lista ma³ych obrazków w stanie "disabled". Jeœli nie jest
|
||||||
/// przypisana, obrazki w stanie "disabled" b�d� generowane automatycznie.
|
/// przypisana, obrazki w stanie "disabled" bêd¹ generowane automatycznie.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FDisabledImages : TImageList;
|
FDisabledImages : TImageList;
|
||||||
/// <summary>Lista du�ych obrazk�w element�w toolbara</summary>
|
/// <summary>Lista du¿ych obrazków elementów toolbara</summary>
|
||||||
FLargeImages : TImageList;
|
FLargeImages : TImageList;
|
||||||
/// <summary>Lista du�ych obrazk�w w stanie "disabled". Je�li nie jest
|
/// <summary>Lista du¿ych obrazków w stanie "disabled". Jeœli nie jest
|
||||||
/// przypisana, obrazki w stanie "disabled" b�d� generowane automatycznie.
|
/// przypisana, obrazki w stanie "disabled" bêd¹ generowane automatycznie.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FDisabledLargeImages : TImageList;
|
FDisabledLargeImages : TImageList;
|
||||||
|
|
||||||
// *******************************************
|
// *******************************************
|
||||||
// *** Zarz�dzanie stanem metryki i bufora ***
|
// *** Zarz¹dzanie stanem metryki i bufora ***
|
||||||
// *******************************************
|
// *******************************************
|
||||||
|
|
||||||
/// <summary>Metoda gasi flagi: FMetricsValid oraz FBufferValid</summary>
|
/// <summary>Metoda gasi flagi: FMetricsValid oraz FBufferValid</summary>
|
||||||
procedure SetMetricsInvalid;
|
procedure SetMetricsInvalid;
|
||||||
/// <summary>Metoda gasi flag� FBufferValid</summary>
|
/// <summary>Metoda gasi flagê FBufferValid</summary>
|
||||||
procedure SetBufferInvalid;
|
procedure SetBufferInvalid;
|
||||||
/// <summary>Metoda waliduje metryki toolbara i jego element�w</summary>
|
/// <summary>Metoda waliduje metryki toolbara i jego elementów</summary>
|
||||||
procedure ValidateMetrics;
|
procedure ValidateMetrics;
|
||||||
/// <summary>Metoda waliduje zawarto�� bufora</summary>
|
/// <summary>Metoda waliduje zawartoϾ bufora</summary>
|
||||||
procedure ValidateBuffer;
|
procedure ValidateBuffer;
|
||||||
/// <summary>Metoda w��cza tryb wewn�trznej przebudowy - zapala flag�
|
/// <summary>Metoda w³¹cza tryb wewnêtrznej przebudowy - zapala flagê
|
||||||
/// FInternalUpdating</summary>
|
/// FInternalUpdating</summary>
|
||||||
procedure InternalBeginUpdate;
|
procedure InternalBeginUpdate;
|
||||||
/// <summary>Metoda wy��cza tryb wewn�trznej przebudowy - gasi flag�
|
/// <summary>Metoda wy³¹cza tryb wewnêtrznej przebudowy - gasi flagê
|
||||||
/// FInternalUpdating</summary>
|
/// FInternalUpdating</summary>
|
||||||
procedure InternalEndUpdate;
|
procedure InternalEndUpdate;
|
||||||
|
|
||||||
@ -158,43 +158,43 @@ type TSpkToolbar = class;
|
|||||||
|
|
||||||
/// <summary>Zmiana rozmiaru komponentu</summary>
|
/// <summary>Zmiana rozmiaru komponentu</summary>
|
||||||
procedure Resize; override;
|
procedure Resize; override;
|
||||||
/// <summary>Metoda wywo�ywana po opuszczeniu obszaru komponentu przez
|
/// <summary>Metoda wywo³ywana po opuszczeniu obszaru komponentu przez
|
||||||
/// wska�nik myszy</summary>
|
/// wskaŸnik myszy</summary>
|
||||||
procedure MouseLeave;
|
procedure MouseLeave;
|
||||||
/// <summary>Metoda wywo�ywana po wci�ni�ciu przycisku myszy</summary>
|
/// <summary>Metoda wywo³ywana po wciœniêciu przycisku myszy</summary>
|
||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer); override;
|
X, Y: Integer); override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy nad komponentem przesunie si� wska�nik
|
/// <summary>Metoda wywo³ywana, gdy nad komponentem przesunie siê wskaŸnik
|
||||||
/// myszy</summary>
|
/// myszy</summary>
|
||||||
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
|
||||||
/// <summary>Metoda wywo�ywana po puszczeniu przycisku myszy</summary>
|
/// <summary>Metoda wywo³ywana po puszczeniu przycisku myszy</summary>
|
||||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer); override;
|
X, Y: Integer); override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy ca�y komponent wczyta si� z DFMa
|
/// <summary>Metoda wywo³ywana, gdy ca³y komponent wczyta siê z DFMa
|
||||||
/// </summary>
|
/// </summary>
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
/// <summary>Metoda wywo�ywana, gdy komponent staje si� Ownerem innego
|
/// <summary>Metoda wywo³ywana, gdy komponent staje siê Ownerem innego
|
||||||
/// komponentu, b�d� gdy jeden z jego pod-komponent�w jest zwalniany
|
/// komponentu, b¹dŸ gdy jeden z jego pod-komponentów jest zwalniany
|
||||||
/// </summary>
|
/// </summary>
|
||||||
procedure Notification(AComponent: TComponent;
|
procedure Notification(AComponent: TComponent;
|
||||||
Operation: TOperation); override;
|
Operation: TOperation); override;
|
||||||
|
|
||||||
// ******************************************
|
// ******************************************
|
||||||
// *** Obs�uga zdarze� myszy dla zak�adek ***
|
// *** Obs³uga zdarzeñ myszy dla zak³adek ***
|
||||||
// ******************************************
|
// ******************************************
|
||||||
|
|
||||||
/// <summary>Metoda wywo�ywana po opuszczeniu przez wska�nik myszy obszaru
|
/// <summary>Metoda wywo³ywana po opuszczeniu przez wskaŸnik myszy obszaru
|
||||||
/// "uchwyt�w" zak�adek</summary>
|
/// "uchwytów" zak³adek</summary>
|
||||||
procedure TabMouseLeave;
|
procedure TabMouseLeave;
|
||||||
/// <summary>Metoda wywo�ywana po wci�ni�ciu przycisku myszy, gdy wska�nik
|
/// <summary>Metoda wywo³ywana po wciœniêciu przycisku myszy, gdy wskaŸnik
|
||||||
/// jest nad obszarem zak�adek</summary>
|
/// jest nad obszarem zak³adek</summary>
|
||||||
procedure TabMouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure TabMouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
/// <summary>Metoda wywo�ywana, gdy mysz przesunie si� ponad obszarem
|
/// <summary>Metoda wywo³ywana, gdy mysz przesunie siê ponad obszarem
|
||||||
/// "uchwyt�w" zak�adek</summary>
|
/// "uchwytów" zak³adek</summary>
|
||||||
procedure TabMouseMove(Shift: TShiftState; X, Y: Integer);
|
procedure TabMouseMove(Shift: TShiftState; X, Y: Integer);
|
||||||
/// <summary>Metoda wywo�ywana, gdy jeden z przycisk�w myszy zostanie
|
/// <summary>Metoda wywo³ywana, gdy jeden z przycisków myszy zostanie
|
||||||
/// puszczony, gdy obszar zak�adek by� aktywnym elementem toolbara
|
/// puszczony, gdy obszar zak³adek by³ aktywnym elementem toolbara
|
||||||
/// </summary>
|
/// </summary>
|
||||||
procedure TabMouseUp(Button: TMouseButton; Shift: TShiftState;
|
procedure TabMouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
@ -203,66 +203,66 @@ type TSpkToolbar = class;
|
|||||||
// *** Pomocnicze ***
|
// *** Pomocnicze ***
|
||||||
// ******************
|
// ******************
|
||||||
|
|
||||||
/// <summary>Metoda sprawdza, czy cho� jedna zak�adka ma ustawion� flag�
|
/// <summary>Metoda sprawdza, czy choæ jedna zak³adka ma ustawion¹ flagê
|
||||||
/// widoczno�ci (Visible)</summary>
|
/// widocznoœci (Visible)</summary>
|
||||||
function AtLeastOneTabVisible : boolean;
|
function AtLeastOneTabVisible : boolean;
|
||||||
|
|
||||||
// ***************************
|
// ***************************
|
||||||
// *** Obs�uga komunikat�w ***
|
// *** Obs³uga komunikatów ***
|
||||||
// ***************************
|
// ***************************
|
||||||
|
|
||||||
/// <summary>Komunikat odbierany, gdy mysz opu�ci obszar komponentu
|
/// <summary>Komunikat odbierany, gdy mysz opuœci obszar komponentu
|
||||||
/// </summary>
|
/// </summary>
|
||||||
procedure CMMouseLeave(var msg : TMessage); message CM_MOUSELEAVE;
|
procedure CMMouseLeave(var msg : TMessage); message CM_MOUSELEAVE;
|
||||||
|
|
||||||
// ********************************
|
// ********************************
|
||||||
// *** Obs�uga designtime i DFM ***
|
// *** Obs³uga designtime i DFM ***
|
||||||
// ********************************
|
// ********************************
|
||||||
|
|
||||||
/// <summary>Metoda zwraca elementy, kt�re maj� zosta� zapisane jako
|
/// <summary>Metoda zwraca elementy, które maj¹ zostaæ zapisane jako
|
||||||
/// pod-elementy komponentu</summary>
|
/// pod-elementy komponentu</summary>
|
||||||
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
||||||
/// <summary>Metoda pozwala na zapisanie lub odczytanie dodatkowych
|
/// <summary>Metoda pozwala na zapisanie lub odczytanie dodatkowych
|
||||||
/// w�asno�ci komponentu</summary>
|
/// w³asnoœci komponentu</summary>
|
||||||
procedure DefineProperties(Filer : TFiler); override;
|
procedure DefineProperties(Filer : TFiler); override;
|
||||||
|
|
||||||
// *************************
|
// *************************
|
||||||
// *** Gettery i settery ***
|
// *** Gettery i settery ***
|
||||||
// *************************
|
// *************************
|
||||||
|
|
||||||
/// <summary>Getter dla w�asno�ci Height</summary>
|
/// <summary>Getter dla w³asnoœci Height</summary>
|
||||||
function GetHeight: integer;
|
function GetHeight: integer;
|
||||||
/// <summary>Setter dla w�asno�ci Appearance</summary>
|
/// <summary>Setter dla w³asnoœci Appearance</summary>
|
||||||
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
procedure SetAppearance(const Value: TSpkToolbarAppearance);
|
||||||
/// <summary>Getter dla w�asno�ci Color</summary>
|
/// <summary>Getter dla w³asnoœci Color</summary>
|
||||||
function GetColor: TColor;
|
function GetColor: TColor;
|
||||||
/// <summary>Setter dla w�asno�ci Color</summary>
|
/// <summary>Setter dla w³asnoœci Color</summary>
|
||||||
procedure SetColor(const Value: TColor);
|
procedure SetColor(const Value: TColor);
|
||||||
/// <summary>Setter dla w�asno�ci TabIndex</summary>
|
/// <summary>Setter dla w³asnoœci TabIndex</summary>
|
||||||
procedure SetTabIndex(const Value: integer);
|
procedure SetTabIndex(const Value: integer);
|
||||||
/// <summary>Setter dla w�asno�ci Images</summary>
|
/// <summary>Setter dla w³asnoœci Images</summary>
|
||||||
procedure SetImages(const Value: TImageList);
|
procedure SetImages(const Value: TImageList);
|
||||||
/// <summary>Setter dla w�asno�ci DisabledImages</summary>
|
/// <summary>Setter dla w³asnoœci DisabledImages</summary>
|
||||||
procedure SetDisabledImages(const Value : TImageList);
|
procedure SetDisabledImages(const Value : TImageList);
|
||||||
/// <summary>Setter dla w�asno�ci LargeImages</summary>
|
/// <summary>Setter dla w³asnoœci LargeImages</summary>
|
||||||
procedure SetLargeImages(const Value : TImageList);
|
procedure SetLargeImages(const Value : TImageList);
|
||||||
/// <summary>Setter dla w�asno�ci DisabledLargeImages</summary>
|
/// <summary>Setter dla w³asnoœci DisabledLargeImages</summary>
|
||||||
procedure SetDisabledLargeImages(const Value : TImageList);
|
procedure SetDisabledLargeImages(const Value : TImageList);
|
||||||
public
|
public
|
||||||
|
|
||||||
// ***********************************
|
// ***********************************
|
||||||
// *** Obs�uga zdarze� dyspozytora ***
|
// *** Obs³uga zdarzeñ dyspozytora ***
|
||||||
// ***********************************
|
// ***********************************
|
||||||
|
|
||||||
/// <summary>Reakcja na zmian� struktury element�w toolbara</summary>
|
/// <summary>Reakcja na zmianê struktury elementów toolbara</summary>
|
||||||
procedure NotifyItemsChanged;
|
procedure NotifyItemsChanged;
|
||||||
/// <summary>Reakcja na zmian� metryki element�w toolbara</summary>
|
/// <summary>Reakcja na zmianê metryki elementów toolbara</summary>
|
||||||
procedure NotifyMetricsChanged;
|
procedure NotifyMetricsChanged;
|
||||||
/// <summary>Reakcja na zmian� wygl�du element�w toolbara</summary>
|
/// <summary>Reakcja na zmianê wygl¹du elementów toolbara</summary>
|
||||||
procedure NotifyVisualsChanged;
|
procedure NotifyVisualsChanged;
|
||||||
/// <summary>Reakcja na zmian� zawarto�ci klasy wygl�du toolbara</summary>
|
/// <summary>Reakcja na zmianê zawartoœci klasy wygl¹du toolbara</summary>
|
||||||
procedure NotifyAppearanceChanged;
|
procedure NotifyAppearanceChanged;
|
||||||
/// <summary>Metoda zwraca instancj� pomocniczej bitmapy</summary>
|
/// <summary>Metoda zwraca instancjê pomocniczej bitmapy</summary>
|
||||||
function GetTempBitmap : TBitmap;
|
function GetTempBitmap : TBitmap;
|
||||||
|
|
||||||
// ********************************
|
// ********************************
|
||||||
@ -278,52 +278,52 @@ type TSpkToolbar = class;
|
|||||||
// *** Rysowanie ***
|
// *** Rysowanie ***
|
||||||
// *****************
|
// *****************
|
||||||
|
|
||||||
/// <summary>Metoda odrysowuje zawarto�� komponentu</summary>
|
/// <summary>Metoda odrysowuje zawartoϾ komponentu</summary>
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
/// <summary>Metoda wymusza przebudowanie metryk i bufora</summary>
|
/// <summary>Metoda wymusza przebudowanie metryk i bufora</summary>
|
||||||
procedure ForceRepaint;
|
procedure ForceRepaint;
|
||||||
/// <summary>Metoda prze��cza komponent w tryb aktualizacji zawarto�ci
|
/// <summary>Metoda prze³¹cza komponent w tryb aktualizacji zawartoœci
|
||||||
/// poprzez zapalenie flagi FUpdating</summary>
|
/// poprzez zapalenie flagi FUpdating</summary>
|
||||||
procedure BeginUpdate;
|
procedure BeginUpdate;
|
||||||
/// <summary>Metoda wy��cza tryb aktualizacji zawarto�ci poprzez zgaszenie
|
/// <summary>Metoda wy³¹cza tryb aktualizacji zawartoœci poprzez zgaszenie
|
||||||
/// flagi FUpdating</summary>
|
/// flagi FUpdating</summary>
|
||||||
procedure EndUpdate;
|
procedure EndUpdate;
|
||||||
|
|
||||||
// *************************
|
// *************************
|
||||||
// *** Obs�uga element�w ***
|
// *** Obs³uga elementów ***
|
||||||
// *************************
|
// *************************
|
||||||
|
|
||||||
/// <summary>Metoda wywo�ywana w momencie, gdy jedna z zak�adek
|
/// <summary>Metoda wywo³ywana w momencie, gdy jedna z zak³adek
|
||||||
/// jest zwalniana</summary>
|
/// jest zwalniana</summary>
|
||||||
/// <remarks>Nie nale�y wywo�ywa� metody FreeingTab z kodu! Jest ona
|
/// <remarks>Nie nale¿y wywo³ywaæ metody FreeingTab z kodu! Jest ona
|
||||||
/// wywo�ywana wewn�trznie, a jej zadaniem jest zaktualizowanie wewn�trznej
|
/// wywo³ywana wewnêtrznie, a jej zadaniem jest zaktualizowanie wewnêtrznej
|
||||||
/// listy zak�adek.</remarks>
|
/// listy zak³adek.</remarks>
|
||||||
procedure FreeingTab(ATab : TSpkTab);
|
procedure FreeingTab(ATab : TSpkTab);
|
||||||
|
|
||||||
// **************************
|
// **************************
|
||||||
// *** Dost�p do zak�adek ***
|
// *** Dostêp do zak³adek ***
|
||||||
// **************************
|
// **************************
|
||||||
|
|
||||||
/// <summary>W�asno�� daje dost� do zak�adek w trybie runtime. Do edycji
|
/// <summary>W³asnoœæ daje dostê do zak³adek w trybie runtime. Do edycji
|
||||||
/// zak�adek w trybie designtime s�u�y odpowiedni edytor, za� zapisywanie
|
/// zak³adek w trybie designtime s³u¿y odpowiedni edytor, zaœ zapisywanie
|
||||||
/// i odczytywanie z DFMa jest zrealizowane manualnie.</summary>
|
/// i odczytywanie z DFMa jest zrealizowane manualnie.</summary>
|
||||||
property Tabs : TSpkTabs read FTabs;
|
property Tabs : TSpkTabs read FTabs;
|
||||||
published
|
published
|
||||||
/// <summary>Kolor t�a komponentu</summary>
|
/// <summary>Kolor t³a komponentu</summary>
|
||||||
property Color : TColor read GetColor write SetColor;
|
property Color : TColor read GetColor write SetColor;
|
||||||
/// <summary>Obiekt zawieraj�cy atrybuty wygl�du toolbara</summary>
|
/// <summary>Obiekt zawieraj¹cy atrybuty wygl¹du toolbara</summary>
|
||||||
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
property Appearance : TSpkToolbarAppearance read FAppearance write SetAppearance;
|
||||||
/// <summary>Wysoko�� toolbara (tylko do odczytu)</summary>
|
/// <summary>WysokoϾ toolbara (tylko do odczytu)</summary>
|
||||||
property Height : integer read GetHeight;
|
property Height : integer read GetHeight;
|
||||||
/// <summary>Aktywna zak�adka</summary>
|
/// <summary>Aktywna zak³adka</summary>
|
||||||
property TabIndex : integer read FTabIndex write SetTabIndex;
|
property TabIndex : integer read FTabIndex write SetTabIndex;
|
||||||
/// <summary>Lista ma�ych obrazk�w</summary>
|
/// <summary>Lista ma³ych obrazków</summary>
|
||||||
property Images : TImageList read FImages write SetImages;
|
property Images : TImageList read FImages write SetImages;
|
||||||
/// <summary>Lista ma�ych obrazk�w w stanie "disabled"</summary>
|
/// <summary>Lista ma³ych obrazków w stanie "disabled"</summary>
|
||||||
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
property DisabledImages : TImageList read FDisabledImages write SetDisabledImages;
|
||||||
/// <summary>Lista du�ych obrazk�w</summary>
|
/// <summary>Lista du¿ych obrazków</summary>
|
||||||
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
property LargeImages : TImageList read FLargeImages write SetLargeImages;
|
||||||
/// <summary>Lista du�ych obrazk�w w stanie "disabled"</summary>
|
/// <summary>Lista du¿ych obrazków w stanie "disabled"</summary>
|
||||||
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
property DisabledLargeImages : TImageList read FDisabledLargeImages write SetDisabledLargeImages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -412,13 +412,13 @@ constructor TSpkToolbar.Create(AOwner: TComponent);
|
|||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
|
||||||
// Inicjacja dziedziczonych w�asno�ci
|
// Inicjacja dziedziczonych w³asnoœci
|
||||||
inherited Align:=alTop;
|
inherited Align:=alTop;
|
||||||
inherited AlignWithMargins:=true;
|
inherited AlignWithMargins:=true;
|
||||||
inherited Height:=TOOLBAR_HEIGHT;
|
inherited Height:=TOOLBAR_HEIGHT;
|
||||||
inherited Doublebuffered:=true;
|
inherited Doublebuffered:=true;
|
||||||
|
|
||||||
// Inicjacja wewn�trznych p�l danych
|
// Inicjacja wewnêtrznych pól danych
|
||||||
FToolbarDispatch:=TSpkToolbarDispatch.Create(self);
|
FToolbarDispatch:=TSpkToolbarDispatch.Create(self);
|
||||||
|
|
||||||
FBuffer:=TBitmap.create;
|
FBuffer:=TBitmap.create;
|
||||||
@ -441,7 +441,7 @@ begin
|
|||||||
FInternalUpdating:=false;
|
FInternalUpdating:=false;
|
||||||
FUpdating:=false;
|
FUpdating:=false;
|
||||||
|
|
||||||
// Inicjacja p�l
|
// Inicjacja pól
|
||||||
FAppearance:=TSpkToolbarAppearance.Create(FToolbarDispatch);
|
FAppearance:=TSpkToolbarAppearance.Create(FToolbarDispatch);
|
||||||
|
|
||||||
FTabs:=TSpkTabs.Create(self);
|
FTabs:=TSpkTabs.Create(self);
|
||||||
@ -470,7 +470,7 @@ begin
|
|||||||
|
|
||||||
FAppearance.Free;
|
FAppearance.Free;
|
||||||
|
|
||||||
// Zwalniamy wewn�trzne pola
|
// Zwalniamy wewnêtrzne pola
|
||||||
FTemporary.Free;
|
FTemporary.Free;
|
||||||
FBuffer.Free;
|
FBuffer.Free;
|
||||||
|
|
||||||
@ -536,7 +536,7 @@ procedure TSpkToolbar.InternalEndUpdate;
|
|||||||
begin
|
begin
|
||||||
FInternalUpdating:=false;
|
FInternalUpdating:=false;
|
||||||
|
|
||||||
// Po wewn�trznych zmianach od�wie�amy metryki i bufor
|
// Po wewnêtrznych zmianach odœwie¿amy metryki i bufor
|
||||||
ValidateMetrics;
|
ValidateMetrics;
|
||||||
ValidateBuffer;
|
ValidateBuffer;
|
||||||
Repaint;
|
Repaint;
|
||||||
@ -555,7 +555,7 @@ if FTabs.ListState = lsNeedsProcessing then
|
|||||||
|
|
||||||
InternalEndUpdate;
|
InternalEndUpdate;
|
||||||
|
|
||||||
// Proces wewn�trznego update'u zawsze od�wie�a na ko�cu metryki i bufor oraz
|
// Proces wewnêtrznego update'u zawsze odœwie¿a na koñcu metryki i bufor oraz
|
||||||
// odrysowuje komponent.
|
// odrysowuje komponent.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -569,8 +569,8 @@ begin
|
|||||||
|
|
||||||
inherited MouseDown(Button, Shift, X, Y);
|
inherited MouseDown(Button, Shift, X, Y);
|
||||||
|
|
||||||
// Mo�liwe, �e zosta� wci�ni�ty kolejny przycisk myszy. W takiej sytuacji
|
// Mo¿liwe, ¿e zosta³ wciœniêty kolejny przycisk myszy. W takiej sytuacji
|
||||||
// aktywny obiekt otrzymuje kolejn� notyfikacj�.
|
// aktywny obiekt otrzymuje kolejn¹ notyfikacjê.
|
||||||
if FMouseActiveElement=teTabs then
|
if FMouseActiveElement=teTabs then
|
||||||
begin
|
begin
|
||||||
TabMouseDown(Button, Shift, X, Y);
|
TabMouseDown(Button, Shift, X, Y);
|
||||||
@ -582,10 +582,10 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = teToolbarArea then
|
if FMouseActiveElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end else
|
end else
|
||||||
// Je�li nie ma aktywnego elementu, aktywnym staje si� ten, kt�ry obecnie
|
// Jeœli nie ma aktywnego elementu, aktywnym staje siê ten, który obecnie
|
||||||
// jest pod mysz�.
|
// jest pod mysz¹.
|
||||||
if FMouseActiveElement=teNone then
|
if FMouseActiveElement=teNone then
|
||||||
begin
|
begin
|
||||||
if FMouseHoverElement = teTabs then
|
if FMouseHoverElement = teTabs then
|
||||||
@ -603,7 +603,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
FMouseActiveElement:=teToolbarArea;
|
FMouseActiveElement:=teToolbarArea;
|
||||||
|
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -615,14 +615,14 @@ begin
|
|||||||
if FInternalUpdating or FUpdating then
|
if FInternalUpdating or FUpdating then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// MouseLeave nie ma szans by� zawo�ane dla obiektu aktywnego, bo po
|
// MouseLeave nie ma szans byæ zawo³ane dla obiektu aktywnego, bo po
|
||||||
// wci�ni�ciu przycisku myszy ka�dy jej ruch jest przekazywany jako
|
// wciœniêciu przycisku myszy ka¿dy jej ruch jest przekazywany jako
|
||||||
// MouseMove. Je�li mysz wyjedzie za obszar komponentu, MouseLeave
|
// MouseMove. Jeœli mysz wyjedzie za obszar komponentu, MouseLeave
|
||||||
// zostanie zawo�any zaraz po MouseUp - ale MouseUp czy�ci aktywny
|
// zostanie zawo³any zaraz po MouseUp - ale MouseUp czyœci aktywny
|
||||||
// obiekt.
|
// obiekt.
|
||||||
if FMouseActiveElement = teNone then
|
if FMouseActiveElement = teNone then
|
||||||
begin
|
begin
|
||||||
// Je�li nie ma obiektu aktywnego, obs�ugujemy elementy pod mysz�
|
// Jeœli nie ma obiektu aktywnego, obs³ugujemy elementy pod mysz¹
|
||||||
if FMouseHoverElement = teTabs then
|
if FMouseHoverElement = teTabs then
|
||||||
begin
|
begin
|
||||||
TabMouseLeave;
|
TabMouseLeave;
|
||||||
@ -634,7 +634,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement = teToolbarArea then
|
if FMouseHoverElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li b�dzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli bêdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -653,7 +653,7 @@ begin
|
|||||||
|
|
||||||
inherited MouseMove(Shift, X, Y);
|
inherited MouseMove(Shift, X, Y);
|
||||||
|
|
||||||
// Sprawdzamy, kt�ry obiekt jest pod mysz�
|
// Sprawdzamy, który obiekt jest pod mysz¹
|
||||||
MousePoint:=T2DIntVector.create(x,y);
|
MousePoint:=T2DIntVector.create(x,y);
|
||||||
|
|
||||||
if FTabClipRect.Contains(MousePoint) then
|
if FTabClipRect.Contains(MousePoint) then
|
||||||
@ -664,7 +664,7 @@ begin
|
|||||||
NewMouseHoverElement:=teToolbarArea else
|
NewMouseHoverElement:=teToolbarArea else
|
||||||
NewMouseHoverElement:=teNone;
|
NewMouseHoverElement:=teNone;
|
||||||
|
|
||||||
// Je�li jest jaki� aktywny obiekt, to on ma wy��czno�� na komunikaty
|
// Jeœli jest jakiœ aktywny obiekt, to on ma wy³¹cznoœæ na komunikaty
|
||||||
if FMouseActiveElement = teTabs then
|
if FMouseActiveElement = teTabs then
|
||||||
begin
|
begin
|
||||||
TabMouseMove(Shift, X, Y);
|
TabMouseMove(Shift, X, Y);
|
||||||
@ -676,12 +676,12 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = teToolbarArea then
|
if FMouseActiveElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end else
|
end else
|
||||||
if FMouseActiveElement = teNone then
|
if FMouseActiveElement = teNone then
|
||||||
begin
|
begin
|
||||||
// Je�li element pod mysz� si� zmienia, informujemy poprzedni element o
|
// Jeœli element pod mysz¹ siê zmienia, informujemy poprzedni element o
|
||||||
// tym, �e mysz opuszcza jego obszar
|
// tym, ¿e mysz opuszcza jego obszar
|
||||||
if NewMouseHoverElement<>FMouseHoverElement then
|
if NewMouseHoverElement<>FMouseHoverElement then
|
||||||
begin
|
begin
|
||||||
if FMouseHoverElement = teTabs then
|
if FMouseHoverElement = teTabs then
|
||||||
@ -695,11 +695,11 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement = teToolbarArea then
|
if FMouseHoverElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Element pod mysz� otrzymuje MouseMove
|
// Element pod mysz¹ otrzymuje MouseMove
|
||||||
if NewMouseHoverElement = teTabs then
|
if NewMouseHoverElement = teTabs then
|
||||||
begin
|
begin
|
||||||
TabMouseMove(Shift, X, Y);
|
TabMouseMove(Shift, X, Y);
|
||||||
@ -711,7 +711,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
if NewMouseHoverElement = teToolbarArea then
|
if NewMouseHoverElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -732,8 +732,8 @@ begin
|
|||||||
|
|
||||||
ClearActive:=not(ssLeft in Shift) and not(ssMiddle in Shift) and not(ssRight in Shift);
|
ClearActive:=not(ssLeft in Shift) and not(ssMiddle in Shift) and not(ssRight in Shift);
|
||||||
|
|
||||||
// Je�li jest jaki� aktywny obiekt, to on ma wy��czno�� na otrzymywanie
|
// Jeœli jest jakiœ aktywny obiekt, to on ma wy³¹cznoœæ na otrzymywanie
|
||||||
// komunikat�w
|
// komunikatów
|
||||||
if FMouseActiveElement=teTabs then
|
if FMouseActiveElement=teTabs then
|
||||||
begin
|
begin
|
||||||
TabMouseUp(Button, Shift, X, Y);
|
TabMouseUp(Button, Shift, X, Y);
|
||||||
@ -745,12 +745,12 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = teToolbarArea then
|
if FMouseActiveElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Je�li puszczono ostatni przycisk i mysz nie znajduje si� nad aktywnym
|
// Jeœli puszczono ostatni przycisk i mysz nie znajduje siê nad aktywnym
|
||||||
// obiektem, trzeba dodatkowo wywo�a� MouseLeave dla aktywnego i MouseMove
|
// obiektem, trzeba dodatkowo wywo³aæ MouseLeave dla aktywnego i MouseMove
|
||||||
// dla obiektu pod mysz�.
|
// dla obiektu pod mysz¹.
|
||||||
if ClearActive and (FMouseActiveElement<>FMouseHoverElement) then
|
if ClearActive and (FMouseActiveElement<>FMouseHoverElement) then
|
||||||
begin
|
begin
|
||||||
if FMouseActiveElement = teTabs then
|
if FMouseActiveElement = teTabs then
|
||||||
@ -762,7 +762,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = teToolbarArea then
|
if FMouseActiveElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FMouseHoverElement=teTabs then
|
if FMouseHoverElement=teTabs then
|
||||||
@ -774,11 +774,11 @@ begin
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement = teToolbarArea then
|
if FMouseHoverElement = teToolbarArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// MouseUp gasi aktywny obiekt, o ile zosta�y puszczone wszystkie
|
// MouseUp gasi aktywny obiekt, o ile zosta³y puszczone wszystkie
|
||||||
// przyciski
|
// przyciski
|
||||||
if ClearActive then
|
if ClearActive then
|
||||||
FMouseActiveElement:=teNone;
|
FMouseActiveElement:=teNone;
|
||||||
@ -842,8 +842,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
FTabIndex:=max(0,min(FTabs.count-1,FTabIndex));
|
FTabIndex:=max(0,min(FTabs.count-1,FTabIndex));
|
||||||
|
|
||||||
// Wiem, �e przynajmniej jedna zak�adka jest widoczna (z wcze�niejszego
|
// Wiem, ¿e przynajmniej jedna zak³adka jest widoczna (z wczeœniejszego
|
||||||
// warunku), wi�c poni�sza p�tla na pewno si� zako�czy.
|
// warunku), wiêc poni¿sza pêtla na pewno siê zakoñczy.
|
||||||
while not(FTabs[FTabIndex].Visible) do
|
while not(FTabs[FTabIndex].Visible) do
|
||||||
FTabIndex:=(FTabIndex + 1) mod FTabs.count;
|
FTabIndex:=(FTabIndex + 1) mod FTabs.count;
|
||||||
end;
|
end;
|
||||||
@ -866,9 +866,9 @@ end;
|
|||||||
procedure TSpkToolbar.Paint;
|
procedure TSpkToolbar.Paint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Je�li trwa proces przebudowy (wewn�trznej lub u�ytkownika), walidacja metryk
|
// Jeœli trwa proces przebudowy (wewnêtrznej lub u¿ytkownika), walidacja metryk
|
||||||
// i bufora nie jest przeprowadzana, jednak bufor jest rysowany w takiej
|
// i bufora nie jest przeprowadzana, jednak bufor jest rysowany w takiej
|
||||||
// postaci, w jakiej zosta� zapami�tany przed rozpocz�ciem procesu przebudowy.
|
// postaci, w jakiej zosta³ zapamiêtany przed rozpoczêciem procesu przebudowy.
|
||||||
if not(FInternalUpdating or FUpdating) then
|
if not(FInternalUpdating or FUpdating) then
|
||||||
begin
|
begin
|
||||||
if not(FMetricsValid) then
|
if not(FMetricsValid) then
|
||||||
@ -960,8 +960,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
FTabIndex:=max(0,min(FTabs.count-1, Value));
|
FTabIndex:=max(0,min(FTabs.count-1, Value));
|
||||||
|
|
||||||
// Wiem, �e przynajmniej jedna zak�adka jest widoczna (z wcze�niejszego
|
// Wiem, ¿e przynajmniej jedna zak³adka jest widoczna (z wczeœniejszego
|
||||||
// warunku), wi�c poni�sza p�tla na pewno si� zako�czy.
|
// warunku), wiêc poni¿sza pêtla na pewno siê zakoñczy.
|
||||||
while not(FTabs[FTabIndex].Visible) do
|
while not(FTabs[FTabIndex].Visible) do
|
||||||
FTabIndex:=(FTabIndex + 1) mod FTabs.count;
|
FTabIndex:=(FTabIndex + 1) mod FTabs.count;
|
||||||
end;
|
end;
|
||||||
@ -995,8 +995,8 @@ if AtLeastOneTabVisible then
|
|||||||
SelTab:=i;
|
SelTab:=i;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Je�li klikni�ta zosta�a kt�ra� zak�adka, r��na od obecnie zaznaczonej,
|
// Jeœli klikniêta zosta³a któraœ zak³adka, ró¿na od obecnie zaznaczonej,
|
||||||
// zmie� zaznaczenie.
|
// zmieñ zaznaczenie.
|
||||||
if (Button = mbLeft) and (SelTab<>-1) and (SelTab<>FTabIndex) then
|
if (Button = mbLeft) and (SelTab<>-1) and (SelTab<>FTabIndex) then
|
||||||
begin
|
begin
|
||||||
FTabIndex:=SelTab;
|
FTabIndex:=SelTab;
|
||||||
@ -1055,7 +1055,7 @@ begin
|
|||||||
if FInternalUpdating or FUpdating then
|
if FInternalUpdating or FUpdating then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Zak�adki nie potrzebuj� obs�ugi MouseUp.
|
// Zak³adki nie potrzebuj¹ obs³ugi MouseUp.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpkToolbar.SetAppearance(const Value: TSpkToolbarAppearance);
|
procedure TSpkToolbar.SetAppearance(const Value: TSpkToolbarAppearance);
|
||||||
@ -1083,8 +1083,8 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Pobieramy appearance aktualnie zaznaczonej zak�adki (b�d�
|
// Pobieramy appearance aktualnie zaznaczonej zak³adki (b¹dŸ
|
||||||
// FToolbarAppearance, je�li zaznaczona zak�adka nie ma ustawionego
|
// FToolbarAppearance, jeœli zaznaczona zak³adka nie ma ustawionego
|
||||||
// OverrideAppearance
|
// OverrideAppearance
|
||||||
if (FTabIndex<>-1) and (FTabs[FTabIndex].OverrideAppearance) then
|
if (FTabIndex<>-1) and (FTabs[FTabIndex].OverrideAppearance) then
|
||||||
FocusedAppearance:=FTabs[FTabIndex].CustomAppearance else
|
FocusedAppearance:=FTabs[FTabIndex].CustomAppearance else
|
||||||
@ -1125,18 +1125,18 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
|
|
||||||
if not(AtLeastOneTabVisible) then
|
if not(AtLeastOneTabVisible) then
|
||||||
begin
|
begin
|
||||||
// Je�li nie ma zak�adek, rysujemy poziom� lini�
|
// Jeœli nie ma zak³adek, rysujemy poziom¹ liniê
|
||||||
TGuiTools.DrawHLine(FBuffer, TOOLBAR_CORNER_RADIUS, self.width - TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
TGuiTools.DrawHLine(FBuffer, TOOLBAR_CORNER_RADIUS, self.width - TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Je�li s�, pozostawiamy miejsce na zak�adki
|
// Jeœli s¹, pozostawiamy miejsce na zak³adki
|
||||||
// Szukamy ostatniej widocznej
|
// Szukamy ostatniej widocznej
|
||||||
i:=FTabs.count-1;
|
i:=FTabs.count-1;
|
||||||
while not(FTabs[i].Visible) do
|
while not(FTabs[i].Visible) do
|
||||||
dec(i);
|
dec(i);
|
||||||
|
|
||||||
// Tylko prawa cz���, reszta b�dzie narysowana wraz z zak�adkami
|
// Tylko prawa czêœæ, reszta bêdzie narysowana wraz z zak³adkami
|
||||||
if FTabRects[i].Right<self.width - TOOLBAR_CORNER_RADIUS - 1 then
|
if FTabRects[i].Right<self.width - TOOLBAR_CORNER_RADIUS - 1 then
|
||||||
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right+1, self.width - TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
TGuiTools.DrawHLine(FBuffer, FTabRects[i].Right+1, self.width - TOOLBAR_CORNER_RADIUS, TOOLBAR_TAB_CAPTIONS_HEIGHT, FocusedAppearance.Tab.BorderColor);
|
||||||
end;
|
end;
|
||||||
@ -1178,17 +1178,17 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
TmpRegion, TmpRegion2 : HRGN;
|
TmpRegion, TmpRegion2 : HRGN;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// * Notatka! * Zak�adki zachodz� jednym pikslem na obszar toolbara,
|
// * Notatka! * Zak³adki zachodz¹ jednym pikslem na obszar toolbara,
|
||||||
// poniewa� musz� narysowa� kraw�d�, kt�ra zgra si� z kraw�dzi� obszaru.
|
// poniewa¿ musz¹ narysowaæ krawêdŸ, która zgra siê z krawêdzi¹ obszaru.
|
||||||
TabRect:=FTabRects[index];
|
TabRect:=FTabRects[index];
|
||||||
|
|
||||||
// �rodkowy prostok�t
|
// Œrodkowy prostok¹t
|
||||||
TabRegion:=CreateRectRgn(TabRect.Left + TAB_CORNER_RADIUS - 1,
|
TabRegion:=CreateRectRgn(TabRect.Left + TAB_CORNER_RADIUS - 1,
|
||||||
TabRect.Top + TAB_CORNER_RADIUS,
|
TabRect.Top + TAB_CORNER_RADIUS,
|
||||||
TabRect.Right - TAB_CORNER_RADIUS + 1 + 1,
|
TabRect.Right - TAB_CORNER_RADIUS + 1 + 1,
|
||||||
TabRect.Bottom + 1);
|
TabRect.Bottom + 1);
|
||||||
|
|
||||||
// G�rna cz��� z g�rnymi zaokr�gleniami wypuk�ymi
|
// Górna czêœæ z górnymi zaokr¹gleniami wypuk³ymi
|
||||||
TmpRegion:=CreateRectRgn(TabRect.Left + 2*TAB_CORNER_RADIUS - 1,
|
TmpRegion:=CreateRectRgn(TabRect.Left + 2*TAB_CORNER_RADIUS - 1,
|
||||||
TabRect.Top,
|
TabRect.Top,
|
||||||
TabRect.Right - 2*TAB_CORNER_RADIUS + 1 + 1,
|
TabRect.Right - 2*TAB_CORNER_RADIUS + 1 + 1,
|
||||||
@ -1210,7 +1210,7 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
CombineRgn(TabRegion, TabRegion, TmpRegion, RGN_OR);
|
||||||
DeleteObject(TmpRegion);
|
DeleteObject(TmpRegion);
|
||||||
|
|
||||||
// Dolna cz��� z dolnymi zaokr�gleniami wkl�s�ymi
|
// Dolna czêœæ z dolnymi zaokr¹gleniami wklês³ymi
|
||||||
|
|
||||||
TmpRegion:=CreateRectRgn(TabRect.Left,
|
TmpRegion:=CreateRectRgn(TabRect.Left,
|
||||||
TabRect.Bottom - TAB_CORNER_RADIUS,
|
TabRect.Bottom - TAB_CORNER_RADIUS,
|
||||||
@ -1308,10 +1308,10 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Zak�adam, �e zak�adki maj� rozs�dne rozmiary
|
// Zak³adam, ¿e zak³adki maj¹ rozs¹dne rozmiary
|
||||||
|
|
||||||
// Pobieramy appearance aktualnie zaznaczonej zak�adki (jej appearance, je�li
|
// Pobieramy appearance aktualnie zaznaczonej zak³adki (jej appearance, jeœli
|
||||||
// ma zapalon� flag� OverrideAppearance, FToolbarAppearance w przeciwnym
|
// ma zapalon¹ flagê OverrideAppearance, FToolbarAppearance w przeciwnym
|
||||||
// wypadku)
|
// wypadku)
|
||||||
if (FTabIndex<>-1) and (FTabs[FTabIndex].OverrideAppearance) then
|
if (FTabIndex<>-1) and (FTabs[FTabIndex].OverrideAppearance) then
|
||||||
FocusedAppearance:=FTabs[FTabIndex].CustomAppearance else
|
FocusedAppearance:=FTabs[FTabIndex].CustomAppearance else
|
||||||
@ -1321,18 +1321,18 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
for i := 0 to FTabs.count - 1 do
|
for i := 0 to FTabs.count - 1 do
|
||||||
if FTabs[i].Visible then
|
if FTabs[i].Visible then
|
||||||
begin
|
begin
|
||||||
// Jest sens rysowa�?
|
// Jest sens rysowaæ?
|
||||||
if not(FTabClipRect.IntersectsWith(FTabRects[i])) then
|
if not(FTabClipRect.IntersectsWith(FTabRects[i])) then
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Pobieramy appearance rysowanej w�a�nie zak�adki
|
// Pobieramy appearance rysowanej w³aœnie zak³adki
|
||||||
if (FTabs[i].OverrideAppearance) then
|
if (FTabs[i].OverrideAppearance) then
|
||||||
CurrentAppearance:=FTabs[i].CustomAppearance else
|
CurrentAppearance:=FTabs[i].CustomAppearance else
|
||||||
CurrentAppearance:=FAppearance;
|
CurrentAppearance:=FAppearance;
|
||||||
|
|
||||||
TabRect:=FTabRects[i];
|
TabRect:=FTabRects[i];
|
||||||
|
|
||||||
// Rysujemy zak�adk�
|
// Rysujemy zak³adkê
|
||||||
if i = FTabIndex then
|
if i = FTabIndex then
|
||||||
begin
|
begin
|
||||||
if i = FTabHover then
|
if i = FTabHover then
|
||||||
@ -1366,8 +1366,8 @@ procedure TSpkToolbar.ValidateBuffer;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Dolna kreska
|
// Dolna kreska
|
||||||
// Uwaga: Niezale�nie od zak�adki rysowana kolorem appearance
|
// Uwaga: Niezale¿nie od zak³adki rysowana kolorem appearance
|
||||||
// aktualnie zaznaczonej zak�adki!
|
// aktualnie zaznaczonej zak³adki!
|
||||||
DrawBottomLine(i, FocusedAppearance.Tab.BorderColor);
|
DrawBottomLine(i, FocusedAppearance.Tab.BorderColor);
|
||||||
|
|
||||||
// Tekst
|
// Tekst
|
||||||
@ -1389,21 +1389,21 @@ if FInternalUpdating or FUpdating then
|
|||||||
if FBufferValid then
|
if FBufferValid then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// ValidateBuffer mo�e by� wywo�ane tylko wtedy, gdy metrics zosta�y obliczone.
|
// ValidateBuffer mo¿e byæ wywo³ane tylko wtedy, gdy metrics zosta³y obliczone.
|
||||||
// Metoda zak�ada, �e bufor ma ju� odpowiednie rozmiary oraz �e wszystkie
|
// Metoda zak³ada, ¿e bufor ma ju¿ odpowiednie rozmiary oraz ¿e wszystkie
|
||||||
// recty, zar�wno toolbara jak i element�w podrz�dnych, zosta�y poprawnie
|
// recty, zarówno toolbara jak i elementów podrzêdnych, zosta³y poprawnie
|
||||||
// obliczone.
|
// obliczone.
|
||||||
|
|
||||||
// *** T�o komponentu ***
|
// *** T³o komponentu ***
|
||||||
DrawBackgroundColor;
|
DrawBackgroundColor;
|
||||||
|
|
||||||
// *** Generowanie t�a dla toolbara ***
|
// *** Generowanie t³a dla toolbara ***
|
||||||
DrawBody;
|
DrawBody;
|
||||||
|
|
||||||
// *** Zak�adki ***
|
// *** Zak³adki ***
|
||||||
DrawTabs;
|
DrawTabs;
|
||||||
|
|
||||||
// *** Zawarto�� zak�adek ***
|
// *** Zawartoœæ zak³adek ***
|
||||||
DrawTabContents;
|
DrawTabContents;
|
||||||
|
|
||||||
// Bufor jest poprawny
|
// Bufor jest poprawny
|
||||||
@ -1425,15 +1425,15 @@ if FMetricsValid then
|
|||||||
|
|
||||||
FBuffer.SetSize(self.width, self.height);
|
FBuffer.SetSize(self.width, self.height);
|
||||||
|
|
||||||
// *** Zak�adki ***
|
// *** Zak³adki ***
|
||||||
|
|
||||||
// Cliprect zak�adek (zawg�rn� ramk� komponentu)
|
// Cliprect zak³adek (zawgórn¹ ramkê komponentu)
|
||||||
FTabClipRect:=T2DIntRect.Create(TOOLBAR_CORNER_RADIUS,
|
FTabClipRect:=T2DIntRect.Create(TOOLBAR_CORNER_RADIUS,
|
||||||
0,
|
0,
|
||||||
self.width - TOOLBAR_CORNER_RADIUS - 1,
|
self.width - TOOLBAR_CORNER_RADIUS - 1,
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT);
|
TOOLBAR_TAB_CAPTIONS_HEIGHT);
|
||||||
|
|
||||||
// Recty nag��wk�w zak�adek (zawieraj� g�rn� ramk� komponentu)
|
// Recty nag³ówków zak³adek (zawieraj¹ górn¹ ramkê komponentu)
|
||||||
setlength(FTabRects, FTabs.Count);
|
setlength(FTabRects, FTabs.Count);
|
||||||
if FTabs.count>0 then
|
if FTabs.count>0 then
|
||||||
begin
|
begin
|
||||||
@ -1441,17 +1441,17 @@ if FTabs.count>0 then
|
|||||||
for i := 0 to FTabs.count - 1 do
|
for i := 0 to FTabs.count - 1 do
|
||||||
if FTabs[i].Visible then
|
if FTabs[i].Visible then
|
||||||
begin
|
begin
|
||||||
// Pobieramy appearance zak�adki
|
// Pobieramy appearance zak³adki
|
||||||
if FTabs[i].OverrideAppearance then
|
if FTabs[i].OverrideAppearance then
|
||||||
TabAppearance:=FTabs[i].CustomAppearance else
|
TabAppearance:=FTabs[i].CustomAppearance else
|
||||||
TabAppearance:=FAppearance;
|
TabAppearance:=FAppearance;
|
||||||
FBuffer.Canvas.font.assign(TabAppearance.Tab.TabHeaderFont);
|
FBuffer.Canvas.font.assign(TabAppearance.Tab.TabHeaderFont);
|
||||||
|
|
||||||
TabWidth:=2 + // Ramka
|
TabWidth:=2 + // Ramka
|
||||||
2*TAB_CORNER_RADIUS + // Zaokr�glenia
|
2*TAB_CORNER_RADIUS + // Zaokr¹glenia
|
||||||
2*TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING + // Wewn�trzne marginesy
|
2*TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING + // Wewnêtrzne marginesy
|
||||||
max(TOOLBAR_MIN_TAB_CAPTION_WIDTH,
|
max(TOOLBAR_MIN_TAB_CAPTION_WIDTH,
|
||||||
FBuffer.Canvas.TextWidth(FTabs.Items[i].Caption)); // Szeroko�� tekstu
|
FBuffer.Canvas.TextWidth(FTabs.Items[i].Caption)); // SzerokoϾ tekstu
|
||||||
|
|
||||||
FTabRects[i].Left:=x;
|
FTabRects[i].Left:=x;
|
||||||
FTabRects[i].Right:=x + TabWidth - 1;
|
FTabRects[i].Right:=x + TabWidth - 1;
|
||||||
@ -1470,7 +1470,7 @@ if FTabs.count>0 then
|
|||||||
|
|
||||||
if FTabIndex<>-1 then
|
if FTabIndex<>-1 then
|
||||||
begin
|
begin
|
||||||
// Rect obszaru zak�adki
|
// Rect obszaru zak³adki
|
||||||
FTabContentsClipRect:=T2DIntRect.Create(TOOLBAR_BORDER_WIDTH + TAB_PANE_LEFTPADDING,
|
FTabContentsClipRect:=T2DIntRect.Create(TOOLBAR_BORDER_WIDTH + TAB_PANE_LEFTPADDING,
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT + TOOLBAR_BORDER_WIDTH + TAB_PANE_TOPPADDING,
|
TOOLBAR_TAB_CAPTIONS_HEIGHT + TOOLBAR_BORDER_WIDTH + TAB_PANE_TOPPADDING,
|
||||||
self.width - 1 - TOOLBAR_BORDER_WIDTH - TAB_PANE_RIGHTPADDING,
|
self.width - 1 - TOOLBAR_BORDER_WIDTH - TAB_PANE_RIGHTPADDING,
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Appearance;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Appearance.pas *
|
* Plik: spkt_Appearance.pas *
|
||||||
* Opis: Klasy bazowe dla klas wygl�du element�w toolbara *
|
* Opis: Klasy bazowe dla klas wygl¹du elementów toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -35,7 +35,7 @@ type TSpkTabAppearance = class(TPersistent)
|
|||||||
procedure SetGradientType(const Value: TBackgroundKind);
|
procedure SetGradientType(const Value: TBackgroundKind);
|
||||||
public
|
public
|
||||||
// *** Konstruktor, destruktor, assign ***
|
// *** Konstruktor, destruktor, assign ***
|
||||||
// <remarks>Appearance musi mie� assign, bo wyst�puje jako w�asno��
|
// <remarks>Appearance musi mieæ assign, bo wystêpuje jako w³asnoœæ
|
||||||
// opublikowana.</remarks>
|
// opublikowana.</remarks>
|
||||||
procedure Assign(Source : TPersistent); override;
|
procedure Assign(Source : TPersistent); override;
|
||||||
constructor Create(ADispatch : TSpkBaseAppearanceDispatch);
|
constructor Create(ADispatch : TSpkBaseAppearanceDispatch);
|
||||||
@ -229,7 +229,7 @@ begin
|
|||||||
if FDispatch<>nil then
|
if FDispatch<>nil then
|
||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end else
|
end else
|
||||||
raise AssignException.create('TSpkToolbarAppearance.Assign: Nie mog� przypisa� obiektu '+Source.ClassName+' do TSpkToolbarAppearance!');
|
raise AssignException.create('TSpkToolbarAppearance.Assign: Nie mogê przypisaæ obiektu '+Source.ClassName+' do TSpkToolbarAppearance!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSpkTabAppearance.Create(
|
constructor TSpkTabAppearance.Create(
|
||||||
@ -397,7 +397,7 @@ begin
|
|||||||
if FDispatch<>nil then
|
if FDispatch<>nil then
|
||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end else
|
end else
|
||||||
raise AssignException.create('TSpkPaneAppearance.Assign: Nie mog� przypisa� obiektu '+Source.ClassName+' do TSpkPaneAppearance!');
|
raise AssignException.create('TSpkPaneAppearance.Assign: Nie mogê przypisaæ obiektu '+Source.ClassName+' do TSpkPaneAppearance!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSpkPaneAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
constructor TSpkPaneAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
||||||
@ -610,7 +610,7 @@ begin
|
|||||||
if FDispatch<>nil then
|
if FDispatch<>nil then
|
||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end else
|
end else
|
||||||
raise AssignException.create('TSpkElementAppearance.Assign: Nie mog� przypisa� obiektu '+Source.ClassName+' do TSpkElementAppearance!');
|
raise AssignException.create('TSpkElementAppearance.Assign: Nie mogê przypisaæ obiektu '+Source.ClassName+' do TSpkElementAppearance!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSpkElementAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
constructor TSpkElementAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
||||||
@ -1075,7 +1075,7 @@ begin
|
|||||||
if FDispatch<>nil then
|
if FDispatch<>nil then
|
||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end else
|
end else
|
||||||
raise AssignException.create('TSpkToolbarAppearance.Assign: Nie mog� przypisa� obiektu '+Source.ClassName+' do TSpkToolbarAppearance!');
|
raise AssignException.create('TSpkToolbarAppearance.Assign: Nie mogê przypisaæ obiektu '+Source.ClassName+' do TSpkToolbarAppearance!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSpkToolbarAppearance.Create(ADispatch : TSpkBaseAppearanceDispatch);
|
constructor TSpkToolbarAppearance.Create(ADispatch : TSpkBaseAppearanceDispatch);
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_BaseItem;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_BaseItem.pas *
|
* Plik: spkt_BaseItem.pas *
|
||||||
* Opis: Modu� zawieraj�cy bazow� klas� dla elementu tafli. *
|
* Opis: Modu³ zawieraj¹cy bazow¹ klasê dla elementu tafli. *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -94,7 +94,7 @@ end;
|
|||||||
|
|
||||||
destructor TSpkBaseItem.Destroy;
|
destructor TSpkBaseItem.Destroy;
|
||||||
begin
|
begin
|
||||||
{ Pozosta�e operacje }
|
{ Pozosta³e operacje }
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Buttons;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Buttons.pas *
|
* Plik: spkt_Buttons.pas *
|
||||||
* Opis: Modu� zawieraj�cy komponenty przycisk�w dla toolbara. *
|
* Opis: Modu³ zawieraj¹cy komponenty przycisków dla toolbara. *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -60,15 +60,15 @@ type TSpkBaseButton = class;
|
|||||||
FButtonKind : TSpkButtonKind;
|
FButtonKind : TSpkButtonKind;
|
||||||
FDropdownMenu : TPopupMenu;
|
FDropdownMenu : TPopupMenu;
|
||||||
|
|
||||||
// *** Obs�uga rysowania ***
|
// *** Obs³uga rysowania ***
|
||||||
|
|
||||||
/// <summary>Zadaniem metody w odziedziczonych klasach jest obliczenie
|
/// <summary>Zadaniem metody w odziedziczonych klasach jest obliczenie
|
||||||
/// rect�w przycisku i menu dropdown w zale�no�ci od FButtonState</summary>
|
/// rectów przycisku i menu dropdown w zale¿noœci od FButtonState</summary>
|
||||||
procedure CalcRects; virtual; abstract;
|
procedure CalcRects; virtual; abstract;
|
||||||
|
|
||||||
function GetDropdownPoint : T2DIntPoint; virtual; abstract;
|
function GetDropdownPoint : T2DIntPoint; virtual; abstract;
|
||||||
|
|
||||||
// *** Obs�uga akcji ***
|
// *** Obs³uga akcji ***
|
||||||
|
|
||||||
procedure ActionChange(Sender : TObject);
|
procedure ActionChange(Sender : TObject);
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ procedure TSpkBaseButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
|
|||||||
begin
|
begin
|
||||||
if FEnabled then
|
if FEnabled then
|
||||||
begin
|
begin
|
||||||
// Przyciski reaguj� tylko na lewy przycisk myszy
|
// Przyciski reaguj¹ tylko na lewy przycisk myszy
|
||||||
if Button <> mbLeft then
|
if Button <> mbLeft then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -324,11 +324,11 @@ if FEnabled then
|
|||||||
begin
|
begin
|
||||||
if FMouseHoverElement = beButton then
|
if FMouseHoverElement = beButton then
|
||||||
begin
|
begin
|
||||||
// Placeholder, gdyby zasz�a potrzeba obs�ugi tego zdarzenia
|
// Placeholder, gdyby zasz³a potrzeba obs³ugi tego zdarzenia
|
||||||
end else
|
end else
|
||||||
if FMouseHoverElement = beDropdown then
|
if FMouseHoverElement = beDropdown then
|
||||||
begin
|
begin
|
||||||
// Placeholder, gdyby zasz�a potrzeba obs�ugi tego zdarzenia
|
// Placeholder, gdyby zasz³a potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -399,8 +399,8 @@ if FEnabled then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = beNone then
|
if FMouseActiveElement = beNone then
|
||||||
begin
|
begin
|
||||||
// Z uwagi na uproszczon� obs�ug� myszy w przycisku, nie ma potrzeby
|
// Z uwagi na uproszczon¹ obs³ugê myszy w przycisku, nie ma potrzeby
|
||||||
// informowa� poprzedniego elementu o tym, �e mysz opu�ci�a jego obszar.
|
// informowaæ poprzedniego elementu o tym, ¿e mysz opuœci³a jego obszar.
|
||||||
|
|
||||||
if NewMouseHoverElement = beButton then
|
if NewMouseHoverElement = beButton then
|
||||||
begin
|
begin
|
||||||
@ -447,7 +447,7 @@ var ClearActive : boolean;
|
|||||||
begin
|
begin
|
||||||
if FEnabled then
|
if FEnabled then
|
||||||
begin
|
begin
|
||||||
// Przyciski reaguj� tylko na lewy przycisk myszy
|
// Przyciski reaguj¹ tylko na lewy przycisk myszy
|
||||||
if Button <> mbLeft then
|
if Button <> mbLeft then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ if FEnabled then
|
|||||||
|
|
||||||
if FMouseActiveElement = beButton then
|
if FMouseActiveElement = beButton then
|
||||||
begin
|
begin
|
||||||
// Zdarzenie zadzia�a tylko wtedy, gdy przycisk myszy zosta� puszczony nad
|
// Zdarzenie zadzia³a tylko wtedy, gdy przycisk myszy zosta³ puszczony nad
|
||||||
// przyciskiem
|
// przyciskiem
|
||||||
if FMouseHoverElement = beButton then
|
if FMouseHoverElement = beButton then
|
||||||
begin
|
begin
|
||||||
@ -476,7 +476,7 @@ if FEnabled then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement = beDropDown then
|
if FMouseActiveElement = beDropDown then
|
||||||
begin
|
begin
|
||||||
// Zdarzenie zadzia�a tylko wtedy, gdy przycisk myszy zosta� puszczony nad
|
// Zdarzenie zadzia³a tylko wtedy, gdy przycisk myszy zosta³ puszczony nad
|
||||||
// przyciskiem DropDown
|
// przyciskiem DropDown
|
||||||
|
|
||||||
if FMouseHoverElement = beDropDown then
|
if FMouseHoverElement = beDropDown then
|
||||||
@ -491,8 +491,8 @@ if FEnabled then
|
|||||||
|
|
||||||
if (ClearActive) and (FMouseActiveElement<>FMouseHoverElement) then
|
if (ClearActive) and (FMouseActiveElement<>FMouseHoverElement) then
|
||||||
begin
|
begin
|
||||||
// Z uwagi na uproszczon� obs�ug�, nie ma potrzeby informowa� poprzedniego
|
// Z uwagi na uproszczon¹ obs³ugê, nie ma potrzeby informowaæ poprzedniego
|
||||||
// elementu o tym, �e mysz opu�ci�a jego obszar.
|
// elementu o tym, ¿e mysz opuœci³a jego obszar.
|
||||||
|
|
||||||
if FMouseHoverElement = beButton then
|
if FMouseHoverElement = beButton then
|
||||||
begin
|
begin
|
||||||
@ -585,9 +585,9 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
// Je�li przycisk zosta� wy��czony, zostaje natychmiast prze��czony
|
// Jeœli przycisk zosta³ wy³¹czony, zostaje natychmiast prze³¹czony
|
||||||
// w stan Idle i zerowane s� elementy aktywne i pod mysz�. Je�li zosta�
|
// w stan Idle i zerowane s¹ elementy aktywne i pod mysz¹. Jeœli zosta³
|
||||||
// w��czony, jego stan zmieni si� podczas pierwszej akcji myszy.
|
// w³¹czony, jego stan zmieni siê podczas pierwszej akcji myszy.
|
||||||
|
|
||||||
FMouseHoverElement:=beNone;
|
FMouseHoverElement:=beNone;
|
||||||
FMouseActiveElement:=beNone;
|
FMouseActiveElement:=beNone;
|
||||||
@ -660,22 +660,22 @@ if (FRect.width<2*LARGEBUTTON_RADIUS) or (FRect.Height<2*LARGEBUTTON_RADIUS) the
|
|||||||
if FButtonKind in [bkButton, bkDropdown] then
|
if FButtonKind in [bkButton, bkDropdown] then
|
||||||
begin
|
begin
|
||||||
{$REGION 'Tryb bez dodatkowego przycisku z rozwijanym menu'}
|
{$REGION 'Tryb bez dodatkowego przycisku z rozwijanym menu'}
|
||||||
// *** T�o ***
|
// *** T³o ***
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla disabled'}
|
{$REGION 'T³o dla disabled'}
|
||||||
// Brak t�a
|
// Brak t³a
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
if FButtonState = bsIdle then
|
if FButtonState = bsIdle then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla Idle'}
|
{$REGION 'T³o dla Idle'}
|
||||||
// Brak t�a
|
// Brak t³a
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
if FButtonState = bsBtnHottrack then
|
if FButtonState = bsBtnHottrack then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla HotTrack'}
|
{$REGION 'T³o dla HotTrack'}
|
||||||
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
||||||
T2DIntRect.Create(FButtonRect.left,
|
T2DIntRect.Create(FButtonRect.left,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
@ -704,7 +704,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
end else
|
end else
|
||||||
if FButtonState = bsBtnPressed then
|
if FButtonState = bsBtnPressed then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla Pressed'}
|
{$REGION 'T³o dla Pressed'}
|
||||||
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
||||||
T2DIntRect.Create(FButtonRect.left,
|
T2DIntRect.Create(FButtonRect.left,
|
||||||
FButtonRect.Top,
|
FButtonRect.Top,
|
||||||
@ -732,12 +732,12 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
ClipRect);
|
ClipRect);
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
raise InternalException.create('TSpkLargeButton.Draw: Nieprawid�owa warto�� FButtonState!');
|
raise InternalException.create('TSpkLargeButton.Draw: Nieprawid³owa wartoœæ FButtonState!');
|
||||||
|
|
||||||
// *** Ikona ***
|
// *** Ikona ***
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona wy��czona'}
|
{$REGION 'Ikona wy³¹czona'}
|
||||||
if (FLargeImageIndex>=0) and
|
if (FLargeImageIndex>=0) and
|
||||||
(FDisabledLargeImages<>nil) and
|
(FDisabledLargeImages<>nil) and
|
||||||
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
||||||
@ -768,7 +768,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona zwyk�a'}
|
{$REGION 'Ikona zwyk³a'}
|
||||||
if (FLargeImageIndex>=0) and
|
if (FLargeImageIndex>=0) and
|
||||||
(FLargeImages<>nil) and
|
(FLargeImages<>nil) and
|
||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
@ -819,7 +819,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
|
|
||||||
if BreakPos>0 then
|
if BreakPos>0 then
|
||||||
begin
|
begin
|
||||||
// Tekst z�amany
|
// Tekst z³amany
|
||||||
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
||||||
|
|
||||||
s:=copy(FCaption, 1, BreakPos-1);
|
s:=copy(FCaption, 1, BreakPos-1);
|
||||||
@ -834,7 +834,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Tekst nie z�amany
|
// Tekst nie z³amany
|
||||||
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
TextHeight:=ABuffer.Canvas.Textheight('Wy');
|
||||||
|
|
||||||
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
x:=FButtonRect.Left + (FButtonRect.width - ABuffer.Canvas.Textwidth(FCaption)) div 2;
|
||||||
@ -844,7 +844,7 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
|
|
||||||
if FButtonKind = bkDropdown then
|
if FButtonKind = bkDropdown then
|
||||||
begin
|
begin
|
||||||
// Chevron strza�ki w d��
|
// Chevron strza³ki w dó³
|
||||||
|
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
@ -883,27 +883,27 @@ if FButtonKind in [bkButton, bkDropdown] then
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$REGION 'Tryb z rozwijanym menu'}
|
{$REGION 'Tryb z rozwijanym menu'}
|
||||||
// *** T�o ***
|
// *** T³o ***
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla Disabled'}
|
{$REGION 'T³o dla Disabled'}
|
||||||
//
|
//
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
if FButtonState = bsIdle then
|
if FButtonState = bsIdle then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla Idle'}
|
{$REGION 'T³o dla Idle'}
|
||||||
//
|
//
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
if (FButtonState = bsBtnHottrack) or (FButtonState = bsDropdownHottrack) or
|
if (FButtonState = bsBtnHottrack) or (FButtonState = bsDropdownHottrack) or
|
||||||
(FButtonState = bsBtnPressed) or (FButtonState = bsDropdownPressed) then
|
(FButtonState = bsBtnPressed) or (FButtonState = bsDropdownPressed) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'T�o dla aktywnego'}
|
{$REGION 'T³o dla aktywnego'}
|
||||||
|
|
||||||
// *** Przycisk ***
|
// *** Przycisk ***
|
||||||
|
|
||||||
{$REGION 'Ustalanie kolor�w'}
|
{$REGION 'Ustalanie kolorów'}
|
||||||
if FButtonState = bsBtnHottrack then
|
if FButtonState = bsBtnHottrack then
|
||||||
begin
|
begin
|
||||||
FrameColor:=FAppearance.Element.HotTrackFrameColor;
|
FrameColor:=FAppearance.Element.HotTrackFrameColor;
|
||||||
@ -930,7 +930,7 @@ else
|
|||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'T�o przycisku'}
|
{$REGION 'T³o przycisku'}
|
||||||
DrawRgn:=CreateRectRgn(FButtonRect.Left,
|
DrawRgn:=CreateRectRgn(FButtonRect.Left,
|
||||||
FButtonRect.Top + LARGEBUTTON_RADIUS,
|
FButtonRect.Top + LARGEBUTTON_RADIUS,
|
||||||
FButtonRect.Right + 1,
|
FButtonRect.Right + 1,
|
||||||
@ -968,7 +968,7 @@ else
|
|||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'Ramka przycisku'}
|
{$REGION 'Ramka przycisku'}
|
||||||
// Wewn�trzna ramka
|
// Wewnêtrzna ramka
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
T2DIntPoint.Create(FButtonRect.Left + 1, FButtonRect.Top + 1),
|
T2DIntPoint.Create(FButtonRect.Left + 1, FButtonRect.Top + 1),
|
||||||
LARGEBUTTON_RADIUS,
|
LARGEBUTTON_RADIUS,
|
||||||
@ -1014,7 +1014,7 @@ else
|
|||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
// Zewn�trzna ramka
|
// Zewnêtrzna ramka
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
T2DIntPoint.Create(FButtonRect.Left, FButtonRect.Top),
|
T2DIntPoint.Create(FButtonRect.Left, FButtonRect.Top),
|
||||||
LARGEBUTTON_RADIUS,
|
LARGEBUTTON_RADIUS,
|
||||||
@ -1049,7 +1049,7 @@ else
|
|||||||
|
|
||||||
// *** Dropdown ***
|
// *** Dropdown ***
|
||||||
|
|
||||||
{$REGION 'Ustalanie kolor�w'}
|
{$REGION 'Ustalanie kolorów'}
|
||||||
if FButtonState = bsDropdownHottrack then
|
if FButtonState = bsDropdownHottrack then
|
||||||
begin
|
begin
|
||||||
FrameColor:=FAppearance.Element.HotTrackFrameColor;
|
FrameColor:=FAppearance.Element.HotTrackFrameColor;
|
||||||
@ -1079,7 +1079,7 @@ else
|
|||||||
end;
|
end;
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'T�o dropdown'}
|
{$REGION 'T³o dropdown'}
|
||||||
DrawRgn:=CreateRectRgn(FDropdownRect.left,
|
DrawRgn:=CreateRectRgn(FDropdownRect.left,
|
||||||
FDropdownRect.Top,
|
FDropdownRect.Top,
|
||||||
FDropdownRect.Right + 1,
|
FDropdownRect.Right + 1,
|
||||||
@ -1117,7 +1117,7 @@ else
|
|||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
|
|
||||||
{$REGION 'Ramka dropdown'}
|
{$REGION 'Ramka dropdown'}
|
||||||
// Wewn�trzna ramka
|
// Wewnêtrzna ramka
|
||||||
|
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
T2DIntPoint.Create(FDropdownRect.Left + 1, FDropdownRect.Bottom - LARGEBUTTON_RADIUS),
|
||||||
@ -1164,7 +1164,7 @@ else
|
|||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
|
|
||||||
// Zewn�trzna ramka
|
// Zewnêtrzna ramka
|
||||||
TGuiTools.DrawAARoundCorner(ABuffer,
|
TGuiTools.DrawAARoundCorner(ABuffer,
|
||||||
T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
T2DIntPoint.Create(FDropdownRect.Left, FDropdownRect.Bottom - LARGEBUTTON_RADIUS + 1),
|
||||||
LARGEBUTTON_RADIUS,
|
LARGEBUTTON_RADIUS,
|
||||||
@ -1197,12 +1197,12 @@ else
|
|||||||
|
|
||||||
{$ENDREGION}
|
{$ENDREGION}
|
||||||
end else
|
end else
|
||||||
raise InternalException.create('TSpkLargeButton.Draw: Nieprawid�owa warto�� FButtonState!');
|
raise InternalException.create('TSpkLargeButton.Draw: Nieprawid³owa wartoœæ FButtonState!');
|
||||||
|
|
||||||
// *** Ikona ***
|
// *** Ikona ***
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona wy��czona'}
|
{$REGION 'Ikona wy³¹czona'}
|
||||||
if (FLargeImageIndex>=0) and
|
if (FLargeImageIndex>=0) and
|
||||||
(FDisabledLargeImages<>nil) and
|
(FDisabledLargeImages<>nil) and
|
||||||
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
(FLargeImageIndex<FDisabledLargeImages.Count) then
|
||||||
@ -1233,7 +1233,7 @@ else
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona zwyk�a'}
|
{$REGION 'Ikona zwyk³a'}
|
||||||
if (FLargeImageIndex>=0) and
|
if (FLargeImageIndex>=0) and
|
||||||
(FLargeImages<>nil) and
|
(FLargeImages<>nil) and
|
||||||
(FLargeImageIndex<FLargeImages.Count) then
|
(FLargeImageIndex<FLargeImages.Count) then
|
||||||
@ -1414,13 +1414,13 @@ if FLargeImages<>nil then
|
|||||||
// *** Tekst ***
|
// *** Tekst ***
|
||||||
if FButtonKind = bkButton then
|
if FButtonKind = bkButton then
|
||||||
begin
|
begin
|
||||||
// �amiemy etykiet�
|
// £amiemy etykietê
|
||||||
FindBreakPlace(FCaption,BreakPos,RowWidth);
|
FindBreakPlace(FCaption,BreakPos,RowWidth);
|
||||||
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + RowWidth;
|
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + RowWidth;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Nie �amiemy etykiety
|
// Nie ³amiemy etykiety
|
||||||
Bitmap.canvas.font.assign(FAppearance.Element.CaptionFont);
|
Bitmap.canvas.font.assign(FAppearance.Element.CaptionFont);
|
||||||
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + Bitmap.Canvas.TextWidth(FCaption);
|
TextWidth:=2 * LARGEBUTTON_CAPTION_HMARGIN + Bitmap.Canvas.TextWidth(FCaption);
|
||||||
end;
|
end;
|
||||||
@ -1470,7 +1470,7 @@ Bitmap:=FToolbarDispatch.GetTempBitmap;
|
|||||||
if not(assigned(Bitmap)) then
|
if not(assigned(Bitmap)) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// *** Niezale�nie od rodzaju, musi by� miejsce dla ikony i/lub tekstu ***
|
// *** Niezale¿nie od rodzaju, musi byæ miejsce dla ikony i/lub tekstu ***
|
||||||
|
|
||||||
BtnWidth:=0;
|
BtnWidth:=0;
|
||||||
AdditionalPadding:=false;
|
AdditionalPadding:=false;
|
||||||
@ -1492,22 +1492,22 @@ if FShowCaption then
|
|||||||
AdditionalPadding:=true;
|
AdditionalPadding:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Padding za tekstem lub ikon�
|
// Padding za tekstem lub ikon¹
|
||||||
if AdditionalPadding then
|
if AdditionalPadding then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_PADDING;
|
BtnWidth:=BtnWidth + SMALLBUTTON_PADDING;
|
||||||
|
|
||||||
// Szeroko�� zawarto�ci przycisku musi wynosi� co najmniej SMALLBUTTON_MIN_WIDTH
|
// Szerokoœæ zawartoœci przycisku musi wynosiæ co najmniej SMALLBUTTON_MIN_WIDTH
|
||||||
BtnWidth:=max(SMALLBUTTON_MIN_WIDTH, BtnWidth);
|
BtnWidth:=max(SMALLBUTTON_MIN_WIDTH, BtnWidth);
|
||||||
|
|
||||||
// *** Dropdown ***
|
// *** Dropdown ***
|
||||||
case FButtonKind of
|
case FButtonKind of
|
||||||
bkButton: begin
|
bkButton: begin
|
||||||
// Lewa kraw�d� przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
|
|
||||||
// Prawa kraw�d� przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
@ -1516,18 +1516,18 @@ case FButtonKind of
|
|||||||
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
DropRect:=T2DIntRect.Create(0, 0, 0, 0);
|
||||||
end;
|
end;
|
||||||
bkButtonDropdown: begin
|
bkButtonDropdown: begin
|
||||||
// Lewa kraw�d� przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
|
|
||||||
// Prawa kraw�d� przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH;
|
||||||
|
|
||||||
// Lewa kraw�d� i zawarto�� pola dropdown
|
// Lewa krawêdŸ i zawartoœæ pola dropdown
|
||||||
DropdownWidth:=SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
DropdownWidth:=SMALLBUTTON_HALF_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
||||||
|
|
||||||
// Prawa kraw�d� pola dropdown
|
// Prawa krawêdŸ pola dropdown
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
DropdownWidth:=DropdownWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
DropdownWidth:=DropdownWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
DropdownWidth:=DropdownWidth + SMALLBUTTON_BORDER_WIDTH;
|
DropdownWidth:=DropdownWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
@ -1539,18 +1539,18 @@ case FButtonKind of
|
|||||||
PANE_ROW_HEIGHT - 1);
|
PANE_ROW_HEIGHT - 1);
|
||||||
end;
|
end;
|
||||||
bkDropdown: begin
|
bkDropdown: begin
|
||||||
// Lewa kraw�d� przycisku
|
// Lewa krawêdŸ przycisku
|
||||||
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
if FGroupBehaviour in [gbContinuesGroup, gbEndsGroup] then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
|
|
||||||
// Prawa kraw�d� przycisku
|
// Prawa krawêdŸ przycisku
|
||||||
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
if (FGroupBehaviour in [gbBeginsGroup, gbContinuesGroup]) then
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
BtnWidth:=BtnWidth + SMALLBUTTON_HALF_BORDER_WIDTH else
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH;
|
||||||
|
|
||||||
// Dodatkowy obszar na dropdown + miejsce na �rodkow� kraw�d�,
|
// Dodatkowy obszar na dropdown + miejsce na œrodkow¹ krawêdŸ,
|
||||||
// dla kompatybilno�ci wymiar�w z dkButtonDropdown
|
// dla kompatybilnoœci wymiarów z dkButtonDropdown
|
||||||
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
BtnWidth:=BtnWidth + SMALLBUTTON_BORDER_WIDTH + SMALLBUTTON_DROPDOWN_WIDTH;
|
||||||
|
|
||||||
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
BtnRect:=T2DIntRect.Create(0, 0, BtnWidth - 1, PANE_ROW_HEIGHT - 1);
|
||||||
@ -1585,7 +1585,7 @@ if (FRect.width<2*LARGEBUTTON_RADIUS) or (FRect.Height<2*LARGEBUTTON_RADIUS) the
|
|||||||
|
|
||||||
// *** Przycisk ***
|
// *** Przycisk ***
|
||||||
|
|
||||||
// T�o i ramka
|
// T³o i ramka
|
||||||
{$REGION 'Rysowanie przycisku'}
|
{$REGION 'Rysowanie przycisku'}
|
||||||
if (FButtonState = bsIdle) and (not(FHideFrameWhenIdle)) then
|
if (FButtonState = bsIdle) and (not(FHideFrameWhenIdle)) then
|
||||||
begin
|
begin
|
||||||
@ -1664,7 +1664,7 @@ if (FButtonState in [bsDropdownHottrack, bsDropdownPressed]) then
|
|||||||
// Ikona
|
// Ikona
|
||||||
if not(FEnabled) then
|
if not(FEnabled) then
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona wy��czona'}
|
{$REGION 'Ikona wy³¹czona'}
|
||||||
if (FImageIndex>=0) and
|
if (FImageIndex>=0) and
|
||||||
(FDisabledImages<>nil) and
|
(FDisabledImages<>nil) and
|
||||||
(FImageIndex<FDisabledImages.Count) then
|
(FImageIndex<FDisabledImages.Count) then
|
||||||
@ -1699,7 +1699,7 @@ if not(FEnabled) then
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
{$REGION 'Ikona zwyk�a'}
|
{$REGION 'Ikona zwyk³a'}
|
||||||
if (FImageIndex>=0) and
|
if (FImageIndex>=0) and
|
||||||
(FImages<>nil) and
|
(FImages<>nil) and
|
||||||
(FImageIndex<FImages.Count) then
|
(FImageIndex<FImages.Count) then
|
||||||
@ -1770,7 +1770,7 @@ if FButtonKind = bkButton then
|
|||||||
end else
|
end else
|
||||||
if FButtonKind = bkButtonDropdown then
|
if FButtonKind = bkButtonDropdown then
|
||||||
begin
|
begin
|
||||||
// T�o i ramka
|
// T³o i ramka
|
||||||
{$REGION 'Rysowanie dropdowna'}
|
{$REGION 'Rysowanie dropdowna'}
|
||||||
if (FButtonState = bsIdle) and (not(FHideFrameWhenIdle)) then
|
if (FButtonState = bsIdle) and (not(FHideFrameWhenIdle)) then
|
||||||
begin
|
begin
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Const;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Const.pas *
|
* Plik: spkt_Const.pas *
|
||||||
* Opis: Sta�e wykorzystywane do obliczania geometrii toolbara *
|
* Opis: Sta³e wykorzystywane do obliczania geometrii toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -38,58 +38,58 @@ const // ****************
|
|||||||
// *** Obszar tafli ***
|
// *** Obszar tafli ***
|
||||||
// ********************
|
// ********************
|
||||||
|
|
||||||
/// <summary>Maksymalna wysoko�� obszaru, kt�ry mo�e zaj�� zawarto��
|
/// <summary>Maksymalna wysokoœæ obszaru, który mo¿e zaj¹æ zawartoœæ
|
||||||
/// tafli z elementami</summary>
|
/// tafli z elementami</summary>
|
||||||
MAX_ELEMENT_HEIGHT = 67;
|
MAX_ELEMENT_HEIGHT = 67;
|
||||||
|
|
||||||
/// <summary>Wysoko�� pojedynczego wiersza element�w tafli</summary>
|
/// <summary>Wysokoœæ pojedynczego wiersza elementów tafli</summary>
|
||||||
PANE_ROW_HEIGHT = 22;
|
PANE_ROW_HEIGHT = 22;
|
||||||
|
|
||||||
PANE_FULL_ROW_HEIGHT = 3 * PANE_ROW_HEIGHT;
|
PANE_FULL_ROW_HEIGHT = 3 * PANE_ROW_HEIGHT;
|
||||||
|
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
||||||
/// tafl� w przypadku wersji jednowierszowej</summary>
|
/// tafl¹ w przypadku wersji jednowierszowej</summary>
|
||||||
PANE_ONE_ROW_TOPPADDING = 22;
|
PANE_ONE_ROW_TOPPADDING = 22;
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
||||||
/// a tafl� w przypadku wersji jednowierszowej</summary>
|
/// a tafl¹ w przypadku wersji jednowierszowej</summary>
|
||||||
PANE_ONE_ROW_BOTTOMPADDING = 23;
|
PANE_ONE_ROW_BOTTOMPADDING = 23;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy wierszami w przypadku wersji dwuwierszowej
|
/// <summary>Odleg³oœæ pomiêdzy wierszami w przypadku wersji dwuwierszowej
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PANE_TWO_ROWS_VSPACER = 7;
|
PANE_TWO_ROWS_VSPACER = 7;
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
||||||
/// tafl� w przypadku wersji dwuwierszowej</summary>
|
/// tafl¹ w przypadku wersji dwuwierszowej</summary>
|
||||||
PANE_TWO_ROWS_TOPPADDING = 8;
|
PANE_TWO_ROWS_TOPPADDING = 8;
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
||||||
/// a tafl� w przypadku wersji dwuwierszowej</summary>
|
/// a tafl¹ w przypadku wersji dwuwierszowej</summary>
|
||||||
PANE_TWO_ROWS_BOTTOMPADDING = 8;
|
PANE_TWO_ROWS_BOTTOMPADDING = 8;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy wierszami w przypadku wersji
|
/// <summary>Odleg³oœæ pomiêdzy wierszami w przypadku wersji
|
||||||
/// trzywierszowej</summary>
|
/// trzywierszowej</summary>
|
||||||
PANE_THREE_ROWS_VSPACER = 0;
|
PANE_THREE_ROWS_VSPACER = 0;
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy pierwszym elementem a
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy pierwszym elementem a
|
||||||
/// tafl� w przypadku wersji trzywierszowej</summary>
|
/// tafl¹ w przypadku wersji trzywierszowej</summary>
|
||||||
PANE_THREE_ROWS_TOPPADDING = 0;
|
PANE_THREE_ROWS_TOPPADDING = 0;
|
||||||
/// <summary>Wewn�trzny pionowy margines pomi�dzy ostatnim elementem
|
/// <summary>Wewnêtrzny pionowy margines pomiêdzy ostatnim elementem
|
||||||
/// a tafl� w przypadku wersji trzywierszowej</summary>
|
/// a tafl¹ w przypadku wersji trzywierszowej</summary>
|
||||||
PANE_THREE_ROWS_BOTTOMPADDING = 1;
|
PANE_THREE_ROWS_BOTTOMPADDING = 1;
|
||||||
|
|
||||||
PANE_FULL_ROW_TOPPADDING = PANE_THREE_ROWS_TOPPADDING;
|
PANE_FULL_ROW_TOPPADDING = PANE_THREE_ROWS_TOPPADDING;
|
||||||
|
|
||||||
PANE_FULL_ROW_BOTTOMPADDING = PANE_THREE_ROWS_BOTTOMPADDING;
|
PANE_FULL_ROW_BOTTOMPADDING = PANE_THREE_ROWS_BOTTOMPADDING;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy lew� kraw�dzi� a pierwszym elementem
|
/// <summary>Odleg³oœæ pomiêdzy lew¹ krawêdzi¹ a pierwszym elementem
|
||||||
/// tafli</summary>
|
/// tafli</summary>
|
||||||
PANE_LEFT_PADDING = 2;
|
PANE_LEFT_PADDING = 2;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy ostatnim elementem tafli a praw� kraw�dzi�
|
/// <summary>Odleg³oœæ pomiêdzy ostatnim elementem tafli a praw¹ krawêdzi¹
|
||||||
/// </summary>
|
/// </summary>
|
||||||
PANE_RIGHT_PADDING = 2;
|
PANE_RIGHT_PADDING = 2;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy dwoma kolumnami wewn�trz tafli</summary>
|
/// <summary>Odleg³oœæ pomiêdzy dwoma kolumnami wewn¹trz tafli</summary>
|
||||||
PANE_COLUMN_SPACER = 4;
|
PANE_COLUMN_SPACER = 4;
|
||||||
|
|
||||||
/// <summary>Odleg�o�� pomi�dzy dwoma osobnymi grupami wewn�trz wiersza
|
/// <summary>Odleg³oœæ pomiêdzy dwoma osobnymi grupami wewnêtrz wiersza
|
||||||
/// w tafli</summary>
|
/// w tafli</summary>
|
||||||
PANE_GROUP_SPACER = 4;
|
PANE_GROUP_SPACER = 4;
|
||||||
|
|
||||||
@ -97,47 +97,47 @@ const // ****************
|
|||||||
// *** Tafla ***
|
// *** Tafla ***
|
||||||
// *************
|
// *************
|
||||||
|
|
||||||
/// <summary>Wysoko�� obszaru tytu�u tafli</summary>
|
/// <summary>Wysokoœæ obszaru tytu³u tafli</summary>
|
||||||
PANE_CAPTION_HEIGHT = 15;
|
PANE_CAPTION_HEIGHT = 15;
|
||||||
|
|
||||||
PANE_CORNER_RADIUS = 3;
|
PANE_CORNER_RADIUS = 3;
|
||||||
|
|
||||||
/// <summary>Szeroko��/wysoko�� ramki tafli</summary>
|
/// <summary>SzerokoϾ/wysokoϾ ramki tafli</summary>
|
||||||
/// <remarks>Nie nale�y zmienia� tej sta�ej!</remarks>
|
/// <remarks>Nie nale¿y zmieniaæ tej sta³ej!</remarks>
|
||||||
PANE_BORDER_SIZE = 2;
|
PANE_BORDER_SIZE = 2;
|
||||||
|
|
||||||
/// <summary>Po�owa szeroko�ci ramki tafli</summary>
|
/// <summary>Po³owa szerokoœci ramki tafli</summary>
|
||||||
/// <remarks>Nie nale�y zmienia� tej sta�ej!</remarks>
|
/// <remarks>Nie nale¿y zmieniaæ tej sta³ej!</remarks>
|
||||||
PANE_BORDER_HALF_SIZE = 1;
|
PANE_BORDER_HALF_SIZE = 1;
|
||||||
|
|
||||||
/// <summary>Wysoko�� ca�ej tafli (uwzgl�dniaj�c ramk�)</summary>
|
/// <summary>Wysokoœæ ca³ej tafli (uwzglêdniaj¹c ramkê)</summary>
|
||||||
PANE_HEIGHT = MAX_ELEMENT_HEIGHT + PANE_CAPTION_HEIGHT + 2 * PANE_BORDER_SIZE;
|
PANE_HEIGHT = MAX_ELEMENT_HEIGHT + PANE_CAPTION_HEIGHT + 2 * PANE_BORDER_SIZE;
|
||||||
|
|
||||||
/// <summary>Poziomy margines etykiety zak�adki</summary>
|
/// <summary>Poziomy margines etykiety zak³adki</summary>
|
||||||
PANE_CAPTION_HMARGIN = 6;
|
PANE_CAPTION_HMARGIN = 6;
|
||||||
|
|
||||||
// ***********************
|
// ***********************
|
||||||
// *** Obszar zak�adki ***
|
// *** Obszar zak³adki ***
|
||||||
// ***********************
|
// ***********************
|
||||||
|
|
||||||
/// <summary>Promie� zaokr�glenia zak�adki</summary>
|
/// <summary>Promieñ zaokr¹glenia zak³adki</summary>
|
||||||
TAB_CORNER_RADIUS = 4;
|
TAB_CORNER_RADIUS = 4;
|
||||||
|
|
||||||
/// <summary>Lewy wewn�trzny margines zak�adki</summary>
|
/// <summary>Lewy wewnêtrzny margines zak³adki</summary>
|
||||||
TAB_PANE_LEFTPADDING = 2;
|
TAB_PANE_LEFTPADDING = 2;
|
||||||
/// <summary>Prawy wewn�trzny margines zak�adki</summary>
|
/// <summary>Prawy wewnêtrzny margines zak³adki</summary>
|
||||||
TAB_PANE_RIGHTPADDING = 2;
|
TAB_PANE_RIGHTPADDING = 2;
|
||||||
/// <summary>G�rny wewn�trzny margines zak�adki</summary>
|
/// <summary>Górny wewnêtrzny margines zak³adki</summary>
|
||||||
TAB_PANE_TOPPADDING = 2;
|
TAB_PANE_TOPPADDING = 2;
|
||||||
/// <summary>Dolny wewn�trzny margines zak�adki</summary>
|
/// <summary>Dolny wewnêtrzny margines zak³adki</summary>
|
||||||
TAB_PANE_BOTTOMPADDING = 1;
|
TAB_PANE_BOTTOMPADDING = 1;
|
||||||
/// <summary>Odleg�o�� pomi�dzy taflami</summary>
|
/// <summary>Odleg³oœæ pomiêdzy taflami</summary>
|
||||||
TAB_PANE_HSPACING = 3;
|
TAB_PANE_HSPACING = 3;
|
||||||
|
|
||||||
/// <summary>Szeroko��/wysoko�� ramki zak�adki (nie nale�y zmienia�!)
|
/// <summary>Szerokoœæ/wysokoœæ ramki zak³adki (nie nale¿y zmieniaæ!)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TAB_BORDER_SIZE = 1;
|
TAB_BORDER_SIZE = 1;
|
||||||
/// <summary>Wysoko�� zak�adki</summary>
|
/// <summary>Wysokoœæ zak³adki</summary>
|
||||||
TAB_HEIGHT = PANE_HEIGHT + TAB_PANE_TOPPADDING + TAB_PANE_BOTTOMPADDING + TAB_BORDER_SIZE;
|
TAB_HEIGHT = PANE_HEIGHT + TAB_PANE_TOPPADDING + TAB_PANE_BOTTOMPADDING + TAB_BORDER_SIZE;
|
||||||
|
|
||||||
// ***************
|
// ***************
|
||||||
@ -148,14 +148,14 @@ const // ****************
|
|||||||
|
|
||||||
TOOLBAR_CORNER_RADIUS = 3;
|
TOOLBAR_CORNER_RADIUS = 3;
|
||||||
|
|
||||||
/// <summary>Wysoko�� etykiet z nazwami zak�adek</summary>
|
/// <summary>Wysokoœæ etykiet z nazwami zak³adek</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
TOOLBAR_TAB_CAPTIONS_HEIGHT = 22;
|
||||||
/// <summary>Poziomy margines wewn�trznego tytu�u zak�adki</summary>
|
/// <summary>Poziomy margines wewnêtrznego tytu³u zak³adki</summary>
|
||||||
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
TOOLBAR_TAB_CAPTIONS_TEXT_HPADDING = 4;
|
||||||
|
|
||||||
TOOLBAR_MIN_TAB_CAPTION_WIDTH = 32;
|
TOOLBAR_MIN_TAB_CAPTION_WIDTH = 32;
|
||||||
|
|
||||||
/// <summary>Sumaryczna wysoko�� toolbara</summary>
|
/// <summary>Sumaryczna wysokoϾ toolbara</summary>
|
||||||
TOOLBAR_HEIGHT = TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
TOOLBAR_HEIGHT = TOOLBAR_TAB_CAPTIONS_HEIGHT +
|
||||||
TAB_HEIGHT;
|
TAB_HEIGHT;
|
||||||
|
|
||||||
@ -164,9 +164,9 @@ implementation
|
|||||||
initialization
|
initialization
|
||||||
|
|
||||||
{$IFDEF DEBUG}
|
{$IFDEF DEBUG}
|
||||||
// Sprawdzanie poprawno�ci
|
// Sprawdzanie poprawnoœci
|
||||||
|
|
||||||
// �uk du�ego przycisku
|
// £uk du¿ego przycisku
|
||||||
assert(LARGEBUTTON_RADIUS * 2 <= LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
assert(LARGEBUTTON_RADIUS * 2 <= LARGEBUTTON_DROPDOWN_FIELD_SIZE);
|
||||||
|
|
||||||
// Tafla, wersja z jednym wierszem
|
// Tafla, wersja z jednym wierszem
|
||||||
|
@ -3,10 +3,10 @@ unit spkt_Dispatch;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Dispatch.pas *
|
* Plik: spkt_Dispatch.pas *
|
||||||
* Opis: Bazowe klasy dyspozytor�w po�rednicz�cych pomi�dzy elementami *
|
* Opis: Bazowe klasy dyspozytorów poœrednicz¹cych pomiêdzy elementami *
|
||||||
* toolbara. *
|
* toolbara. *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Exceptions;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Exceptions.pas *
|
* Plik: spkt_Exceptions.pas *
|
||||||
* Opis: Klasy wyj�tk�w toolbara *
|
* Opis: Klasy wyj¹tków toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Items;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Items.pas *
|
* Plik: spkt_Items.pas *
|
||||||
* Opis: Modu� zawiera klas� kolekcji element�w tafli. *
|
* Opis: Modu³ zawiera klasê kolekcji elementów tafli. *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -151,8 +151,8 @@ begin
|
|||||||
|
|
||||||
case Operation of
|
case Operation of
|
||||||
opInsert: begin
|
opInsert: begin
|
||||||
// Ustawienie dyspozytora na nil spowoduje, �e podczas
|
// Ustawienie dyspozytora na nil spowoduje, ¿e podczas
|
||||||
// przypisywania w�asno�ci nie b�d� wo�ane metody Notify*
|
// przypisywania w³asnoœci nie bêd¹ wo³ane metody Notify*
|
||||||
TSpkBaseItem(Item).ToolbarDispatch:=nil;
|
TSpkBaseItem(Item).ToolbarDispatch:=nil;
|
||||||
|
|
||||||
TSpkBaseItem(Item).Appearance:=FAppearance;
|
TSpkBaseItem(Item).Appearance:=FAppearance;
|
||||||
|
@ -4,8 +4,8 @@ unit spkt_Pane;
|
|||||||
* *
|
* *
|
||||||
* Plik: spkt_Pane.pas *
|
* Plik: spkt_Pane.pas *
|
||||||
* Opis: Komponent tafli toolbara *
|
* Opis: Komponent tafli toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -52,10 +52,10 @@ type TSpkPane = class;
|
|||||||
FVisible : boolean;
|
FVisible : boolean;
|
||||||
FItems : TSpkItems;
|
FItems : TSpkItems;
|
||||||
|
|
||||||
// *** Generowanie layoutu element�w ***
|
// *** Generowanie layoutu elementów ***
|
||||||
function GenerateLayout: TSpkPaneItemsLayout;
|
function GenerateLayout: TSpkPaneItemsLayout;
|
||||||
|
|
||||||
// *** Obs�uga designtime i DFM ***
|
// *** Obs³uga designtime i DFM ***
|
||||||
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
||||||
procedure DefineProperties(Filer : TFiler); override;
|
procedure DefineProperties(Filer : TFiler); override;
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
@ -75,7 +75,7 @@ type TSpkPane = class;
|
|||||||
constructor Create(AOwner : TComponent); override;
|
constructor Create(AOwner : TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
// *** Obs�uga gryzonia ***
|
// *** Obs³uga gryzonia ***
|
||||||
procedure MouseLeave;
|
procedure MouseLeave;
|
||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
@ -88,7 +88,7 @@ type TSpkPane = class;
|
|||||||
procedure Draw(ABuffer : TBitmap; ClipRect : T2DIntRect);
|
procedure Draw(ABuffer : TBitmap; ClipRect : T2DIntRect);
|
||||||
function FindItemAt(x, y: integer): integer;
|
function FindItemAt(x, y: integer): integer;
|
||||||
|
|
||||||
// *** Obs�uga element�w ***
|
// *** Obs³uga elementów ***
|
||||||
procedure FreeingItem(AItem : TSpkBaseItem);
|
procedure FreeingItem(AItem : TSpkBaseItem);
|
||||||
|
|
||||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
||||||
@ -127,7 +127,7 @@ type TSpkPanes = class(TSpkCollection)
|
|||||||
constructor Create(RootComponent : TComponent); override;
|
constructor Create(RootComponent : TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
// *** Dodawanie i wstawianie element�w ***
|
// *** Dodawanie i wstawianie elementów ***
|
||||||
function Add : TSpkPane;
|
function Add : TSpkPane;
|
||||||
function Insert(index : integer) : TSpkPane;
|
function Insert(index : integer) : TSpkPane;
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ var x: Integer;
|
|||||||
i: Integer;
|
i: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// W niekt�rych warunkach nie jeste�my w stanie rysowa�:
|
// W niektórych warunkach nie jesteœmy w stanie rysowaæ:
|
||||||
// * Brak dyspozytora
|
// * Brak dyspozytora
|
||||||
if FToolbarDispatch=nil then
|
if FToolbarDispatch=nil then
|
||||||
exit;
|
exit;
|
||||||
@ -253,7 +253,7 @@ if FPaneState = psIdle then
|
|||||||
BorderDarkColor:=TColorTools.Brighten(FAppearance.Pane.BorderDarkColor,20);
|
BorderDarkColor:=TColorTools.Brighten(FAppearance.Pane.BorderDarkColor,20);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// T�o
|
// T³o
|
||||||
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
||||||
T2DIntRect.Create(FRect.left,
|
T2DIntRect.Create(FRect.left,
|
||||||
FRect.top,
|
FRect.top,
|
||||||
@ -265,7 +265,7 @@ TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
|||||||
FAppearance.Pane.GradientType,
|
FAppearance.Pane.GradientType,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
// T�o etykiety tafli
|
// T³o etykiety tafli
|
||||||
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
TGuiTools.DrawRoundRect(ABuffer.Canvas,
|
||||||
T2DIntRect.Create(FRect.Left,
|
T2DIntRect.Create(FRect.Left,
|
||||||
FRect.Bottom - PANE_CAPTION_HEIGHT - PANE_BORDER_HALF_SIZE,
|
FRect.Bottom - PANE_CAPTION_HEIGHT - PANE_BORDER_HALF_SIZE,
|
||||||
@ -373,8 +373,8 @@ result.Width:=0;
|
|||||||
if FItems.count=0 then
|
if FItems.count=0 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// Notatka: algorytm jest skonstruowany w ten spos�b, �e tr�jka: CurrentColumn,
|
// Notatka: algorytm jest skonstruowany w ten sposób, ¿e trójka: CurrentColumn,
|
||||||
// CurrentRow oraz CurrentItem wskazuje na element, kt�rego jeszcze nie
|
// CurrentRow oraz CurrentItem wskazuje na element, którego jeszcze nie
|
||||||
// ma (zaraz za ostatnio dodanym elementem).
|
// ma (zaraz za ostatnio dodanym elementem).
|
||||||
|
|
||||||
setlength(Layout,1);
|
setlength(Layout,1);
|
||||||
@ -393,14 +393,14 @@ for i := 0 to FItems.count - 1 do
|
|||||||
ItemTableBehaviour := FItems[i].GetTableBehaviour;
|
ItemTableBehaviour := FItems[i].GetTableBehaviour;
|
||||||
ItemSize := FItems[i].GetSize;
|
ItemSize := FItems[i].GetSize;
|
||||||
|
|
||||||
// Rozpocz�cie nowej kolumny?
|
// Rozpoczêcie nowej kolumny?
|
||||||
if (i=0) or
|
if (i=0) or
|
||||||
(ItemSize = isLarge) or
|
(ItemSize = isLarge) or
|
||||||
(ItemTableBehaviour = tbBeginsColumn) or
|
(ItemTableBehaviour = tbBeginsColumn) or
|
||||||
((ItemTableBehaviour = tbBeginsRow) and (CurrentRow = 2)) or
|
((ItemTableBehaviour = tbBeginsRow) and (CurrentRow = 2)) or
|
||||||
(ForceNewColumn) then
|
(ForceNewColumn) then
|
||||||
begin
|
begin
|
||||||
// Je�li ju� jeste�my na pocz�tku nowej kolumny, nie ma nic do roboty.
|
// Jeœli ju¿ jesteœmy na pocz¹tku nowej kolumny, nie ma nic do roboty.
|
||||||
if (CurrentRow<>0) or (CurrentItem<>0) then
|
if (CurrentRow<>0) or (CurrentItem<>0) then
|
||||||
begin
|
begin
|
||||||
setlength(Layout, length(Layout)+1);
|
setlength(Layout, length(Layout)+1);
|
||||||
@ -413,10 +413,10 @@ for i := 0 to FItems.count - 1 do
|
|||||||
CurrentItem:=0;
|
CurrentItem:=0;
|
||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
// Rozpocz�cie nowego wiersza?
|
// Rozpoczêcie nowego wiersza?
|
||||||
if (ItemTableBehaviour = tbBeginsRow) then
|
if (ItemTableBehaviour = tbBeginsRow) then
|
||||||
begin
|
begin
|
||||||
// Je�li ju� jeste�my na pocz�tku nowego wiersza, nie ma nic do roboty.
|
// Jeœli ju¿ jesteœmy na pocz¹tku nowego wiersza, nie ma nic do roboty.
|
||||||
if CurrentItem <> 0 then
|
if CurrentItem <> 0 then
|
||||||
begin
|
begin
|
||||||
setlength(Layout[CurrentColumn], length(Layout[CurrentColumn])+1);
|
setlength(Layout[CurrentColumn], length(Layout[CurrentColumn])+1);
|
||||||
@ -427,7 +427,7 @@ for i := 0 to FItems.count - 1 do
|
|||||||
|
|
||||||
ForceNewColumn:=ItemSize = isLarge;
|
ForceNewColumn:=ItemSize = isLarge;
|
||||||
|
|
||||||
// Je�li element jest widoczny, dodajemy go w aktualnej kolumnie i aktualnym
|
// Jeœli element jest widoczny, dodajemy go w aktualnej kolumnie i aktualnym
|
||||||
// wierszu.
|
// wierszu.
|
||||||
if FItems[i].Visible then
|
if FItems[i].Visible then
|
||||||
begin
|
begin
|
||||||
@ -438,17 +438,17 @@ for i := 0 to FItems.count - 1 do
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// W tym miejscu mamy gotowy layout. Teraz trzeba obliczy� pozycje i rozmiary
|
// W tym miejscu mamy gotowy layout. Teraz trzeba obliczyæ pozycje i rozmiary
|
||||||
// Rect�w.
|
// Rectów.
|
||||||
|
|
||||||
// Najpierw wype�niamy je pustymi danymi, kt�re zape�ni� miejsce element�w
|
// Najpierw wype³niamy je pustymi danymi, które zape³ni¹ miejsce elementów
|
||||||
// niewidocznych.
|
// niewidocznych.
|
||||||
for i := 0 to FItems.count - 1 do
|
for i := 0 to FItems.count - 1 do
|
||||||
result.Rects[i]:=T2DIntRect.create(-1, -1, -1, -1);
|
result.Rects[i]:=T2DIntRect.create(-1, -1, -1, -1);
|
||||||
|
|
||||||
MaxRowX:=0;
|
MaxRowX:=0;
|
||||||
|
|
||||||
// Teraz iterujemy po layoucie, ustalaj�c recty.
|
// Teraz iterujemy po layoucie, ustalaj¹c recty.
|
||||||
if length(Layout)>0 then
|
if length(Layout)>0 then
|
||||||
for c := 0 to high(Layout) do
|
for c := 0 to high(Layout) do
|
||||||
begin
|
begin
|
||||||
@ -497,8 +497,8 @@ if length(Layout)>0 then
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
// Je�li element nie jest pierwszy, musi zosta�
|
// Jeœli element nie jest pierwszy, musi zostaæ
|
||||||
// odsuni�ty marginesem od poprzedniego
|
// odsuniêty marginesem od poprzedniego
|
||||||
if i>0 then
|
if i>0 then
|
||||||
tmpRect.Left:=LastX + PANE_GROUP_SPACER else
|
tmpRect.Left:=LastX + PANE_GROUP_SPACER else
|
||||||
tmpRect.Left:=LastX;
|
tmpRect.Left:=LastX;
|
||||||
@ -551,8 +551,8 @@ if length(Layout)>0 then
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
// W tym miejscu MaxRowX wskazuje na pierwszy piksel za najbardziej wysuni�tym
|
// W tym miejscu MaxRowX wskazuje na pierwszy piksel za najbardziej wysuniêtym
|
||||||
// w prawo elementem - ergo jest r�wny szeroko�ci ca�ego layoutu.
|
// w prawo elementem - ergo jest równy szerokoœci ca³ego layoutu.
|
||||||
Result.Width:=MaxRowX;
|
Result.Width:=MaxRowX;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -588,18 +588,18 @@ if tmpBitmap=nil then
|
|||||||
exit;
|
exit;
|
||||||
tmpBitmap.Canvas.font.assign(FAppearance.Pane.CaptionFont);
|
tmpBitmap.Canvas.font.assign(FAppearance.Pane.CaptionFont);
|
||||||
|
|
||||||
// *** Minimalna szeroko�� tafli (tekstu) ***
|
// *** Minimalna szerokoϾ tafli (tekstu) ***
|
||||||
TextW:=tmpBitmap.Canvas.TextWidth(FCaption);
|
TextW:=tmpBitmap.Canvas.TextWidth(FCaption);
|
||||||
PaneCaptionWidth:=2*PANE_BORDER_SIZE +
|
PaneCaptionWidth:=2*PANE_BORDER_SIZE +
|
||||||
2*PANE_CAPTION_HMARGIN +
|
2*PANE_CAPTION_HMARGIN +
|
||||||
TextW;
|
TextW;
|
||||||
|
|
||||||
// *** Szeroko�� element�w tafli ***
|
// *** Szerokoœæ elementów tafli ***
|
||||||
Layout:=GenerateLayout;
|
Layout:=GenerateLayout;
|
||||||
ElementsW:=Layout.Width;
|
ElementsW:=Layout.Width;
|
||||||
PaneElementsWidth:=PANE_BORDER_SIZE + PANE_LEFT_PADDING + ElementsW + PANE_RIGHT_PADDING + PANE_BORDER_SIZE;
|
PaneElementsWidth:=PANE_BORDER_SIZE + PANE_LEFT_PADDING + ElementsW + PANE_RIGHT_PADDING + PANE_BORDER_SIZE;
|
||||||
|
|
||||||
// *** Ustawianie szeroko�ci tafli ***
|
// *** Ustawianie szerokoœci tafli ***
|
||||||
result:=max(PaneCaptionWidth, PaneElementsWidth);
|
result:=max(PaneCaptionWidth, PaneElementsWidth);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -644,7 +644,7 @@ if FMouseActiveElement.ElementType = peNone then
|
|||||||
FMouseActiveElement.ElementType:=pePaneArea;
|
FMouseActiveElement.ElementType:=pePaneArea;
|
||||||
FMouseActiveElement.ElementIndex:=-1;
|
FMouseActiveElement.ElementIndex:=-1;
|
||||||
|
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -660,15 +660,15 @@ if FMouseActiveElement.ElementType = peNone then
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = pePaneArea then
|
if FMouseHoverElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FMouseHoverElement.ElementType:=peNone;
|
FMouseHoverElement.ElementType:=peNone;
|
||||||
FMouseHoverElement.ElementIndex:=-1;
|
FMouseHoverElement.ElementIndex:=-1;
|
||||||
|
|
||||||
// Niezale�nie od tego, kt�ry element by� aktywny / pod mysz�, trzeba
|
// Niezale¿nie od tego, który element by³ aktywny / pod mysz¹, trzeba
|
||||||
// wygasi� HotTrack.
|
// wygasiæ HotTrack.
|
||||||
if FPaneState<>psIdle then
|
if FPaneState<>psIdle then
|
||||||
begin
|
begin
|
||||||
FPaneState:=psIdle;
|
FPaneState:=psIdle;
|
||||||
@ -683,9 +683,9 @@ var i : integer;
|
|||||||
NewMouseHoverElement : TSpkMousePaneElement;
|
NewMouseHoverElement : TSpkMousePaneElement;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// MouseMove jest wywo�ywany tylko, gdy tafla jest aktywna, b�d� gdy
|
// MouseMove jest wywo³ywany tylko, gdy tafla jest aktywna, b¹dŸ gdy
|
||||||
// mysz rusza si� wewn�trz jej obszaru. Wobec tego zawsze nale�y
|
// mysz rusza siê wewn¹trz jej obszaru. Wobec tego zawsze nale¿y
|
||||||
// w tej sytuacji zapali� HotTrack.
|
// w tej sytuacji zapaliæ HotTrack.
|
||||||
|
|
||||||
if FPaneState = psIdle then
|
if FPaneState = psIdle then
|
||||||
begin
|
begin
|
||||||
@ -694,7 +694,7 @@ if FPaneState = psIdle then
|
|||||||
FToolbarDispatch.NotifyVisualsChanged;
|
FToolbarDispatch.NotifyVisualsChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Szukamy obiektu pod mysz�
|
// Szukamy obiektu pod mysz¹
|
||||||
i:=FindItemAt(x, y);
|
i:=FindItemAt(x, y);
|
||||||
if i<>-1 then
|
if i<>-1 then
|
||||||
begin
|
begin
|
||||||
@ -719,12 +719,12 @@ if FMouseActiveElement.ElementType = peItem then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = pePaneArea then
|
if FMouseActiveElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = peNone then
|
if FMouseActiveElement.ElementType = peNone then
|
||||||
begin
|
begin
|
||||||
// Je�li element pod mysz� si� zmienia, informujemy poprzedni element o
|
// Jeœli element pod mysz¹ siê zmienia, informujemy poprzedni element o
|
||||||
// tym, �e mysz opuszcza jego obszar
|
// tym, ¿e mysz opuszcza jego obszar
|
||||||
if (NewMouseHoverElement.ElementType<>FMouseHoverElement.ELementType) or
|
if (NewMouseHoverElement.ElementType<>FMouseHoverElement.ELementType) or
|
||||||
(NewMouseHoverElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
(NewMouseHoverElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
||||||
begin
|
begin
|
||||||
@ -735,7 +735,7 @@ if FMouseActiveElement.ElementType = peNone then
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = pePaneArea then
|
if FMouseHoverElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -746,7 +746,7 @@ if FMouseActiveElement.ElementType = peNone then
|
|||||||
end else
|
end else
|
||||||
if NewMouseHoverElement.ElementType = pePaneArea then
|
if NewMouseHoverElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -768,7 +768,7 @@ if FMouseActiveElement.ElementType = peItem then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = pePaneArea then
|
if FMouseActiveElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ClearActive and
|
if ClearActive and
|
||||||
@ -782,7 +782,7 @@ if ClearActive and
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = pePaneArea then
|
if FMouseActiveElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FMouseHoverElement.ElementType = peItem then
|
if FMouseHoverElement.ElementType = peItem then
|
||||||
@ -792,7 +792,7 @@ if ClearActive and
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = pePaneArea then
|
if FMouseHoverElement.ElementType = pePaneArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = peNone then
|
if FMouseHoverElement.ElementType = peNone then
|
||||||
begin
|
begin
|
||||||
@ -919,7 +919,7 @@ var Owner, Parent : TComponent;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (index<0) or (index>self.Count) then
|
if (index<0) or (index>self.Count) then
|
||||||
raise InternalException.create('TSpkPanes.Insert: Nieprawid�owy indeks!');
|
raise InternalException.create('TSpkPanes.Insert: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
if FRootComponent<>nil then
|
if FRootComponent<>nil then
|
||||||
begin
|
begin
|
||||||
@ -954,8 +954,8 @@ begin
|
|||||||
|
|
||||||
case Operation of
|
case Operation of
|
||||||
opInsert: begin
|
opInsert: begin
|
||||||
// Ustawienie dyspozytora na nil spowoduje, �e podczas
|
// Ustawienie dyspozytora na nil spowoduje, ¿e podczas
|
||||||
// przypisywania w�asno�ci nie b�d� wo�ane metody Notify*
|
// przypisywania w³asnoœci nie bêd¹ wo³ane metody Notify*
|
||||||
TSpkPane(Item).ToolbarDispatch:=nil;
|
TSpkPane(Item).ToolbarDispatch:=nil;
|
||||||
|
|
||||||
TSpkPane(Item).Appearance:=FAppearance;
|
TSpkPane(Item).Appearance:=FAppearance;
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Tab;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Tab.pas *
|
* Plik: spkt_Tab.pas *
|
||||||
* Opis: Komponent zak�adki toolbara *
|
* Opis: Komponent zak³adki toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -66,7 +66,7 @@ type TSpkTab = class;
|
|||||||
// *** Wyszukiwanie tafli ***
|
// *** Wyszukiwanie tafli ***
|
||||||
function FindPaneAt(x, y : integer) : integer;
|
function FindPaneAt(x, y : integer) : integer;
|
||||||
|
|
||||||
// *** Obs�uga designtime i DFM ***
|
// *** Obs³uga designtime i DFM ***
|
||||||
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
|
||||||
procedure DefineProperties(Filer : TFiler); override;
|
procedure DefineProperties(Filer : TFiler); override;
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
@ -88,11 +88,11 @@ type TSpkTab = class;
|
|||||||
constructor Create(AOwner : TComponent); override;
|
constructor Create(AOwner : TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
// *** Geometria, obs�uga tafli, rysowanie ***
|
// *** Geometria, obs³uga tafli, rysowanie ***
|
||||||
function AtLeastOnePaneVisible: boolean;
|
function AtLeastOnePaneVisible: boolean;
|
||||||
procedure Draw(ABuffer : TBitmap; AClipRect : T2DIntRect);
|
procedure Draw(ABuffer : TBitmap; AClipRect : T2DIntRect);
|
||||||
|
|
||||||
// *** Obs�uga gryzonia ***
|
// *** Obs³uga gryzonia ***
|
||||||
procedure MouseLeave;
|
procedure MouseLeave;
|
||||||
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
@ -100,10 +100,10 @@ type TSpkTab = class;
|
|||||||
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
|
||||||
X, Y: Integer);
|
X, Y: Integer);
|
||||||
|
|
||||||
// *** Obs�uga zdarze� dyspozytora ***
|
// *** Obs³uga zdarzeñ dyspozytora ***
|
||||||
procedure NotifyAppearanceChanged;
|
procedure NotifyAppearanceChanged;
|
||||||
|
|
||||||
// *** Obs�uga element�w ***
|
// *** Obs³uga elementów ***
|
||||||
procedure FreeingPane(APane : TSpkPane);
|
procedure FreeingPane(APane : TSpkPane);
|
||||||
|
|
||||||
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
property ToolbarDispatch : TSpkBaseToolbarDispatch read FToolbarDispatch write SetToolbarDispatch;
|
||||||
@ -350,7 +350,7 @@ if FMouseActiveElement.ElementType = etPane then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etTabArea then
|
if FMouseActiveElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etNone then
|
if FMouseActiveElement.ElementType = etNone then
|
||||||
begin
|
begin
|
||||||
@ -374,7 +374,7 @@ if FMouseActiveElement.ElementType = etNone then
|
|||||||
FMouseActiveElement.ElementType:=etTabArea;
|
FMouseActiveElement.ElementType:=etTabArea;
|
||||||
FMouseActiveElement.ElementIndex:=-1;
|
FMouseActiveElement.ElementIndex:=-1;
|
||||||
|
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -390,7 +390,7 @@ if FMouseActiveElement.ElementType = etNone then
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = etTabArea then
|
if FMouseHoverElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -404,7 +404,7 @@ var i : integer;
|
|||||||
NewMouseHoverElement : TSpkMouseTabElement;
|
NewMouseHoverElement : TSpkMouseTabElement;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
// Szukamy obiektu pod mysz�
|
// Szukamy obiektu pod mysz¹
|
||||||
i:=FindPaneAt(x, y);
|
i:=FindPaneAt(x, y);
|
||||||
if i<>-1 then
|
if i<>-1 then
|
||||||
begin
|
begin
|
||||||
@ -431,12 +431,12 @@ if FMouseActiveElement.ElementType = etPane then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etTabArea then
|
if FMouseActiveElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etNone then
|
if FMouseActiveElement.ElementType = etNone then
|
||||||
begin
|
begin
|
||||||
// Je�li element pod mysz� si� zmienia, informujemy poprzedni element o
|
// Jeœli element pod mysz¹ siê zmienia, informujemy poprzedni element o
|
||||||
// tym, �e mysz opuszcza jego obszar
|
// tym, ¿e mysz opuszcza jego obszar
|
||||||
if (NewMouseHoverElement.ElementType<>FMouseHoverElement.ElementType) or
|
if (NewMouseHoverElement.ElementType<>FMouseHoverElement.ElementType) or
|
||||||
(NewMouseHoverElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
(NewMouseHoverElement.ElementIndex<>FMouseHoverElement.ElementIndex) then
|
||||||
begin
|
begin
|
||||||
@ -447,7 +447,7 @@ if FMouseActiveElement.ElementType = etNone then
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = etTabArea then
|
if FMouseHoverElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -458,7 +458,7 @@ if FMouseActiveElement.ElementType = etNone then
|
|||||||
end else
|
end else
|
||||||
if NewMouseHoverElement.ElementType = etTabArea then
|
if NewMouseHoverElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ if FMouseActiveElement.ElementType = etPane then
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etTabArea then
|
if FMouseActiveElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ClearActive and
|
if ClearActive and
|
||||||
@ -494,7 +494,7 @@ if ClearActive and
|
|||||||
end else
|
end else
|
||||||
if FMouseActiveElement.ElementType = etTabArea then
|
if FMouseActiveElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if FMouseHoverElement.ElementType = etPane then
|
if FMouseHoverElement.ElementType = etPane then
|
||||||
@ -504,7 +504,7 @@ if ClearActive and
|
|||||||
end else
|
end else
|
||||||
if FMouseHoverElement.ElementType = etTabArea then
|
if FMouseHoverElement.ElementType = etTabArea then
|
||||||
begin
|
begin
|
||||||
// Placeholder, je�li zajdzie potrzeba obs�ugi tego zdarzenia.
|
// Placeholder, jeœli zajdzie potrzeba obs³ugi tego zdarzenia.
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -583,7 +583,7 @@ if FOverrideAppearance then
|
|||||||
FPanes.Appearance:=FCustomAppearance else
|
FPanes.Appearance:=FCustomAppearance else
|
||||||
FPanes.Appearance:=FAppearance;
|
FPanes.Appearance:=FAppearance;
|
||||||
|
|
||||||
// Metoda pe�ni rol� makra - dlatego nie powiadamia dyspozytora o zmianie.
|
// Metoda pe³ni rolê makra - dlatego nie powiadamia dyspozytora o zmianie.
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSpkTab.SetVisible(const Value: boolean);
|
procedure TSpkTab.SetVisible(const Value: boolean);
|
||||||
@ -655,7 +655,7 @@ var Owner, Parent : TComponent;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
if (index<0) or (index>=self.Count) then
|
if (index<0) or (index>=self.Count) then
|
||||||
raise InternalException.create('TSpkTabs.Insert: Nieprawid�owy indeks!');
|
raise InternalException.create('TSpkTabs.Insert: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
if FRootComponent<>nil then
|
if FRootComponent<>nil then
|
||||||
begin
|
begin
|
||||||
@ -689,8 +689,8 @@ begin
|
|||||||
|
|
||||||
case Operation of
|
case Operation of
|
||||||
opInsert: begin
|
opInsert: begin
|
||||||
// Ustawienie dyspozytora na nil spowoduje, �e podczas
|
// Ustawienie dyspozytora na nil spowoduje, ¿e podczas
|
||||||
// przypisywania w�asno�ci nie b�d� wo�ane metody Notify*
|
// przypisywania w³asnoœci nie bêd¹ wo³ane metody Notify*
|
||||||
TSpkTab(Item).ToolbarDispatch:=nil;
|
TSpkTab(Item).ToolbarDispatch:=nil;
|
||||||
|
|
||||||
TSpkTab(Item).Appearance:=self.FAppearance;
|
TSpkTab(Item).Appearance:=self.FAppearance;
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Tools;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Tools.pas *
|
* Plik: spkt_Tools.pas *
|
||||||
* Opis: Klasy narz�dziowe u�atwiaj�ce renderowanie toolbara. *
|
* Opis: Klasy narzêdziowe u³atwiaj¹ce renderowanie toolbara. *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -70,14 +70,14 @@ TGuiTools.DrawRoundRect(Bitmap.Canvas,
|
|||||||
not(LeftEdgeOpen or BottomEdgeOpen),
|
not(LeftEdgeOpen or BottomEdgeOpen),
|
||||||
not(RightEdgeOpen or BottomEdgeOpen));
|
not(RightEdgeOpen or BottomEdgeOpen));
|
||||||
|
|
||||||
// Wewn�trzna kraw�d�
|
// Wewnêtrzna krawêdŸ
|
||||||
// *** G�ra ***
|
// *** Góra ***
|
||||||
x1:=Rect.Left + radius * TopClosed * LeftClosed + LeftClosed;
|
x1:=Rect.Left + radius * TopClosed * LeftClosed + LeftClosed;
|
||||||
x2:=Rect.Right - radius * TopClosed * RightClosed - RightClosed;
|
x2:=Rect.Right - radius * TopClosed * RightClosed - RightClosed;
|
||||||
y1:=Rect.Top + TopClosed;
|
y1:=Rect.Top + TopClosed;
|
||||||
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, InnerLightColor, ClipRect);
|
TGuiTools.DrawHLine(Bitmap, x1, x2, y1, InnerLightColor, ClipRect);
|
||||||
|
|
||||||
// *** D�� ***
|
// *** Dó³ ***
|
||||||
x1:=Rect.Left + radius * BottomClosed * LeftClosed + LeftClosed;
|
x1:=Rect.Left + radius * BottomClosed * LeftClosed + LeftClosed;
|
||||||
x2:=Rect.Right - radius * BottomClosed * RightClosed - RightClosed;
|
x2:=Rect.Right - radius * BottomClosed * RightClosed - RightClosed;
|
||||||
y1:=Rect.Bottom - BottomClosed;
|
y1:=Rect.Bottom - BottomClosed;
|
||||||
@ -99,7 +99,7 @@ if RightEdgeOpen then
|
|||||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerDarkColor, ClipRect) else
|
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerDarkColor, ClipRect) else
|
||||||
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerLightColor, ClipRect);
|
TGuiTools.DrawVLine(Bitmap, x1, y1, y2, InnerLightColor, ClipRect);
|
||||||
|
|
||||||
// Zaokr�glone naro�niki
|
// Zaokr¹glone naro¿niki
|
||||||
if not(LeftEdgeOpen or TopEdgeOpen) then
|
if not(LeftEdgeOpen or TopEdgeOpen) then
|
||||||
TGuiTools.DrawAARoundCorner(Bitmap,
|
TGuiTools.DrawAARoundCorner(Bitmap,
|
||||||
T2DIntPoint.create(Rect.left + 1, Rect.Top + 1),
|
T2DIntPoint.create(Rect.left + 1, Rect.Top + 1),
|
||||||
@ -129,8 +129,8 @@ if not(RightEdgeOpen or BottomEdgeOpen) then
|
|||||||
InnerLightColor,
|
InnerLightColor,
|
||||||
ClipRect);
|
ClipRect);
|
||||||
|
|
||||||
// Zewn�trzna kraw�d�
|
// Zewnêtrzna krawêdŸ
|
||||||
// Zaokr�glone naro�niki
|
// Zaokr¹glone naro¿niki
|
||||||
if not(TopEdgeOpen) then
|
if not(TopEdgeOpen) then
|
||||||
begin
|
begin
|
||||||
x1:=Rect.Left + Radius * LeftClosed;
|
x1:=Rect.Left + Radius * LeftClosed;
|
||||||
|
@ -3,9 +3,9 @@ unit spkt_Types;
|
|||||||
(*******************************************************************************
|
(*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* Plik: spkt_Types.pas *
|
* Plik: spkt_Types.pas *
|
||||||
* Opis: Definicje typ�w u�ywanych podczas pracy toolbara *
|
* Opis: Definicje typów u¿ywanych podczas pracy toolbara *
|
||||||
* Copyright: (c) 2009 by Spook. Jakiekolwiek u�ycie komponentu bez *
|
* Copyright: (c) 2009 by Spook. Jakiekolwiek u¿ycie komponentu bez *
|
||||||
* uprzedniego uzyskania licencji od autora stanowi z�amanie *
|
* uprzedniego uzyskania licencji od autora stanowi z³amanie *
|
||||||
* prawa autorskiego! *
|
* prawa autorskiego! *
|
||||||
* *
|
* *
|
||||||
*******************************************************************************)
|
*******************************************************************************)
|
||||||
@ -29,7 +29,7 @@ type TSpkComponent = class(TComponent)
|
|||||||
// *** Konstruktor ***
|
// *** Konstruktor ***
|
||||||
constructor Create(AOwner : TComponent); override;
|
constructor Create(AOwner : TComponent); override;
|
||||||
|
|
||||||
// *** Obs�uga parenta ***
|
// *** Obs³uga parenta ***
|
||||||
function HasParent : boolean; override;
|
function HasParent : boolean; override;
|
||||||
function GetParentComponent : TComponent; override;
|
function GetParentComponent : TComponent; override;
|
||||||
procedure SetParentComponent(Value : TComponent); override;
|
procedure SetParentComponent(Value : TComponent); override;
|
||||||
@ -45,11 +45,11 @@ type TSpkCollection = class(TPersistent)
|
|||||||
FListState : TSpkListState;
|
FListState : TSpkListState;
|
||||||
FRootComponent : TComponent;
|
FRootComponent : TComponent;
|
||||||
|
|
||||||
// *** Metody reakcji na zmiany w li�cie ***
|
// *** Metody reakcji na zmiany w liœcie ***
|
||||||
procedure Notify(Item : TComponent; Operation : TOperation); virtual;
|
procedure Notify(Item : TComponent; Operation : TOperation); virtual;
|
||||||
procedure Update; virtual;
|
procedure Update; virtual;
|
||||||
|
|
||||||
// *** Wewn�trzne metody dodawania i wstawiania element�w ***
|
// *** Wewnêtrzne metody dodawania i wstawiania elementów ***
|
||||||
procedure AddItem(AItem : TComponent);
|
procedure AddItem(AItem : TComponent);
|
||||||
procedure InsertItem(index : integer; AItem : TComponent);
|
procedure InsertItem(index : integer; AItem : TComponent);
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ type TSpkCollection = class(TPersistent)
|
|||||||
constructor Create(RootComponent : TComponent); reintroduce; virtual;
|
constructor Create(RootComponent : TComponent); reintroduce; virtual;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
// *** Obs�uga listy ***
|
// *** Obs³uga listy ***
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
function Count : integer;
|
function Count : integer;
|
||||||
procedure Delete(index : integer); virtual;
|
procedure Delete(index : integer); virtual;
|
||||||
@ -70,7 +70,7 @@ type TSpkCollection = class(TPersistent)
|
|||||||
procedure Exchange(item1, item2 : integer);
|
procedure Exchange(item1, item2 : integer);
|
||||||
procedure Move(IndexFrom, IndexTo : integer);
|
procedure Move(IndexFrom, IndexTo : integer);
|
||||||
|
|
||||||
// *** Reader, writer i obs�uga designtime i DFM ***
|
// *** Reader, writer i obs³uga designtime i DFM ***
|
||||||
procedure WriteNames(Writer : TWriter); virtual;
|
procedure WriteNames(Writer : TWriter); virtual;
|
||||||
procedure ReadNames(Reader : TReader); virtual;
|
procedure ReadNames(Reader : TReader); virtual;
|
||||||
procedure ProcessNames(Owner : TComponent); virtual;
|
procedure ProcessNames(Owner : TComponent); virtual;
|
||||||
@ -85,8 +85,8 @@ implementation
|
|||||||
|
|
||||||
procedure TSpkCollection.AddItem(AItem: TComponent);
|
procedure TSpkCollection.AddItem(AItem: TComponent);
|
||||||
begin
|
begin
|
||||||
// Ta metoda mo�e by� wywo�ywana bez przetworzenia nazw (w szczeg�lno�ci, metoda
|
// Ta metoda mo¿e byæ wywo³ywana bez przetworzenia nazw (w szczególnoœci, metoda
|
||||||
// przetwarzaj�ca nazwy korzysta z AddItem)
|
// przetwarzaj¹ca nazwy korzysta z AddItem)
|
||||||
|
|
||||||
Notify(AItem, opInsert);
|
Notify(AItem, opInsert);
|
||||||
FList.Add(AItem);
|
FList.Add(AItem);
|
||||||
@ -122,7 +122,7 @@ end;
|
|||||||
procedure TSpkCollection.Delete(index: integer);
|
procedure TSpkCollection.Delete(index: integer);
|
||||||
begin
|
begin
|
||||||
if (index<0) or (index>=FList.count) then
|
if (index<0) or (index>=FList.count) then
|
||||||
raise InternalException.Create('TSpkCollection.Delete: Nieprawid�owy indeks!');
|
raise InternalException.Create('TSpkCollection.Delete: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
Notify(TComponent(FList[index]), opRemove);
|
Notify(TComponent(FList[index]), opRemove);
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ end;
|
|||||||
function TSpkCollection.GetItems(index: integer): TComponent;
|
function TSpkCollection.GetItems(index: integer): TComponent;
|
||||||
begin
|
begin
|
||||||
if (index<0) or (index>=FList.Count) then
|
if (index<0) or (index>=FList.Count) then
|
||||||
raise InternalException.create('TSpkCollection.GetItems: Nieprawid�owy indeks!');
|
raise InternalException.create('TSpkCollection.GetItems: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
result:=TComponent(FList[index]);
|
result:=TComponent(FList[index]);
|
||||||
end;
|
end;
|
||||||
@ -160,7 +160,7 @@ end;
|
|||||||
procedure TSpkCollection.InsertItem(index: integer; AItem: TComponent);
|
procedure TSpkCollection.InsertItem(index: integer; AItem: TComponent);
|
||||||
begin
|
begin
|
||||||
if (index<0) or (index>FList.Count) then
|
if (index<0) or (index>FList.Count) then
|
||||||
raise InternalException.Create('TSpkCollection.Insert: Nieprawid�owy indeks!');
|
raise InternalException.Create('TSpkCollection.Insert: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
Notify(AItem, opInsert);
|
Notify(AItem, opInsert);
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ procedure TSpkCollection.Move(IndexFrom, IndexTo: integer);
|
|||||||
begin
|
begin
|
||||||
if (indexFrom<0) or (indexFrom>=FList.Count) or
|
if (indexFrom<0) or (indexFrom>=FList.Count) or
|
||||||
(indexTo<0) or (indexTo>=FList.Count) then
|
(indexTo<0) or (indexTo>=FList.Count) then
|
||||||
raise InternalException.Create('TSpkCollection.Move: Nieprawid�owy indeks!');
|
raise InternalException.Create('TSpkCollection.Move: Nieprawid³owy indeks!');
|
||||||
|
|
||||||
FList.Move(IndexFrom, IndexTo);
|
FList.Move(IndexFrom, IndexTo);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user