Browse Source

Fix OpenRadioButton not being checked by default. Perhaps caused by a Delphi update? Or was it always like this?

Also preselect the first MRU item if available.
Martijn Laan 2 months ago
parent
commit
aa8d63470c
1 changed files with 8 additions and 2 deletions
  1. 8 2
      Projects/Src/IDE.StartupForm.pas

+ 8 - 2
Projects/Src/IDE.StartupForm.pas

@@ -66,8 +66,12 @@ uses
 
 procedure TStartupForm.SetMRUFilesList(const MRUFilesList: TStringList);
 begin
-  OpenListBox.Items.AddStrings(MRUFilesList);
-  UpdateHorizontalExtent(OpenListBox);
+  if MRUFilesList.Count > 0 then begin
+    const NDefault = OpenListBox.Items.Count;
+    OpenListBox.Items.AddStrings(MRUFilesList);
+    UpdateHorizontalExtent(OpenListBox);
+    OpenListBox.ItemIndex := NDefault;
+  end;
 end;
 
 procedure TStartupForm.UpdateImages;
@@ -104,6 +108,8 @@ begin
   OpenListBox.Items.Add(SCompilerMoreFiles);
   OpenListBox.ItemIndex := 0;
   UpdateHorizontalExtent(OpenListBox);
+
+  OpenRadioButton.Checked := True;
   ActiveControl := OpenRadioButton;
 end;