From 93109d8bffa3388c159a442e316953c7909b54f2 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sun, 27 Nov 2016 18:50:10 +0000 Subject: [PATCH] SpkToolbar: Fix checked state not propagating from toggle button back to Action. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5388 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/spktoolbar/SpkToolbar/spkt_Buttons.pas | 3 +++ components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas | 3 +++ components/spktoolbar/demos/actions/unit1.lfm | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/spktoolbar/SpkToolbar/spkt_Buttons.pas b/components/spktoolbar/SpkToolbar/spkt_Buttons.pas index 661aee106..3832506a4 100644 --- a/components/spktoolbar/SpkToolbar/spkt_Buttons.pas +++ b/components/spktoolbar/SpkToolbar/spkt_Buttons.pas @@ -765,6 +765,9 @@ begin FChecked := Value; if Assigned(FToolbarDispatch) then FToolbarDispatch.NotifyVisualsChanged; + + if not (csDesigning in ComponentState) and (Action <> nil) then + (Action as TCustomAction).Checked := Value; end; procedure TSpkBaseButton.SetDropdownMenu(const Value: TPopupMenu); diff --git a/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas b/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas index 1d822c74a..d604af1a5 100644 --- a/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas +++ b/components/spktoolbar/SpkToolbar/spkt_Checkboxes.pas @@ -461,8 +461,11 @@ begin if AValue <> FState then begin FState := AValue; + { if Assigned(FToolbarDispatch) then FToolbarDispatch.NotifyVisualsChanged; + } + inherited SetChecked(Checked); end; end; diff --git a/components/spktoolbar/demos/actions/unit1.lfm b/components/spktoolbar/demos/actions/unit1.lfm index 860e690a1..49b90b9bc 100644 --- a/components/spktoolbar/demos/actions/unit1.lfm +++ b/components/spktoolbar/demos/actions/unit1.lfm @@ -170,7 +170,7 @@ object Form1: TForm1 Appearance.Element.ActiveInnerDarkColor = 961020 Appearance.Element.ActiveCaptionColor = 8405614 Appearance.Element.Style = esRounded - TabIndex = 3 + TabIndex = 0 Images = ImageList LargeImages = LargeImageList Tabs = (