Browse Source

bcimagebutton.pas
- streaming with LoadFromFile and SaveToFile methods
- Bitmap loading with BitmapFile and LoadFromBitmapFile
- Smoother Animation and now can be enabled or disabled
tests: save settings in lps files
other: version 3.1 svn

lainz 11 years ago
parent
commit
712b4a1a23

+ 96 - 2
bcimagebutton.pas

@@ -163,6 +163,10 @@ type
     FDestRect: TRect;
     FDestRect: TRect;
     FTimer: TTimer;
     FTimer: TTimer;
     FFade: TFading;
     FFade: TFading;
+    FAnimation: boolean;
+    FBitmapFile: string;
+    procedure SetFAnimation(AValue: boolean);
+    procedure SetFBitmapFile(AValue: string);
     procedure SetFBitmapOptions(AValue: TBCImageButtonSliceScalingOptions);
     procedure SetFBitmapOptions(AValue: TBCImageButtonSliceScalingOptions);
     procedure Fade(Sender: TObject);
     procedure Fade(Sender: TObject);
   protected
   protected
@@ -181,8 +185,17 @@ type
     { Public declarations }
     { Public declarations }
     property BitmapOptions: TBCImageButtonSliceScalingOptions
     property BitmapOptions: TBCImageButtonSliceScalingOptions
       read FBitmapOptions write SetFBitmapOptions;
       read FBitmapOptions write SetFBitmapOptions;
+    property Animation: boolean read FAnimation write SetFAnimation default True;
+    property BitmapFile: string read FBitmapFile write SetFBitmapFile;
     constructor Create(AOwner: TComponent); override;
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
     destructor Destroy; override;
+    { It loads the 'BitmapFile' }
+    procedure LoadFromBitmapFile;
+    { Streaming }
+    procedure SaveToFile(AFileName: string);
+    procedure LoadFromFile(AFileName: string);
+    procedure OnFindClass(Reader: TReader; const AClassName: string;
+      var ComponentClass: TComponentClass);
   published
   published
     { Published declarations }
     { Published declarations }
   end;
   end;
@@ -192,13 +205,13 @@ type
     property Action;
     property Action;
     property Align;
     property Align;
     property Anchors;
     property Anchors;
-    //property Animation;
+    property Animation;
     property AutoSize;
     property AutoSize;
     //property AutoSizeExtraHorizontal;
     //property AutoSizeExtraHorizontal;
     //property AutoSizeExtraVertical;
     //property AutoSizeExtraVertical;
     property BidiMode;
     property BidiMode;
     //property Bitmap;
     //property Bitmap;
-    //property BitmapFile;
+    property BitmapFile;
     property BitmapOptions;
     property BitmapOptions;
     property BorderSpacing;
     property BorderSpacing;
     property Caption;
     property Caption;
@@ -755,6 +768,20 @@ begin
   FBitmapOptions := AValue;
   FBitmapOptions := AValue;
 end;
 end;
 
 
+procedure TBCCustomImageButton.SetFAnimation(AValue: boolean);
+begin
+  if FAnimation = AValue then
+    Exit;
+  FAnimation := AValue;
+end;
+
+procedure TBCCustomImageButton.SetFBitmapFile(AValue: string);
+begin
+  if FBitmapFile = AValue then
+    Exit;
+  FBitmapFile := AValue;
+end;
+
 procedure TBCCustomImageButton.DrawControl;
 procedure TBCCustomImageButton.DrawControl;
 var
 var
   temp: TBGRABitmap;
   temp: TBGRABitmap;
@@ -932,24 +959,48 @@ end;
 procedure TBCCustomImageButton.DoMouseDown;
 procedure TBCCustomImageButton.DoMouseDown;
 begin
 begin
   FFade.Mode := fmFadeOut;
   FFade.Mode := fmFadeOut;
+
+  if Animation then
+    FFade.Step := 60
+  else
+    FFade.Step := 255;
+
   inherited DoMouseDown;
   inherited DoMouseDown;
 end;
 end;
 
 
 procedure TBCCustomImageButton.DoMouseUp;
 procedure TBCCustomImageButton.DoMouseUp;
 begin
 begin
   FFade.Mode := fmFadeIn;
   FFade.Mode := fmFadeIn;
+
+  if Animation then
+    FFade.Step := 20
+  else
+    FFade.Step := 255;
+
   inherited DoMouseUp;
   inherited DoMouseUp;
 end;
 end;
 
 
 procedure TBCCustomImageButton.DoMouseEnter;
 procedure TBCCustomImageButton.DoMouseEnter;
 begin
 begin
   FFade.Mode := fmFadeIn;
   FFade.Mode := fmFadeIn;
+
+  if Animation then
+    FFade.Step := 15
+  else
+    FFade.Step := 255;
+
   inherited DoMouseEnter;
   inherited DoMouseEnter;
 end;
 end;
 
 
 procedure TBCCustomImageButton.DoMouseLeave;
 procedure TBCCustomImageButton.DoMouseLeave;
 begin
 begin
   FFade.Mode := fmFadeOut;
   FFade.Mode := fmFadeOut;
+
+  if Animation then
+    FFade.Step := 8
+  else
+    FFade.Step := 255;
+
   inherited DoMouseLeave;
   inherited DoMouseLeave;
 end;
 end;
 
 
@@ -980,6 +1031,7 @@ begin
     FTimer := TTimer.Create(Self);
     FTimer := TTimer.Create(Self);
     FTimer.Interval := 15;
     FTimer.Interval := 15;
     FTimer.OnTimer := @Fade;
     FTimer.OnTimer := @Fade;
+    FAnimation := True;
 
 
   finally
   finally
     Exclude(FControlState, csCreating);
     Exclude(FControlState, csCreating);
@@ -1005,4 +1057,46 @@ begin
   inherited Destroy;
   inherited Destroy;
 end;
 end;
 
 
+procedure TBCCustomImageButton.LoadFromBitmapFile;
+begin
+  if BitmapFile <> '' then
+    if BitmapOptions.Bitmap <> nil then
+      BitmapOptions.Bitmap.LoadFromFile(BitmapFile)
+    else
+      BitmapOptions.Bitmap := TBGRABitmap.Create(BitmapFile);
+end;
+
+procedure TBCCustomImageButton.SaveToFile(AFileName: string);
+var
+  AStream: TMemoryStream;
+begin
+  AStream := TMemoryStream.Create;
+  try
+    WriteComponentAsTextToStream(AStream, Self);
+    AStream.SaveToFile(AFileName);
+  finally
+    AStream.Free;
+  end;
+end;
+
+procedure TBCCustomImageButton.LoadFromFile(AFileName: string);
+var
+  AStream: TMemoryStream;
+begin
+  AStream := TMemoryStream.Create;
+  try
+    AStream.LoadFromFile(AFileName);
+    ReadComponentFromTextStream(AStream, TComponent(Self), @OnFindClass);
+  finally
+    AStream.Free;
+  end;
+end;
+
+procedure TBCCustomImageButton.OnFindClass(Reader: TReader;
+  const AClassName: string; var ComponentClass: TComponentClass);
+begin
+  if CompareText(AClassName, 'TBCImageButton') = 0 then
+    ComponentClass := TBCImageButton;
+end;
+
 end.
 end.

+ 3 - 3
bgracontrols.lpk

@@ -1,4 +1,4 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <Package Version="4">
   <Package Version="4">
     <Name Value="bgracontrols"/>
     <Name Value="bgracontrols"/>
@@ -10,8 +10,8 @@
       <CodeGeneration>
       <CodeGeneration>
         <SmartLinkUnit Value="True"/>
         <SmartLinkUnit Value="True"/>
         <Optimizations>
         <Optimizations>
-          <VariablesInRegisters Value="True"/>
           <OptimizationLevel Value="3"/>
           <OptimizationLevel Value="3"/>
+          <VariablesInRegisters Value="True"/>
         </Optimizations>
         </Optimizations>
       </CodeGeneration>
       </CodeGeneration>
       <Linking>
       <Linking>
@@ -26,7 +26,7 @@
         <CompilerPath Value="$(CompPath)"/>
         <CompilerPath Value="$(CompPath)"/>
       </Other>
       </Other>
     </CompilerOptions>
     </CompilerOptions>
-    <Version Major="3"/>
+    <Version Major="3" Minor="1"/>
     <Files Count="21">
     <Files Count="21">
       <Item1>
       <Item1>
         <Filename Value="bcbasectrls.pas"/>
         <Filename Value="bcbasectrls.pas"/>

+ 1 - 1
docs/readme.txt

@@ -1,4 +1,4 @@
-BGRAControls v3.0.0.0 alpha
+BGRAControls v3.1.0.0
 
 
 Site: https://sourceforge.net/p/bgra-controls/
 Site: https://sourceforge.net/p/bgra-controls/
 Wiki: http://wiki.lazarus.freepascal.org/BGRAControls
 Wiki: http://wiki.lazarus.freepascal.org/BGRAControls

+ 8 - 1
test/test_bccontrols/test_bcimagebutton/unit1.lfm

@@ -8,13 +8,15 @@ object Form1: TForm1
   ClientWidth = 330
   ClientWidth = 330
   Color = clWhite
   Color = clWhite
   OnCreate = FormCreate
   OnCreate = FormCreate
-  LCLVersion = '1.1'
+  LCLVersion = '1.2.0.3'
   object BCImageButton1: TBCImageButton
   object BCImageButton1: TBCImageButton
     Left = 32
     Left = 32
     Height = 55
     Height = 55
     Top = 16
     Top = 16
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    Animation = False
+    BitmapFile = 'sample_1.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.MarginTop = 4
     BitmapOptions.MarginTop = 4
     BitmapOptions.MarginRight = 4
     BitmapOptions.MarginRight = 4
@@ -29,6 +31,7 @@ object Form1: TForm1
     Top = 79
     Top = 79
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    BitmapFile = 'sample_2.png'
     BitmapOptions.Direction = sdVertical
     BitmapOptions.Direction = sdVertical
     BitmapOptions.Proportional = True
     BitmapOptions.Proportional = True
   end
   end
@@ -38,6 +41,7 @@ object Form1: TForm1
     Top = 143
     Top = 143
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    BitmapFile = 'sample_3.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.RepeatMiddleHorizontal = True
     BitmapOptions.RepeatMiddleHorizontal = True
     BitmapOptions.RepeatMiddleVertical = True
     BitmapOptions.RepeatMiddleVertical = True
@@ -55,6 +59,7 @@ object Form1: TForm1
     Top = 206
     Top = 206
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    BitmapFile = 'sample_4.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.MarginTop = 5
     BitmapOptions.MarginTop = 5
     BitmapOptions.MarginRight = 5
     BitmapOptions.MarginRight = 5
@@ -70,6 +75,7 @@ object Form1: TForm1
     Top = 270
     Top = 270
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    BitmapFile = 'sample_5.png'
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.AutoDetectRepeat = True
     BitmapOptions.MarginTop = 4
     BitmapOptions.MarginTop = 4
     BitmapOptions.MarginRight = 4
     BitmapOptions.MarginRight = 4
@@ -84,6 +90,7 @@ object Form1: TForm1
     Top = 334
     Top = 334
     Width = 274
     Width = 274
     Anchors = [akTop, akLeft, akRight]
     Anchors = [akTop, akLeft, akRight]
+    Animation = False
     BitmapOptions.Direction = sdVertical
     BitmapOptions.Direction = sdVertical
     Caption = 'BCImageButton6'
     Caption = 'BCImageButton6'
   end
   end

+ 8 - 6
test/test_bccontrols/test_bcimagebutton/unit1.pas

@@ -6,7 +6,8 @@ interface
 
 
 uses
 uses
   Forms, Graphics,
   Forms, Graphics,
-  BCImageButton, BGRABitmap;
+  BCImageButton, BGRABitmap,
+  BCFilters, BCButton;
 
 
 type
 type
 
 
@@ -37,11 +38,12 @@ implementation
 
 
 procedure TForm1.FormCreate(Sender: TObject);
 procedure TForm1.FormCreate(Sender: TObject);
 begin
 begin
-  BCImageButton1.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_1.png');
-  BCImageButton2.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_2.png');
-  BCImageButton3.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_3.png');
-  BCImageButton4.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_4.png');
-  BCImageButton5.BitmapOptions.Bitmap := TBGRABitmap.Create('sample_5.png');
+  BCImageButton1.LoadFromBitmapFile;
+  BCImageButton2.LoadFromBitmapFile;
+  BCImageButton3.LoadFromBitmapFile;
+  BCImageButton4.LoadFromBitmapFile;
+  BCImageButton5.LoadFromBitmapFile;
+  GrayScale(BCImageButton1.BitmapOptions.Bitmap);
 end;
 end;
 
 
 end.
 end.

+ 3 - 342
test/test_bgracontrols/test_bgraimagemanipulation/ProjectBGRAImageManipulationDemo.lpi

@@ -3,6 +3,7 @@
   <ProjectOptions>
   <ProjectOptions>
     <Version Value="9"/>
     <Version Value="9"/>
     <General>
     <General>
+      <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
       <MainUnit Value="0"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
@@ -10,7 +11,6 @@
         <DpiAware Value="True"/>
         <DpiAware Value="True"/>
       </XPManifest>
       </XPManifest>
       <Icon Value="0"/>
       <Icon Value="0"/>
-      <ActiveWindowIndexAtStart Value="0"/>
     </General>
     </General>
     <i18n>
     <i18n>
       <EnableI18N LFM="False"/>
       <EnableI18N LFM="False"/>
@@ -20,7 +20,7 @@
       <MinorVersionNr Value="2"/>
       <MinorVersionNr Value="2"/>
       <StringTable ProductVersion=""/>
       <StringTable ProductVersion=""/>
     </VersionInfo>
     </VersionInfo>
-    <BuildModes Count="2" Active="Release">
+    <BuildModes Count="2">
       <Item1 Name="Debug" Default="True"/>
       <Item1 Name="Debug" Default="True"/>
       <Item2 Name="Release">
       <Item2 Name="Release">
         <CompilerOptions>
         <CompilerOptions>
@@ -79,15 +79,11 @@
         <PackageName Value="LCL"/>
         <PackageName Value="LCL"/>
       </Item2>
       </Item2>
     </RequiredPackages>
     </RequiredPackages>
-    <Units Count="38">
+    <Units Count="2">
       <Unit0>
       <Unit0>
         <Filename Value="ProjectBGRAImageManipulationDemo.lpr"/>
         <Filename Value="ProjectBGRAImageManipulationDemo.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="ProjectBGRAImageManipulationDemo"/>
         <UnitName Value="ProjectBGRAImageManipulationDemo"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="14"/>
-        <UsageCount Value="228"/>
       </Unit0>
       </Unit0>
       <Unit1>
       <Unit1>
         <Filename Value="unitbgraimagemanipulationdemo.pas"/>
         <Filename Value="unitbgraimagemanipulationdemo.pas"/>
@@ -96,342 +92,8 @@
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="UnitBGRAImageManipulationDemo"/>
         <UnitName Value="UnitBGRAImageManipulationDemo"/>
-        <IsVisibleTab Value="True"/>
-        <EditorIndex Value="0"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="25"/>
-        <CursorPos X="35" Y="44"/>
-        <UsageCount Value="228"/>
-        <Loaded Value="True"/>
-        <LoadedDesigner Value="True"/>
       </Unit1>
       </Unit1>
-      <Unit2>
-        <Filename Value="../library/Graph64/Screen64.pas"/>
-        <UnitName Value="Screen64"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="82"/>
-        <CursorPos X="3" Y="115"/>
-        <UsageCount Value="1"/>
-      </Unit2>
-      <Unit3>
-        <Filename Value="../bgraimagemanipulation.pas"/>
-        <UnitName Value="BGRAImageManipulation"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="969"/>
-        <CursorPos X="3" Y="1004"/>
-        <ExtraEditorCount Value="1"/>
-        <ExtraEditor1>
-          <WindowIndex Value="0"/>
-          <TopLine Value="1"/>
-          <CursorPos X="34" Y="1097"/>
-        </ExtraEditor1>
-        <UsageCount Value="64"/>
-        <Bookmarks Count="5">
-          <Item0 X="1" Y="1323" ID="4"/>
-          <Item1 X="1" Y="1057" ID="5"/>
-          <Item2 X="11" Y="196" ID="1"/>
-          <Item3 X="4" Y="1065" ID="2"/>
-          <Item4 X="3" Y="305" ID="3"/>
-        </Bookmarks>
-      </Unit3>
-      <Unit4>
-        <Filename Value="../../../codetools/codetoolsstrconsts.pas"/>
-        <UnitName Value="CodeToolsStrConsts"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="261"/>
-        <CursorPos X="1" Y="296"/>
-        <UsageCount Value="1"/>
-      </Unit4>
-      <Unit5>
-        <Filename Value="../../../ajctrls/ajtooledit.pas"/>
-        <UnitName Value="ajtooledit"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="710"/>
-        <CursorPos X="3" Y="717"/>
-        <UsageCount Value="2"/>
-      </Unit5>
-      <Unit6>
-        <Filename Value="../../../../lcl/comctrls.pp"/>
-        <UnitName Value="ComCtrls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="3046"/>
-        <CursorPos X="8" Y="3064"/>
-        <UsageCount Value="2"/>
-      </Unit6>
-      <Unit7>
-        <Filename Value="../../../../lcl/include/lcl_defines.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="2"/>
-      </Unit7>
-      <Unit8>
-        <Filename Value="../../../../lcl/include/trackbar.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="296"/>
-        <CursorPos X="16" Y="324"/>
-        <UsageCount Value="2"/>
-      </Unit8>
-      <Unit9>
-        <Filename Value="../../../../lcl/widgetset/wscomctrls.pp"/>
-        <UnitName Value="WSComCtrls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="554"/>
-        <CursorPos X="14" Y="561"/>
-        <UsageCount Value="2"/>
-      </Unit9>
-      <Unit10>
-        <Filename Value="../../../bgrabitmap/bgradefaultbitmap.pas"/>
-        <UnitName Value="BGRADefaultBitmap"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="2978"/>
-        <CursorPos X="46" Y="2994"/>
-        <UsageCount Value="2"/>
-      </Unit10>
-      <Unit11>
-        <Filename Value="unitbgraimagemanipulationdemo.lfm"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="2" Y="1"/>
-        <UsageCount Value="10"/>
-        <DefaultSyntaxHighlighter Value="LFM"/>
-      </Unit11>
-      <Unit12>
-        <Filename Value="../bgraimagemanipulation_icon.lrs"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="2"/>
-      </Unit12>
-      <Unit13>
-        <Filename Value="../../bgraimagemanipulation.pas"/>
-        <UnitName Value="BGRAImageManipulation"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="290"/>
-        <CursorPos X="39" Y="304"/>
-        <UsageCount Value="18"/>
-        <Bookmarks Count="3">
-          <Item0 X="8" Y="912" ID="1"/>
-          <Item1 X="23" Y="1134" ID="2"/>
-          <Item2 X="1" Y="358" ID="8"/>
-        </Bookmarks>
-      </Unit13>
-      <Unit14>
-        <Filename Value="/windows/Projects/Components/ImageManipulation/ImageManipulation.pas"/>
-        <UnitName Value="ImageManipulation"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1039"/>
-        <CursorPos X="35" Y="1068"/>
-        <UsageCount Value="14"/>
-        <Bookmarks Count="3">
-          <Item0 X="9" Y="852" ID="2"/>
-          <Item1 X="12" Y="1203" ID="4"/>
-          <Item2 X="3" Y="450" ID="1"/>
-        </Bookmarks>
-      </Unit14>
-      <Unit15>
-        <Filename Value="../../../lcl/controls.pp"/>
-        <UnitName Value="Controls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1404"/>
-        <CursorPos X="25" Y="1048"/>
-        <UsageCount Value="9"/>
-      </Unit15>
-      <Unit16>
-        <Filename Value="../bgraimagelist.pas"/>
-        <UnitName Value="BGRAImageList"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="63" Y="4"/>
-        <UsageCount Value="10"/>
-      </Unit16>
-      <Unit17>
-        <Filename Value="../../bgrabitmap/bgradefaultbitmap.pas"/>
-        <UnitName Value="BGRADefaultBitmap"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1421"/>
-        <CursorPos X="13" Y="1450"/>
-        <UsageCount Value="9"/>
-      </Unit17>
-      <Unit18>
-        <Filename Value="../../../../../emerson/Projects/Morey/AccessControlServer/trunk/projectaccesscontrolserver.lpr"/>
-        <UnitName Value="projectaccesscontrolserver"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="18" Y="1"/>
-        <UsageCount Value="5"/>
-      </Unit18>
-      <Unit19>
-        <Filename Value="../../../../../emerson/Projects/Morey/AccessControlServer/trunk/library/synaser/synafpc.pas"/>
-        <UnitName Value="synafpc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="96"/>
-        <CursorPos X="18" Y="44"/>
-        <UsageCount Value="2"/>
-      </Unit19>
-      <Unit20>
-        <Filename Value="../../../../../emerson/Projects/Morey/AccessControlServer/trunk/library/synaser/synaser.pas"/>
-        <UnitName Value="synaser"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="2145"/>
-        <CursorPos X="21" Y="2176"/>
-        <UsageCount Value="2"/>
-      </Unit20>
-      <Unit21>
-        <Filename Value="../bgraimagebuttontest/umain.pas"/>
-        <ComponentName Value="Form1"/>
-        <HasResources Value="True"/>
-        <ResourceBaseClass Value="Form"/>
-        <UnitName Value="umain"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="3"/>
-      </Unit21>
-      <Unit22>
-        <Filename Value="../../../lcl/include/control.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="2986"/>
-        <CursorPos X="13" Y="3026"/>
-        <UsageCount Value="9"/>
-        <Bookmarks Count="1">
-          <Item0 X="8" Y="2938" ID="6"/>
-        </Bookmarks>
-      </Unit22>
-      <Unit23>
-        <Filename Value="../bgraimagemanipulationdemo.old/unitbgraimagemanipulationdemo.pas"/>
-        <ComponentName Value="FormBGRAImageManipulationDemo"/>
-        <HasResources Value="True"/>
-        <ResourceBaseClass Value="Form"/>
-        <UnitName Value="UnitBGRAImageManipulationDemo"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="101"/>
-        <CursorPos X="3" Y="106"/>
-        <UsageCount Value="2"/>
-      </Unit23>
-      <Unit24>
-        <Filename Value="../bgrapanel.pas"/>
-        <UnitName Value="BGRAPanel"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="29"/>
-        <CursorPos X="23" Y="45"/>
-        <UsageCount Value="9"/>
-      </Unit24>
-      <Unit25>
-        <Filename Value="../../../lcl/extctrls.pp"/>
-        <UnitName Value="ExtCtrls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="9"/>
-      </Unit25>
-      <Unit26>
-        <Filename Value="../../../lcl/lclclasses.pp"/>
-        <UnitName Value="LCLClasses"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="34"/>
-        <CursorPos X="36" Y="52"/>
-        <UsageCount Value="3"/>
-      </Unit26>
-      <Unit27>
-        <Filename Value="../../../lcl/include/controlcanvas.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="2" Y="5"/>
-        <UsageCount Value="9"/>
-      </Unit27>
-      <Unit28>
-        <Filename Value="../../bgracontrols.old/bgraimagemanipulation.pas"/>
-        <UnitName Value="BGRAImageManipulation"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="963"/>
-        <CursorPos X="1" Y="992"/>
-        <UsageCount Value="8"/>
-      </Unit28>
-      <Unit29>
-        <Filename Value="../../bgrabitmap/bgragtkbitmap.pas"/>
-        <UnitName Value="BGRAGtkBitmap"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="84"/>
-        <CursorPos X="1" Y="102"/>
-        <UsageCount Value="2"/>
-      </Unit29>
-      <Unit30>
-        <Filename Value="../../../lcl/comctrls.pp"/>
-        <UnitName Value="ComCtrls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1832"/>
-        <CursorPos X="1" Y="1851"/>
-        <UsageCount Value="25"/>
-      </Unit30>
-      <Unit31>
-        <Filename Value="../bgratrackbar.pas"/>
-        <UnitName Value="BGRATrackBar"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="41"/>
-        <CursorPos X="34" Y="52"/>
-        <UsageCount Value="47"/>
-      </Unit31>
-      <Unit32>
-        <Filename Value="../../../lcl/include/trackbar.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="48"/>
-        <CursorPos X="1" Y="64"/>
-        <UsageCount Value="47"/>
-      </Unit32>
-      <Unit33>
-        <Filename Value="../../../lcl/widgetset/wscomctrls.pp"/>
-        <UnitName Value="WSComCtrls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="163"/>
-        <CursorPos X="26" Y="194"/>
-        <UsageCount Value="3"/>
-      </Unit33>
-      <Unit34>
-        <Filename Value="../../../lcl/widgetset/wscontrols.pp"/>
-        <UnitName Value="WSControls"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="82"/>
-        <CursorPos X="3" Y="89"/>
-        <UsageCount Value="3"/>
-      </Unit34>
-      <Unit35>
-        <Filename Value="../../../lcl/widgetset/wslclclasses.pp"/>
-        <UnitName Value="WSLCLClasses"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="44"/>
-        <CursorPos X="3" Y="62"/>
-        <UsageCount Value="3"/>
-      </Unit35>
-      <Unit36>
-        <Filename Value="../bgrabutton.pas"/>
-        <UnitName Value="BGRAButton"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="34"/>
-      </Unit36>
-      <Unit37>
-        <Filename Value="../../../bgraimagemanipulation.pas"/>
-        <UnitName Value="BGRAImageManipulation"/>
-        <EditorIndex Value="1"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="61"/>
-        <CursorPos X="29" Y="68"/>
-        <UsageCount Value="10"/>
-        <Loaded Value="True"/>
-      </Unit37>
     </Units>
     </Units>
-    <JumpHistory Count="2" HistoryIndex="1">
-      <Position1>
-        <Filename Value="unitbgraimagemanipulationdemo.pas"/>
-        <Caret Line="154" Column="50" TopLine="140"/>
-      </Position1>
-      <Position2>
-        <Filename Value="unitbgraimagemanipulationdemo.pas"/>
-        <Caret Line="155" Column="50" TopLine="141"/>
-      </Position2>
-    </JumpHistory>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
     <Version Value="11"/>
     <Version Value="11"/>
@@ -491,5 +153,4 @@
       </Item3>
       </Item3>
     </Exceptions>
     </Exceptions>
   </Debugging>
   </Debugging>
-  <EditorMacros Count="0"/>
 </CONFIG>
 </CONFIG>

+ 3 - 300
test/test_extra/slicescaling_customdrawn_win7/test_customdrawn_win7.lpi

@@ -4,13 +4,13 @@
     <Version Value="9"/>
     <Version Value="9"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
+      <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
       <MainUnit Value="0"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
       <XPManifest>
       <XPManifest>
         <DpiAware Value="True"/>
         <DpiAware Value="True"/>
       </XPManifest>
       </XPManifest>
-      <ActiveWindowIndexAtStart Value="0"/>
     </General>
     </General>
     <i18n>
     <i18n>
       <EnableI18N LFM="False"/>
       <EnableI18N LFM="False"/>
@@ -18,7 +18,7 @@
     <VersionInfo>
     <VersionInfo>
       <StringTable ProductVersion=""/>
       <StringTable ProductVersion=""/>
     </VersionInfo>
     </VersionInfo>
-    <BuildModes Count="2" Active="Release">
+    <BuildModes Count="2">
       <Item1 Name="Debug" Default="True"/>
       <Item1 Name="Debug" Default="True"/>
       <Item2 Name="Release">
       <Item2 Name="Release">
         <CompilerOptions>
         <CompilerOptions>
@@ -77,15 +77,11 @@
         <PackageName Value="LCL"/>
         <PackageName Value="LCL"/>
       </Item2>
       </Item2>
     </RequiredPackages>
     </RequiredPackages>
-    <Units Count="30">
+    <Units Count="3">
       <Unit0>
       <Unit0>
         <Filename Value="test_customdrawn_win7.lpr"/>
         <Filename Value="test_customdrawn_win7.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="test_customdrawn_win7"/>
         <UnitName Value="test_customdrawn_win7"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="81" Y="10"/>
-        <UsageCount Value="38"/>
       </Unit0>
       </Unit0>
       <Unit1>
       <Unit1>
         <Filename Value="utest.pas"/>
         <Filename Value="utest.pas"/>
@@ -94,305 +90,13 @@
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
         <UnitName Value="utest"/>
         <UnitName Value="utest"/>
-        <IsVisibleTab Value="True"/>
-        <EditorIndex Value="0"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="28"/>
-        <CursorPos X="50" Y="12"/>
-        <UsageCount Value="38"/>
-        <Loaded Value="True"/>
-        <LoadedDesigner Value="True"/>
       </Unit1>
       </Unit1>
       <Unit2>
       <Unit2>
         <Filename Value="customdrawn_windows7.pas"/>
         <Filename Value="customdrawn_windows7.pas"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
         <UnitName Value="customdrawn_windows7"/>
         <UnitName Value="customdrawn_windows7"/>
-        <EditorIndex Value="1"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="422"/>
-        <CursorPos X="76" Y="438"/>
-        <UsageCount Value="38"/>
-        <Loaded Value="True"/>
       </Unit2>
       </Unit2>
-      <Unit3>
-        <Filename Value="..\slicescaling.pas"/>
-        <UnitName Value="slicescaling"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="87"/>
-        <CursorPos X="3" Y="100"/>
-        <UsageCount Value="14"/>
-      </Unit3>
-      <Unit4>
-        <Filename Value="..\bgraimagebutton.pas"/>
-        <UnitName Value="BGRAImageButton"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="10"/>
-      </Unit4>
-      <Unit5>
-        <Filename Value="..\custombgraimagebutton.pas"/>
-        <UnitName Value="CustomBGRAImageButton"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="168"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="10"/>
-      </Unit5>
-      <Unit6>
-        <Filename Value="..\custombgraimagebutton.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="899"/>
-        <CursorPos X="38" Y="869"/>
-        <UsageCount Value="11"/>
-      </Unit6>
-      <Unit7>
-        <Filename Value="C:\lazarus\fpc\2.6.0\source\packages\fcl-base\src\inifiles.pp"/>
-        <UnitName Value="IniFiles"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="180"/>
-        <CursorPos X="3" Y="191"/>
-        <UsageCount Value="10"/>
-      </Unit7>
-      <Unit8>
-        <Filename Value="C:\lazarus\components\lazutils\fileutil.pas"/>
-        <UnitName Value="FileUtil"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="185"/>
-        <CursorPos X="10" Y="196"/>
-        <UsageCount Value="10"/>
-      </Unit8>
-      <Unit9>
-        <Filename Value="..\bgrabitmapthemeutils.pas"/>
-        <UnitName Value="bgrabitmapthemeutils"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="32"/>
-        <CursorPos X="3" Y="43"/>
-        <UsageCount Value="10"/>
-      </Unit9>
-      <Unit10>
-        <Filename Value="C:\lazarus\lcl\customdrawndrawers.pas"/>
-        <UnitName Value="customdrawndrawers"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="620"/>
-        <CursorPos X="3" Y="622"/>
-        <UsageCount Value="10"/>
-      </Unit10>
-      <Unit11>
-        <Filename Value="C:\lazarus\lcl\lclproc.pas"/>
-        <UnitName Value="LCLProc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="852"/>
-        <CursorPos X="1" Y="865"/>
-        <UsageCount Value="10"/>
-      </Unit11>
-      <Unit12>
-        <Filename Value="C:\lazarus\fpc\2.6.0\source\rtl\inc\objpash.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="179"/>
-        <CursorPos X="23" Y="192"/>
-        <UsageCount Value="10"/>
-      </Unit12>
-      <Unit13>
-        <Filename Value="C:\lazarus\lcl\customdrawn_winxp.pas"/>
-        <UnitName Value="customdrawn_winxp"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="6"/>
-        <CursorPos X="3" Y="19"/>
-        <UsageCount Value="10"/>
-      </Unit13>
-      <Unit14>
-        <Filename Value="C:\lazarus\lcl\customdrawn_common.pas"/>
-        <UnitName Value="customdrawn_common"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="47"/>
-        <CursorPos X="15" Y="58"/>
-        <UsageCount Value="11"/>
-      </Unit14>
-      <Unit15>
-        <Filename Value="C:\lazarus\lcl\forms.pp"/>
-        <UnitName Value="Forms"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="734"/>
-        <CursorPos X="14" Y="747"/>
-        <UsageCount Value="10"/>
-      </Unit15>
-      <Unit16>
-        <Filename Value="..\..\lcl\include\control.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="3631"/>
-        <CursorPos X="1" Y="3640"/>
-        <UsageCount Value="10"/>
-      </Unit16>
-      <Unit17>
-        <Filename Value="utest.lfm"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="1"/>
-        <UsageCount Value="11"/>
-        <DefaultSyntaxHighlighter Value="LFM"/>
-      </Unit17>
-      <Unit18>
-        <Filename Value="..\..\lazpaintsvn\bgrabitmap\bgraslicescaling.pas"/>
-        <UnitName Value="BGRASliceScaling"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="329"/>
-        <CursorPos X="38" Y="331"/>
-        <UsageCount Value="11"/>
-      </Unit18>
-      <Unit19>
-        <Filename Value="..\..\lazpaintsvn\bgrabitmap\bgrabitmaptypes.pas"/>
-        <UnitName Value="BGRABitmapTypes"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="570"/>
-        <CursorPos X="15" Y="588"/>
-        <UsageCount Value="11"/>
-      </Unit19>
-      <Unit20>
-        <Filename Value="..\..\..\lazarus\lcl\customdrawn_common.pas"/>
-        <UnitName Value="customdrawn_common"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="28"/>
-        <CursorPos X="15" Y="39"/>
-        <UsageCount Value="10"/>
-      </Unit20>
-      <Unit21>
-        <Filename Value="..\..\bgrabitmap\bgrabitmap\bgraslicescaling.pas"/>
-        <UnitName Value="BGRASliceScaling"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="277"/>
-        <CursorPos X="1" Y="285"/>
-        <UsageCount Value="10"/>
-      </Unit21>
-      <Unit22>
-        <Filename Value="..\..\bcfilters.pas"/>
-        <UnitName Value="bcfilters"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="430"/>
-        <CursorPos X="1" Y="444"/>
-        <UsageCount Value="11"/>
-      </Unit22>
-      <Unit23>
-        <Filename Value="..\..\..\bgrabitmap\bgrabitmap\bgradefaultbitmap.pas"/>
-        <UnitName Value="BGRADefaultBitmap"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="4093"/>
-        <CursorPos X="3" Y="4097"/>
-        <UsageCount Value="10"/>
-      </Unit23>
-      <Unit24>
-        <Filename Value="..\..\..\bgrabitmap\bgrabitmap\bgrafilters.pas"/>
-        <UnitName Value="BGRAFilters"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1317"/>
-        <CursorPos X="5" Y="1317"/>
-        <UsageCount Value="10"/>
-      </Unit24>
-      <Unit25>
-        <Filename Value="..\..\..\bgrabitmap\bgrabitmap\bgrabitmaptypes.pas"/>
-        <UnitName Value="BGRABitmapTypes"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="2104"/>
-        <CursorPos X="25" Y="2106"/>
-        <UsageCount Value="10"/>
-      </Unit25>
-      <Unit26>
-        <Filename Value="..\..\..\bgrazip\unit1.pas"/>
-        <UnitName Value="Unit1"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="1"/>
-        <CursorPos X="1" Y="49"/>
-        <UsageCount Value="10"/>
-      </Unit26>
-      <Unit27>
-        <Filename Value="C:\FPC\fpc-2.6.0\packages\fcl-base\src\inifiles.pp"/>
-        <UnitName Value="IniFiles"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="159"/>
-        <CursorPos X="25" Y="176"/>
-        <UsageCount Value="10"/>
-      </Unit27>
-      <Unit28>
-        <Filename Value="..\..\..\bgrabitmap\bgrabitmap\bgraslicescaling.pas"/>
-        <UnitName Value="BGRASliceScaling"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="126"/>
-        <CursorPos X="5" Y="116"/>
-        <UsageCount Value="10"/>
-      </Unit28>
-      <Unit29>
-        <Filename Value="C:\FPC\fpc-2.6.0\rtl\objpas\sysutils\sysstrh.inc"/>
-        <WindowIndex Value="0"/>
-        <TopLine Value="120"/>
-        <CursorPos X="10" Y="130"/>
-        <UsageCount Value="10"/>
-      </Unit29>
     </Units>
     </Units>
-    <JumpHistory Count="16" HistoryIndex="15">
-      <Position1>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="421" Column="28" TopLine="411"/>
-      </Position1>
-      <Position2>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="422" Column="14" TopLine="413"/>
-      </Position2>
-      <Position3>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="1254" Column="41" TopLine="1241"/>
-      </Position3>
-      <Position4>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="547" Column="3" TopLine="544"/>
-      </Position4>
-      <Position5>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="466" Column="55" TopLine="456"/>
-      </Position5>
-      <Position6>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="8" Column="74" TopLine="1"/>
-      </Position6>
-      <Position7>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="1257" Column="34" TopLine="1244"/>
-      </Position7>
-      <Position8>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="389" Column="3" TopLine="385"/>
-      </Position8>
-      <Position9>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="518" Column="3" TopLine="514"/>
-      </Position9>
-      <Position10>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="488" Column="34" TopLine="464"/>
-      </Position10>
-      <Position11>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="422" Column="26" TopLine="408"/>
-      </Position11>
-      <Position12>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="1252" Column="3" TopLine="1245"/>
-      </Position12>
-      <Position13>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="229" Column="27" TopLine="218"/>
-      </Position13>
-      <Position14>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="230" Column="1" TopLine="218"/>
-      </Position14>
-      <Position15>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="410" Column="10" TopLine="410"/>
-      </Position15>
-      <Position16>
-        <Filename Value="customdrawn_windows7.pas"/>
-        <Caret Line="1253" Column="3" TopLine="1240"/>
-      </Position16>
-    </JumpHistory>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
     <Version Value="11"/>
     <Version Value="11"/>
@@ -453,5 +157,4 @@
       </Item3>
       </Item3>
     </Exceptions>
     </Exceptions>
   </Debugging>
   </Debugging>
-  <EditorMacros Count="0"/>
 </CONFIG>
 </CONFIG>