spktoolbar: Initial commit of TSpkPopupMenu.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8725 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2023-02-21 21:47:21 +00:00
parent e456d87021
commit 33121d356d
11 changed files with 964 additions and 38 deletions

View File

@@ -213,7 +213,7 @@ implementation
uses
LCLType, LCLIntf, LCLProc, LCLVersion, SysUtils,
spkt_Pane, spkt_Appearance;
spkt_Pane, spkt_Appearance, SpkPopup;
{ TSpkButtonActionLink }
@@ -894,6 +894,8 @@ begin
exit;
FDropdownMenu := Value;
if (FDropdownMenu is TSpkPopupMenu) then
TSpkPopupMenu(FDropdownMenu).Appearance := Self.Appearance;
if Assigned(FToolbarDispatch) then
FToolbarDispatch.NotifyMetricsChanged;
end;
@@ -1055,6 +1057,7 @@ var
R: TRect;
SeparatorRect: TRect;
SeparatorLineColor: TColor;
drawImgEnabled: Boolean = true;
begin
if FToolbarDispatch = nil then
exit;
@@ -1226,7 +1229,10 @@ begin
if not FEnabled and (FDisabledLargeImages <> nil) then
imgList := FDisabledLargeImages
else
begin
imgList := FLargeImages;
if not FEnabled then drawImgEnabled := false;
end;
if (imgList <> nil) and (FLargeImageIndex >= 0) and (FLargeImageIndex < imgList.Count) then
begin
@@ -1242,7 +1248,7 @@ begin
FButtonRect.Top + LargeButtonBorderSize + LargeButtonGlyphMargin
);
TGUITools.DrawImage(ABuffer.Canvas, imgList, FLargeImageIndex, P, ClipRect,
FLargeImagesWidth, ppi, 1.0);
FLargeImagesWidth, ppi, 1.0, drawImgEnabled);
end;
// Text
@@ -1610,6 +1616,7 @@ var
ppi: Integer;
SeparatorRect: TRect;
SeparatorLineColor: TColor;
drawImgEnabled: Boolean = true;
begin
if (FToolbarDispatch = nil) or (FAppearance = nil) then
exit;
@@ -1698,7 +1705,10 @@ begin
if not FEnabled and (FDisabledImages <> nil) then
imgList := FDisabledImages
else
begin
imgList := FImages;
if not FEnabled then drawImgEnabled := false;
end;
if (imgList <> nil) and (FImageIndex >= 0) and (FImageIndex < imgList.Count) then
begin
@@ -1722,7 +1732,8 @@ begin
P,
ClipRect,
FImagesWidth,
ppi, 1.0
ppi, 1.0,
drawImgEnabled
);
end;