Browse Source

Fix RT_RCDATA deprecation.

lainz 6 years ago
parent
commit
a53cfa8ac1

+ 2 - 2
bcimagebutton.pas

@@ -46,7 +46,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, Forms, Controls, Graphics,
   Classes, SysUtils, Forms, Controls, Graphics,
-  {$IFDEF FPC}LCLType, LResources, LMessages,{$ENDIF} ExtCtrls,
+  {$IFDEF FPC}{$ifdef Windows}Windows,{$endif}LCLType, LResources, LMessages,{$ENDIF} ExtCtrls,
   Types,
   Types,
   {$IFNDEF FPC}Windows, Messages, BGRAGraphics, GraphType, FPImage, {$ENDIF}
   {$IFNDEF FPC}Windows, Messages, BGRAGraphics, GraphType, FPImage, {$ENDIF}
   { BGRAControls }
   { BGRAControls }
@@ -1390,7 +1390,7 @@ end;
 
 
 procedure TBCCustomImageButton.LoadFromBitmapResource(const Resource: string);
 procedure TBCCustomImageButton.LoadFromBitmapResource(const Resource: string);
 begin
 begin
-  LoadFromBitmapResource(Resource, RT_RCDATA);
+  LoadFromBitmapResource(Resource, {$ifdef Windows}Windows.{$endif}RT_RCDATA);
 end;
 end;
 
 
 procedure TBCCustomImageButton.LoadFromBitmapFile;
 procedure TBCCustomImageButton.LoadFromBitmapFile;

+ 31 - 30
test/test_bccontrols/test_bcimagebutton/unit1.lfm

@@ -1,20 +1,20 @@
 object Form1: TForm1
 object Form1: TForm1
   Left = 214
   Left = 214
-  Height = 302
+  Height = 403
   Top = 122
   Top = 122
-  Width = 248
+  Width = 331
   Caption = 'Form1'
   Caption = 'Form1'
-  ClientHeight = 302
-  ClientWidth = 248
+  ClientHeight = 403
+  ClientWidth = 331
   Color = clWhite
   Color = clWhite
-  DesignTimePPI = 72
   OnCreate = FormCreate
   OnCreate = FormCreate
-  LCLVersion = '1.9.0.0'
+  LCLVersion = '2.0.4.0'
   object BCImageButton1: TBCImageButton
   object BCImageButton1: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 12
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 16
+    Width = 275
+    AlphaTest = False
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     Animation = False
     Animation = False
     BitmapFile = 'sample_1.png'
     BitmapFile = 'sample_1.png'
@@ -29,10 +29,11 @@ object Form1: TForm1
     ParentFont = False
     ParentFont = False
   end
   end
   object BCImageButton2: TBCImageButton
   object BCImageButton2: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 59
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 79
+    Width = 275
+    AlphaTest = False
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     BitmapFile = 'sample_2.png'
     BitmapFile = 'sample_2.png'
     BitmapOptions.Direction = sdVertical
     BitmapOptions.Direction = sdVertical
@@ -40,10 +41,10 @@ object Form1: TForm1
     ParentFont = False
     ParentFont = False
   end
   end
   object BCImageButton3: TBCImageButton
   object BCImageButton3: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 107
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 143
+    Width = 275
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     BitmapFile = 'sample_3.png'
     BitmapFile = 'sample_3.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
@@ -59,10 +60,10 @@ object Form1: TForm1
     ParentFont = False
     ParentFont = False
   end
   end
   object BCImageButton4: TBCImageButton
   object BCImageButton4: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 154
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 205
+    Width = 275
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     BitmapFile = 'sample_4.png'
     BitmapFile = 'sample_4.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
@@ -76,10 +77,10 @@ object Form1: TForm1
     ParentFont = False
     ParentFont = False
   end
   end
   object BCImageButton5: TBCImageButton
   object BCImageButton5: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 202
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 269
+    Width = 275
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     BitmapFile = 'sample_5.png'
     BitmapFile = 'sample_5.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
@@ -92,10 +93,10 @@ object Form1: TForm1
     ParentFont = False
     ParentFont = False
   end
   end
   object BCImageButton6: TBCImageButton
   object BCImageButton6: TBCImageButton
-    Left = 24
-    Height = 41
-    Top = 250
-    Width = 206
+    Left = 32
+    Height = 55
+    Top = 333
+    Width = 275
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
     Animation = False
     Animation = False
     BitmapOptions.Direction = sdVertical
     BitmapOptions.Direction = sdVertical

+ 71 - 1
test/test_bcimagebutton_alpha/test.lpi

@@ -19,8 +19,78 @@
         <Resource_2 FileName="title_bath3.gif" Type="RCDATA" ResourceName="TITLE_BATH3"/>
         <Resource_2 FileName="title_bath3.gif" Type="RCDATA" ResourceName="TITLE_BATH3"/>
       </Resources>
       </Resources>
     </General>
     </General>
-    <BuildModes Count="1">
+    <BuildModes Count="3">
       <Item1 Name="Default" Default="True"/>
       <Item1 Name="Default" Default="True"/>
+      <Item2 Name="Debug">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="test"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <Parsing>
+            <SyntaxOptions>
+              <IncludeAssertionCode Value="True"/>
+            </SyntaxOptions>
+          </Parsing>
+          <CodeGeneration>
+            <Checks>
+              <IOChecks Value="True"/>
+              <RangeChecks Value="True"/>
+              <OverflowChecks Value="True"/>
+              <StackChecks Value="True"/>
+            </Checks>
+            <VerifyObjMethodCallValidity Value="True"/>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <DebugInfoType Value="dsDwarf2Set"/>
+              <UseHeaptrc Value="True"/>
+              <TrashVariables Value="True"/>
+              <UseExternalDbgSyms Value="True"/>
+            </Debugging>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+        </CompilerOptions>
+      </Item2>
+      <Item3 Name="Release">
+        <CompilerOptions>
+          <Version Value="11"/>
+          <PathDelim Value="\"/>
+          <Target>
+            <Filename Value="test"/>
+          </Target>
+          <SearchPaths>
+            <IncludeFiles Value="$(ProjOutDir)"/>
+            <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+          </SearchPaths>
+          <CodeGeneration>
+            <SmartLinkUnit Value="True"/>
+            <Optimizations>
+              <OptimizationLevel Value="3"/>
+            </Optimizations>
+          </CodeGeneration>
+          <Linking>
+            <Debugging>
+              <GenerateDebugInfo Value="False"/>
+            </Debugging>
+            <LinkSmart Value="True"/>
+            <Options>
+              <Win32>
+                <GraphicApplication Value="True"/>
+              </Win32>
+            </Options>
+          </Linking>
+        </CompilerOptions>
+      </Item3>
     </BuildModes>
     </BuildModes>
     <PublishOptions>
     <PublishOptions>
       <Version Value="2"/>
       <Version Value="2"/>