From c9f325c87f59120c203bd5933d0609d80ba7d7eb Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 28 Oct 2016 10:54:30 +0200 Subject: [PATCH] toolbar, handle dropdown buttons --- src/ce_dsgncontrols.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ce_dsgncontrols.pas b/src/ce_dsgncontrols.pas index aadb5c73..0298db8c 100644 --- a/src/ce_dsgncontrols.pas +++ b/src/ce_dsgncontrols.pas @@ -92,7 +92,7 @@ begin fResourceName:=value; if csDesigning in ComponentState then exit; - if Style = tbsButton then + if Style in [tbsButton, tbsDropDown] then begin fPng.FreeImage; fPng.LoadFromResourceName(HINSTANCE, fResourceName); @@ -146,9 +146,11 @@ var x, y: integer; begin inherited; - if (fResourceName <> '') and (style = tbsButton) then + if (fResourceName <> '') and (style in [tbsButton, tbsDropDown]) then begin rc := ClientRect; + if Style = tbsDropDown then + rc.Right := rc.left + FToolBar.ButtonWidth; x := ((rc.Right - rc.Left) - fPng.width) div 2; y := ((rc.Bottom - rc.Top) - fPng.Height) div 2; if Enabled then