Skip to content

Commit

Permalink
Pascal Scripting change: Fix: Support function WizardSelectComponents…
Browse files Browse the repository at this point in the history
… now also updates component sizes and the current selection's required disk space.
  • Loading branch information
martijnlaan committed Jun 9, 2020
1 parent ac0ab74 commit b9e38b1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Projects/ScriptFunc_R.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1817,9 +1817,9 @@ function OtherProc(Caller: TPSExec; Proc: TPSExternalProcRec; Global, Stack: TPS
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;
Expand Down
30 changes: 22 additions & 8 deletions Projects/Wizard.pas
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ TWizardForm = class(TSetupForm)
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);
Expand Down Expand Up @@ -234,8 +236,8 @@ TWizardForm = class(TSetupForm)
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);
Expand Down Expand Up @@ -1248,8 +1250,8 @@ constructor TWizardForm.Create(AOwner: TComponent);
end;
end;

UpdateComponentSizes();
CalcCurrentComponentsSpace();
UpdateComponentSizes;
CalcCurrentComponentsSpace;

//Show or hide the components list based on the selected type
if HasCustomType then begin
Expand Down Expand Up @@ -1678,6 +1680,13 @@ procedure TWizardForm.SelectComponents(const SelectComponents, DeselectComponent
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;
Expand Down Expand Up @@ -1705,6 +1714,11 @@ procedure TWizardForm.SelectTasks(const SelectTasks, DeselectTasks: TStringList)
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;
Expand Down Expand Up @@ -2650,8 +2664,8 @@ procedure TWizardForm.TypesComboChange(Sender: TObject);
end;
end;

UpdateComponentSizes();
CalcCurrentComponentsSpace();
UpdateComponentSizes;
CalcCurrentComponentsSpace;
end;

procedure TWizardForm.ComponentsListClickCheck(Sender: TObject);
Expand Down Expand Up @@ -2683,8 +2697,8 @@ procedure TWizardForm.ComponentsListClickCheck(Sender: TObject);
end
end;

UpdateComponentSizes();
CalcCurrentComponentsSpace();
UpdateComponentSizes;
CalcCurrentComponentsSpace;
end;

procedure TWizardForm.NoIconsCheckClick(Sender: TObject);
Expand Down
1 change: 1 addition & 0 deletions whatsnew.htm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<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>
Expand Down

0 comments on commit b9e38b1

Please sign in to comment.