Quellcode durchsuchen

Reintroduce WizardStyle=classic/modern. Modern = white background + no bevel1 + resizable by default + 20% larger by default.

Martijn Laan vor 6 Jahren
Ursprung
Commit
4ffddb1aea
5 geänderte Dateien mit 35 neuen und 14 gelöschten Zeilen
  1. 7 6
      ISHelp/isetup.xml
  2. 15 5
      Projects/Compile.pas
  3. 3 1
      Projects/Struct.pas
  4. 6 0
      Projects/Wizard.pas
  5. 4 2
      whatsnew.htm

+ 7 - 6
ISHelp/isetup.xml

@@ -4722,7 +4722,7 @@ DiskSliceSize=1457664
 
 <setuptopic directive="WizardResizable">
 <setupvalid><link topic="yesnonotes"><tt>yes</tt> or <tt>no</tt></link></setupvalid>
-<setupdefault><tt>no</tt></setupdefault>
+<setupdefault><tt>yes</tt> if <link topic="setup_wizardstyle">WizardStyle</link> is set to <tt>modern</tt>, <tt>no</tt> otherwise</setupdefault>
 <body>
 <p>If set to <tt>yes</tt>, the user will be able to resize and maximize the wizard window.</p>
 <p>Use <tt>Anchors</tt> properties to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls and wizard pages if you have any. See the <i>CodeClasses.iss</i> example script for an example.</p>
@@ -4734,7 +4734,7 @@ DiskSliceSize=1457664
 <setuptopic directive="WizardSizePercent">
 <setupformat><tt><i>a</i>,<i>b</i></tt>, where <tt><i>a</i></tt> is the horizontal size, and <tt><i>b</i></tt> is the vertical size.</setupformat>
 <setupvalid>each size: <tt>100</tt> or more</setupvalid>
-<setupdefault><tt>100,100</tt></setupdefault>
+<setupdefault><tt>120,120</tt> if <link topic="setup_wizardstyle">WizardStyle</link> is set to <tt>modern</tt>, <tt>100,100</tt> otherwise</setupdefault>
 <body>
 <p>Lets you increase the default size of the wizard window without increasing the font size. A size of for example 120 means a 20% size increase.</p>
 <p>If you specify only one size it will be used as both the horizontal and the vertical size.</p>
@@ -4769,16 +4769,17 @@ DiskSliceSize=1457664
 </setuptopic>
 
 <setuptopic directive="WizardStyle">
-<setupvalid><tt>modern</tt></setupvalid>
-<setupdefault><tt>modern</tt></setupdefault>
+<setupvalid><tt>classic</tt> or <tt>modern</tt></setupvalid>
+<setupdefault><tt>classic</tt></setupdefault>
 <body>
-<p><i>Obsolete in 3.0.</i> Inno Setup 2.x supported an alternate wizard style called "classic". Support for the "classic" style has been dropped in Inno Setup 3.0.</p>
+<p>If this directive is set to <tt>modern</tt>, Setup will show a more modern look and also the defaults for <link topic="setup_wizardresizable">WizardResizable</link> and <link topic="setup_wizardsizepercent">WizardSizePercent</link> change to respectively <tt>yes</tt> and <tt>120,120</tt>.</p>
+<p>Use <tt>Anchors</tt> properties to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls and wizard pages if you have any. See the <i>CodeClasses.iss</i> example script for an example.</p>
 </body>
 </setuptopic>
 
 <setuptopic directive="UninstallStyle">
 <body>
-<p><i>Obsolete in 5.0.0.</i> Only the "modern" uninstaller style is supported now.</p>
+<p><i>Obsolete in 5.0.0.</i></p>
 </body>
 </setuptopic>
 

+ 15 - 5
Projects/Compile.pas

@@ -4456,9 +4456,11 @@ begin
           SetupHeader.WizardSizePercentY, 100)
       end;
     ssWizardStyle: begin
-        if CompareText(Value, 'modern') = 0 then begin
-          { no-op }
-        end else
+        if CompareText(Value, 'classic') = 0 then
+          SetupHeader.WizardStyle := wsClassic
+        else if CompareText(Value, 'modern') = 0 then
+          SetupHeader.WizardStyle := wsModern
+        else
           Invalid;
       end;
   end;
@@ -8652,8 +8654,7 @@ begin
     SetupHeader.CloseApplicationsFilter := '*.exe,*.dll,*.chm';
     SetupHeader.WizardImageAlphaFormat := afIgnored;
     UsedUserAreasWarning := True;
-    SetupHeader.WizardSizePercentX := 100;
-    SetupHeader.WizardSizePercentY := 100;
+    SetupHeader.WizardStyle := wsClassic;
 
     { Read [Setup] section }
     EnumIniSection(EnumSetup, 'Setup', 0, 0, True, True, '', False, False);
@@ -8835,6 +8836,15 @@ begin
     end;
     if shAlwaysUsePersonalGroup in SetupHeader.Options then
       UsedUserAreas.Add('AlwaysUsePersonalGroup');
+    if SetupDirectiveLines[ssWizardSizePercent] = 0 then begin
+      if SetupHeader.WizardStyle = wsModern then
+        SetupHeader.WizardSizePercentX := 120
+      else
+        SetupHeader.WizardSizePercentX := 100;
+      SetupHeader.WizardSizePercentY := SetupHeader.WizardSizePercentX;
+    end;
+    if (SetupDirectiveLines[ssWizardResizable] = 0) and (SetupHeader.WizardStyle = wsModern) then
+      Include(SetupHeader.Options, shWizardResizable);
 
     LineNumber := 0;
 

+ 3 - 1
Projects/Struct.pas

@@ -76,6 +76,7 @@ type
   TSetupPrivilegesRequired = (prNone, prPowerUser, prAdmin, prLowest);
   TSetupPrivilegesRequiredOverride = (proCommandLine, proDialog);
   TSetupPrivilegesRequiredOverrides = set of TSetupPrivilegesRequiredOverride;
+  TSetupWizardStyle = (wsClassic, wsModern);
 const
   SetupProcessorArchitectureNames: array[TSetupProcessorArchitecture] of String =
     ('Unknown', 'x86', 'x64', 'Itanium', 'ARM64');
@@ -103,8 +104,9 @@ type
       NumRunEntries, NumUninstallRunEntries: Integer;
     MinVersion, OnlyBelowVersion: TSetupVersionData;
     BackColor, BackColor2: Longint;
-    WizardImageAlphaFormat: (afIgnored, afDefined, afPremultiplied); // Must be same as Graphics.TAlphaFormat
+    WizardStyle: TSetupWizardStyle;
     WizardSizePercentX, WizardSizePercentY: Integer;
+    WizardImageAlphaFormat: (afIgnored, afDefined, afPremultiplied); // Must be same as Graphics.TAlphaFormat
     PasswordHash: TSHA1Digest;
     PasswordSalt: TSetupSalt;
     ExtraDiskSpaceRequired: Integer64;

+ 6 - 0
Projects/Wizard.pas

@@ -791,6 +791,12 @@ begin
   Dec(X, W1);
   BackButton.Left := X;
 
+  { Initialize wizard style }
+  if SetupHeader.WizardStyle = wsModern then begin
+    OuterNotebook.Color := clWindow;
+    Bevel1.Visible := False;
+  end;
+
   { Initialize images }
   WizardBitmapImage.Bitmap := SelectBestImage(WizardImages, WizardBitmapImage.Width, WizardBitmapImage.Height);
   WizardBitmapImage.Center := True;

+ 4 - 2
whatsnew.htm

@@ -74,12 +74,14 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>Two separate installation runs that do not share the same administrative or non administrative install mode no longer count as the <a href="http://www.jrsoftware.org/is6help/index.php?topic=sameappnotes">same application</a>. This means you can now install these modes <a href="http://www.jrsoftware.org/is6help/index.php?topic=sidebyside">side-by-side</a> even if the installers share the same <tt>AppId</tt> setting (or if <tt>AppId</tt> is not set, the same <tt>AppName</tt> setting.)</li>
   <li><b>Change in default behavior:</b> To avoid entries with identical names in the <i>Add/Remove Programs</i> Control Panel applet Setup will now automatically mark the new entry with a text like &quot;Current user&quot; or &quot;64-bit&quot; when necessary during a <a href="http://www.jrsoftware.org/is6help/index.php?topic=sidebyside">side-by-side</a> installation.</a>
 </ul>
-<p><span class="head2">Resizable wizard window</span></p>
-<p>The wizard window is now resizable:</p>
+<p><span class="head2">Resizable wizard window and new modern wizard style</span></p>
+<p>The wizard window is now optionally resizable and supports a more modern look:</p>
 <ul>
   <li>Added new [Setup] section directive: <tt>WizardResizable</tt>. If this directive is set to <tt>yes</tt>, the user will be able to resize and maximize the wizard window.</li>
   <li>Added new [Setup] section directive: <tt>WizardSizePercent</tt>, which can be used to increase the default size of the wizard window without increasing the font size.</li>
   <li>Pascal Scripting change: Added new <tt>Anchors</tt> property to all controls which allows you to add full support for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> to all your custom controls and wizard pages if you have any. See the <i>CodeClasses.iss</i> example script for an example.</li>
+  <li>Added new [Setup] section directive: <tt>WizardStyle</tt>. If this directive is set to <tt>modern</tt>, Setup will show a more modern look and also the defaults for <tt>WizardResizable</tt> and <tt>WizardSizePercent</tt> change to respectively <tt>yes</tt> and <tt>120,120</tt>.</li>
+  <li><b>Change in default behavior:</b> Earlier versions of Inno Setup also supported <tt>WizardStyle</tt> and if you still have <tt>WizardStyle=modern</tt> in your script (which was allowed for backward compatibility but didn't actually change anything) and don't want to new modern look, you should remove this line or change it to <tt>WizardStyle=classic</tt>.</li>
 </ul>
 <p><span class="head2">Other changes</span></p>
 <ul>