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
This commit is contained in:
wp_xxyyzz
2016-11-27 18:50:10 +00:00
parent f46c8e1032
commit 93109d8bff
3 changed files with 7 additions and 1 deletions

View File

@@ -765,6 +765,9 @@ begin
FChecked := Value; FChecked := Value;
if Assigned(FToolbarDispatch) then if Assigned(FToolbarDispatch) then
FToolbarDispatch.NotifyVisualsChanged; FToolbarDispatch.NotifyVisualsChanged;
if not (csDesigning in ComponentState) and (Action <> nil) then
(Action as TCustomAction).Checked := Value;
end; end;
procedure TSpkBaseButton.SetDropdownMenu(const Value: TPopupMenu); procedure TSpkBaseButton.SetDropdownMenu(const Value: TPopupMenu);

View File

@@ -461,8 +461,11 @@ begin
if AValue <> FState then if AValue <> FState then
begin begin
FState := AValue; FState := AValue;
{
if Assigned(FToolbarDispatch) then if Assigned(FToolbarDispatch) then
FToolbarDispatch.NotifyVisualsChanged; FToolbarDispatch.NotifyVisualsChanged;
}
inherited SetChecked(Checked);
end; end;
end; end;

View File

@@ -170,7 +170,7 @@ object Form1: TForm1
Appearance.Element.ActiveInnerDarkColor = 961020 Appearance.Element.ActiveInnerDarkColor = 961020
Appearance.Element.ActiveCaptionColor = 8405614 Appearance.Element.ActiveCaptionColor = 8405614
Appearance.Element.Style = esRounded Appearance.Element.Style = esRounded
TabIndex = 3 TabIndex = 0
Images = ImageList Images = ImageList
LargeImages = LargeImageList LargeImages = LargeImageList
Tabs = ( Tabs = (