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

The ACaption and ADescription parameters of the various Create...Page support functions may now specify Setup messages containing shorthands like [name].

Martijn Laan 5 жил өмнө
parent
commit
50494eccf1
2 өөрчлөгдсөн 18 нэмэгдсэн , 7 устгасан
  1. 17 7
      Projects/Wizard.pas
  2. 1 0
      whatsnew.htm

+ 17 - 7
Projects/Wizard.pas

@@ -332,7 +332,8 @@ type
 var
   WizardForm: TWizardForm;
 
-function ExpandSetupMessage(const ID: TSetupMessageID): String;
+function ExpandSetupMessage(const Msg: String): String; overload;
+function ExpandSetupMessage(const ID: TSetupMessageID): String; overload;
 function ListContains(const List: TStringList; const S: String): Boolean;
 procedure TidyUpDirName(var Path: String);
 procedure TidyUpGroupName(var Path: String);
@@ -385,10 +386,9 @@ begin
   Result := Format('%.2n', [X]);
 end;
 
-function ExpandSetupMessageEx(const ID: TSetupMessageID;
-  const Space: Integer64): String;
+function ExpandSetupMessageEx(const Msg: String; const Space: Integer64): String; overload;
 begin
-  Result := SetupMessages[ID];
+  Result := Msg;
   {don't localize these}
   StringChange(Result, '[name]', ExpandedAppName);
   StringChange(Result, '[name/ver]', ExpandedAppVerName);
@@ -397,6 +397,11 @@ begin
   StringChange(Result, '[gb]', IntToGBStr(Space));
 end;
 
+function ExpandSetupMessageEx(const ID: TSetupMessageID; const Space: Integer64): String; overload;
+begin
+  Result := ExpandSetupMessageEx(SetupMessages[ID], Space);
+end;
+
 function ExpandMBOrGBSetupMessage(const MBID, GBID: TSetupMessageID;
   const Space: Integer64): String;
 begin
@@ -409,7 +414,12 @@ begin
     Result := ExpandSetupMessageEx(MBID, Space);
 end;
 
-function ExpandSetupMessage(const ID: TSetupMessageID): String;
+function ExpandSetupMessage(const Msg: String): String; overload;
+begin
+  Result := ExpandSetupMessageEx(Msg, MinimumSpace);
+end;
+
+function ExpandSetupMessage(const ID: TSetupMessageID): String; overload;
 begin
   Result := ExpandSetupMessageEx(ID, MinimumSpace);
 end;
@@ -696,13 +706,13 @@ end;
 
 procedure TWizardPage.SetCaption(const Value: String);
 begin
-  FCaption := Value;
+  FCaption := ExpandSetupMessage(Value);
   SyncCaptionAndDescription;
 end;
 
 procedure TWizardPage.SetDescription(const Value: String);
 begin
-  FDescription := Value;
+  FDescription := ExpandSetupMessage(Value);
   SyncCaptionAndDescription;
 end;
 

+ 1 - 0
whatsnew.htm

@@ -90,6 +90,7 @@ For conditions of distribution and use, see <a href="https://jrsoftware.org/file
   <li>Pascal Scripting changes:
   <ul>
     <li>Added new <tt>CalculateButtonWidth</tt> function to the <tt>TSetupForm</tt> support class.</li>
+    <li>The <tt>ACaption</tt> and <tt>ADescription</tt> parameters of the various <tt>Create...Page</tt> support functions may now specify Setup messages containing shorthands like <tt>[name]</tt>.</li>
     <li><i>Fix:</i> Support function <tt>WizardSelectComponents</tt> now also updates component sizes and the current selection's required disk space.</li>
   </ul>
   </li>