Parcourir la source

Don't need TAlphaBitmap anymore.

Martijn Laan il y a 6 ans
Parent
commit
20821c3973

+ 1 - 3
Components/BitmapImage.pas

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

+ 1 - 5
ISHelp/isxclasses.pas

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

+ 2 - 2
Projects/Main.pas

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

+ 3 - 3
Projects/ScriptClasses_C.pas

@@ -224,8 +224,8 @@ end;
 
 procedure RegisterBitmapImage_C(Cl: TPSPascalCompiler);
 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
     RegisterProperty('AlphaFormat', 'TAlphaFormat', iptrw);
   end;
@@ -234,7 +234,7 @@ begin
     RegisterProperty('AutoSize', 'Boolean', iptrw);
     RegisterProperty('BackColor', 'TColor', 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('ReplaceWithColor', 'TColor', iptrw);
     RegisterProperty('Stretch', 'Boolean', iptrw);

+ 5 - 11
Projects/ScriptClasses_R.pas

@@ -2,13 +2,11 @@ unit ScriptClasses_R;
 
 {
   Inno Setup
-  Copyright (C) 1997-2008 Jordan Russell
+  Copyright (C) 1997-2018 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
   Script support classes (run time)
-
-  $Id: ScriptClasses_R.pas,v 1.61 2012/02/05 18:59:23 mlaan Exp $
 }
 
 interface
@@ -41,11 +39,7 @@ procedure RegisterWinControl_R(Cl: TPSRuntimeClassImporter);
 begin
   RIRegisterTWinControl(Cl);
 
-{$IFNDEF UNICODE}
-  with Cl.FindClass(FastUppercase(TWinControl.ClassName)) do
-{$ELSE}
   with Cl.FindClass(AnsiString(TWinControl.ClassName)) do
-{$ENDIF}
   begin
     RegisterPropertyHelper(@TWinControlParentBackground_R, @TWinControlParentBackground_W, 'ParentBackground');
   end;
@@ -136,14 +130,14 @@ begin
   Cl.Add(TFolderTreeView);
 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);
 begin
-  with Cl.Add(TAlphaBitmap) do
+  with Cl.FindClass('TBitmap') do
   begin
-    RegisterPropertyHelper(@TAlphaBitmapAlphaFormat_R, @TAlphaBitmapAlphaFormat_W, 'AlphaFormat');
+    RegisterPropertyHelper(@TBitmapAlphaFormat_R, @TBitmapAlphaFormat_W, 'AlphaFormat');
   end;
   Cl.Add(TBitmapImage);
 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 <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>Removed the <tt>TAlphaBitmap</tt> support class. Its functionality is now provided directly by <tt>TBitmap</tt>.</li>
 </ul>
 </li>
 <li>Inno Setup Preprocessor (ISPP) changes: