2
0
Эх сурвалжийг харах

Pascal Scripting change: Fix: Support function WizardSelectComponents now also updates component sizes and the current selection's required disk space.

Martijn Laan 5 жил өмнө
parent
commit
b9e38b15ae

+ 2 - 2
Projects/ScriptFunc_R.pas

@@ -1817,9 +1817,9 @@ begin
       StringChange(S, '/', '\');
       SetStringsFromCommaString(StringList, S);
       if Proc.Name = 'WIZARDSELECTCOMPONENTS' then
-        GetWizardForm.SelectComponents(StringList, nil, False)
+        GetWizardForm.SelectComponents(StringList)
       else
-        GetWizardForm.SelectTasks(StringList, nil);
+        GetWizardForm.SelectTasks(StringList);
     finally
       StringList.Free();
     end;

+ 22 - 8
Projects/Wizard.pas

@@ -202,7 +202,9 @@ type
     procedure RegisterExistingPage(const ID: Integer;
      const AOuterNotebookPage, AInnerNotebookPage: TNewNotebookPage;
      const ACaption, ADescription: String);
+    procedure SelectComponents(const SelectComponents, DeselectComponents: TStringList; const KeepFixedComponents: Boolean); overload;
     procedure SelectComponentsFromType(const TypeName: String; const OnlySelectFixedComponents: Boolean);
+    procedure SelectTasks(const SelectTasks, DeselectTasks: TStringList); overload;
     function ShouldSkipPage(const PageID: Integer): Boolean;
     procedure UpdateComponentSizes;
     procedure UpdateComponentSizesEnum(Index: Integer; HasChildren: Boolean; Ext: LongInt);
@@ -234,8 +236,8 @@ type
     function PageIndexFromID(const ID: Integer): Integer;
     procedure UpdateCurPageButtonVisibility;
     procedure SetCurPage(const NewPageID: Integer);
-    procedure SelectComponents(const SelectComponents, DeselectComponents: TStringList; const KeepFixedComponents: Boolean);
-    procedure SelectTasks(const SelectTasks, DeselectTasks: TStringList);
+    procedure SelectComponents(const ASelectComponents: TStringList); overload;
+    procedure SelectTasks(const ASelectTasks: TStringList); overload;
     procedure FlipSizeAndCenterIfNeeded(const ACenterInsideControl: Boolean;
       const CenterInsideControlCtl: TWinControl; const CenterInsideControlInsideClientArea: Boolean); override;
     procedure UpdateRunList(const SelectedComponents, SelectedTasks: TStringList);
@@ -1248,8 +1250,8 @@ begin
     end;
   end;
 
-  UpdateComponentSizes();
-  CalcCurrentComponentsSpace();
+  UpdateComponentSizes;
+  CalcCurrentComponentsSpace;
 
   //Show or hide the components list based on the selected type
   if HasCustomType then begin
@@ -1678,6 +1680,13 @@ begin
   end;
 end;
 
+procedure TWizardForm.SelectComponents(const ASelectComponents: TStringList);
+begin
+  SelectComponents(ASelectComponents, nil, False);
+  UpdateComponentSizes;
+  CalcCurrentComponentsSpace;
+end;
+
 procedure TWizardForm.SelectTasks(const SelectTasks, DeselectTasks: TStringList);
 var
   I: Integer;
@@ -1705,6 +1714,11 @@ begin
   end;
 end;
 
+procedure TWizardForm.SelectTasks(const ASelectTasks: TStringList);
+begin
+  SelectTasks(ASelectTasks, nil);
+end;
+
 procedure TWizardForm.SelectComponentsFromType(const TypeName: String; const OnlySelectFixedComponents: Boolean);
 var
   ComponentTypes: TStringList;
@@ -2650,8 +2664,8 @@ begin
     end;
   end;
 
-  UpdateComponentSizes();
-  CalcCurrentComponentsSpace();
+  UpdateComponentSizes;
+  CalcCurrentComponentsSpace;
 end;
 
 procedure TWizardForm.ComponentsListClickCheck(Sender: TObject);
@@ -2683,8 +2697,8 @@ begin
     end
   end;
 
-  UpdateComponentSizes();
-  CalcCurrentComponentsSpace();
+  UpdateComponentSizes;
+  CalcCurrentComponentsSpace;
 end;
 
 procedure TWizardForm.NoIconsCheckClick(Sender: TObject);

+ 1 - 0
whatsnew.htm

@@ -31,6 +31,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
 <p><a name="6.0.6"></a><span class="ver">6.0.6-dev </span><span class="date">(?)</span></p>
 <ul>
   <li>Compiler IDE change: <a href="https://i.imgur.com/wHoJ3FG.png">Improved highlighting</a> for the [CustomMessages] and [Messages] sections.</li>
+  <li>Pascal Scripting change: <i>Fix:</i> Support function <tt>WizardSelectComponents</tt> now also updates component sizes and the current selection's required disk space.</li>
 </ul>
 
 <p><a name="6.0.5"></a><span class="ver">6.0.5 </span><span class="date">(2020-05-21)</span></p>