Browse Source

Don't need TAlphaBitmap anymore.

Martijn Laan 6 years ago
parent
commit
20821c3973

+ 1 - 3
Components/BitmapImage.pas

@@ -2,7 +2,7 @@ unit BitmapImage;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2004 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
@@ -15,8 +15,6 @@ uses
   Windows, Controls, Graphics, Classes, Resample;
   Windows, Controls, Graphics, Classes, Resample;
 
 
 type
 type
-  TAlphaBitmap = TBitmap;
-
   TBitmapImage = class(TGraphicControl)
   TBitmapImage = class(TGraphicControl)
   private
   private
     FAutoSize: Boolean;
     FAutoSize: Boolean;

+ 1 - 5
ISHelp/isxclasses.pas

@@ -589,15 +589,11 @@ end;
 
 
 TAlphaFormat = (afIgnored, afDefined, afPremultiplied);
 TAlphaFormat = (afIgnored, afDefined, afPremultiplied);
 
 
-TAlphaBitmap = class(TBitmap)
-  property AlphaFormat: TAlphaFormat; read write;
-end;
-
 TBitmapImage = class(TGraphicControl)
 TBitmapImage = class(TGraphicControl)
   property AutoSize: Boolean; read write;
   property AutoSize: Boolean; read write;
   property BackColor: TColor; read write;
   property BackColor: TColor; read write;
   property Center: Boolean; read write;
   property Center: Boolean; read write;
-  property Bitmap: TAlphaBitmap; read write;
+  property Bitmap: TBitmap; read write;
   property ReplaceColor: TColor; read write;
   property ReplaceColor: TColor; read write;
   property ReplaceWithColor: TColor; read write;
   property ReplaceWithColor: TColor; read write;
   property Stretch: Boolean; read write;
   property Stretch: Boolean; read write;

+ 2 - 2
Projects/Main.pas

@@ -2599,8 +2599,8 @@ var
     try
     try
       ReadFileIntoStream(MemStream, R);
       ReadFileIntoStream(MemStream, R);
       MemStream.Seek(0, soFromBeginning);
       MemStream.Seek(0, soFromBeginning);
-      Result := TAlphaBitmap.Create;
-      TAlphaBitmap(Result).AlphaFormat := TAlphaFormat(SetupHeader.WizardImageAlphaFormat);
+      Result := TBitmap.Create;
+      Result.AlphaFormat := TAlphaFormat(SetupHeader.WizardImageAlphaFormat);
       Result.LoadFromStream(MemStream);
       Result.LoadFromStream(MemStream);
     finally
     finally
       MemStream.Free;
       MemStream.Free;

+ 3 - 3
Projects/ScriptClasses_C.pas

@@ -224,8 +224,8 @@ end;
 
 
 procedure RegisterBitmapImage_C(Cl: TPSPascalCompiler);
 procedure RegisterBitmapImage_C(Cl: TPSPascalCompiler);
 begin
 begin
-  cl.AddTypeS('TAlphaFormat', '(afIgnored, afDefined, afPremultiplied)');
-  with Cl.AddClassN(CL.FindClass('TBitmap'),'TAlphaBitmap') do
+  Cl.AddTypeS('TAlphaFormat', '(afIgnored, afDefined, afPremultiplied)');
+  with Cl.FindClass('TBitmap') do
   begin
   begin
     RegisterProperty('AlphaFormat', 'TAlphaFormat', iptrw);
     RegisterProperty('AlphaFormat', 'TAlphaFormat', iptrw);
   end;
   end;
@@ -234,7 +234,7 @@ begin
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BackColor', 'TColor', iptrw);
     RegisterProperty('BackColor', 'TColor', iptrw);
     RegisterProperty('Center', 'Boolean', iptrw);
     RegisterProperty('Center', 'Boolean', iptrw);
-    RegisterProperty('Bitmap', 'TAlphaBitmap', iptrw); //TBitmapImage.Bitmap property is actually published as a TBitmap but in reality it always returns a TAlphaBitmap
+    RegisterProperty('Bitmap', 'TBitmap', iptrw);
     RegisterProperty('ReplaceColor', 'TColor', iptrw);
     RegisterProperty('ReplaceColor', 'TColor', iptrw);
     RegisterProperty('ReplaceWithColor', 'TColor', iptrw);
     RegisterProperty('ReplaceWithColor', 'TColor', iptrw);
     RegisterProperty('Stretch', 'Boolean', iptrw);
     RegisterProperty('Stretch', 'Boolean', iptrw);

+ 5 - 11
Projects/ScriptClasses_R.pas

@@ -2,13 +2,11 @@ unit ScriptClasses_R;
 
 
 {
 {
   Inno Setup
   Inno Setup
-  Copyright (C) 1997-2008 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
   For conditions of distribution and use, see LICENSE.TXT.
 
 
   Script support classes (run time)
   Script support classes (run time)
-
-  $Id: ScriptClasses_R.pas,v 1.61 2012/02/05 18:59:23 mlaan Exp $
 }
 }
 
 
 interface
 interface
@@ -41,11 +39,7 @@ procedure RegisterWinControl_R(Cl: TPSRuntimeClassImporter);
 begin
 begin
   RIRegisterTWinControl(Cl);
   RIRegisterTWinControl(Cl);
 
 
-{$IFNDEF UNICODE}
-  with Cl.FindClass(FastUppercase(TWinControl.ClassName)) do
-{$ELSE}
   with Cl.FindClass(AnsiString(TWinControl.ClassName)) do
   with Cl.FindClass(AnsiString(TWinControl.ClassName)) do
-{$ENDIF}
   begin
   begin
     RegisterPropertyHelper(@TWinControlParentBackground_R, @TWinControlParentBackground_W, 'ParentBackground');
     RegisterPropertyHelper(@TWinControlParentBackground_R, @TWinControlParentBackground_W, 'ParentBackground');
   end;
   end;
@@ -136,14 +130,14 @@ begin
   Cl.Add(TFolderTreeView);
   Cl.Add(TFolderTreeView);
 end;
 end;
 
 
-procedure TAlphaBitmapAlphaFormat_W(Self: TAlphaBitmap; const T: TAlphaFormat); begin Self.AlphaFormat := T; end;
-procedure TAlphaBitmapAlphaFormat_R(Self: TAlphaBitmap; var T: TAlphaFormat); begin T := Self.AlphaFormat; end;
+procedure TBitmapAlphaFormat_W(Self: TBitmap; const T: TAlphaFormat); begin Self.AlphaFormat := T; end;
+procedure TBitmapAlphaFormat_R(Self: TBitmap; var T: TAlphaFormat); begin T := Self.AlphaFormat; end;
 
 
 procedure RegisterBitmapImage_R(Cl: TPSRuntimeClassImporter);
 procedure RegisterBitmapImage_R(Cl: TPSRuntimeClassImporter);
 begin
 begin
-  with Cl.Add(TAlphaBitmap) do
+  with Cl.FindClass('TBitmap') do
   begin
   begin
-    RegisterPropertyHelper(@TAlphaBitmapAlphaFormat_R, @TAlphaBitmapAlphaFormat_W, 'AlphaFormat');
+    RegisterPropertyHelper(@TBitmapAlphaFormat_R, @TBitmapAlphaFormat_W, 'AlphaFormat');
   end;
   end;
   Cl.Add(TBitmapImage);
   Cl.Add(TBitmapImage);
 end;
 end;

+ 1 - 0
whatsnew.htm

@@ -90,6 +90,7 @@ For conditions of distribution and use, see <a href="http://www.jrsoftware.org/f
   <li>Added new special-purpose <i>HelpTextNote</i> message that can be used to specify one or more lines of text that are added to the list of parameters in the summary shown when passing /HELP on the command line. This message defaults to an empty string so make sure to provide a non-empty default for all languages from your main script if you want to use it.</li>
   <li>Added new special-purpose <i>HelpTextNote</i> message that can be used to specify one or more lines of text that are added to the list of parameters in the summary shown when passing /HELP on the command line. This message defaults to an empty string so make sure to provide a non-empty default for all languages from your main script if you want to use it.</li>
   <li>Added new <tt>SameStr</tt> and <tt>SameText</tt> support functions.</li>
   <li>Added new <tt>SameStr</tt> and <tt>SameText</tt> support functions.</li>
   <li>Renamed the <tt>IsAdminLoggedOn</tt> support function to <tt>IsAdmin</tt>. The old name is still supported, but it is recommended to update your scripts to the new name.</li>
   <li>Renamed the <tt>IsAdminLoggedOn</tt> support function to <tt>IsAdmin</tt>. The old name is still supported, but it is recommended to update your scripts to the new name.</li>
+  <li>Removed the <tt>TAlphaBitmap</tt> support class. Its functionality is now provided directly by <tt>TBitmap</tt>.</li>
 </ul>
 </ul>
 </li>
 </li>
 <li>Inno Setup Preprocessor (ISPP) changes:
 <li>Inno Setup Preprocessor (ISPP) changes: