fix: a TSpeedButton connected to a TAction, and a TMenuItem were not auto-checking

This commit is contained in:
Ansgar Becker
2025-12-09 15:44:10 +01:00
parent 2a23e26f81
commit 42abf46ae3
2 changed files with 4 additions and 2 deletions

View File

@@ -905,7 +905,9 @@ object MainForm: TMainForm
Top = 0
Width = 23
Action = actFavoriteObjectsOnly
AllowAllUp = True
Anchors = [akTop, akRight]
GroupIndex = 1
Images = ImageListMain
ImageIndex = 113
ShowCaption = False
@@ -20434,6 +20436,7 @@ object MainForm: TMainForm
AutoCheck = True
end
object menuShowSizeColumn: TMenuItem
AutoCheck = True
Caption = 'Display size of objects'
OnClick = menuShowSizeColumnClick
end

View File

@@ -12641,8 +12641,7 @@ end;
procedure TMainForm.actFavoriteObjectsOnlyExecute(Sender: TObject);
begin
// Click on "tree favorites" main button
// actFavoriteObjectsOnly.AutoCheck does not work?
//actFavoriteObjectsOnly.Checked := not actFavoriteObjectsOnly.Checked;
// Note: a TSpeedButton connected to an auto-checked TAction needs AllowAllUp + GroupIndex>0
editDatabaseTableFilterChange(Sender);
if actFavoriteObjectsOnly.Checked then
actFavoriteObjectsOnly.ImageIndex := 112