2
0
Эх сурвалжийг харах

Added BCListBox, BCPaperPanel and BCPaperListBox.

lainz 9 жил өмнө
parent
commit
1a2c89c62c

+ 151 - 0
bclistbox.pas

@@ -0,0 +1,151 @@
+unit BCListBox;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
+  LCLType, BGRAVirtualScreen, BGRABitmap, BGRASliceScaling;
+
+type
+
+  TBCListBox = class;
+  TBCPaperPanel = class;
+
+  { TBCPaperPanel }
+
+  TBCPaperPanel = class(TBGRAVirtualScreen)
+  private
+    FShadow: TBGRASliceScaling;
+    procedure LoadShadowFromBitmapResource;
+  protected
+    procedure BCRedraw(Sender: TObject; ABitmap: TBGRABitmap);
+  public
+    constructor Create(TheOwner: TComponent); override;
+    destructor Destroy; override;
+  published
+  end;
+
+  { TBCListBox }
+
+  TBCListBox = class(TListBox)
+  private
+    { Private declarations }
+  protected
+    procedure BCDrawItem(Control: TWinControl; Index: integer;
+      ARect: TRect; State: TOwnerDrawState);
+    { Protected declarations }
+  public
+    { Public declarations }
+    constructor Create(TheOwner: TComponent); override;
+  published
+    { Published declarations }
+  end;
+
+  { TBCPaperListBox }
+
+  TBCPaperListBox = class(TBCPaperPanel)
+  private
+    FListBox: TBCListBox;
+  public
+    property ListBox: TBCListBox read FListBox write FListBox;
+    constructor Create(TheOwner: TComponent); override;
+  end;
+
+procedure Register;
+
+implementation
+
+{$R bcpaperlistbox.rc}
+
+procedure Register;
+begin
+  RegisterComponents('BGRA Controls', [TBCListBox]);
+  RegisterComponents('BGRA Controls', [TBCPaperPanel]);
+  RegisterComponents('BGRA Controls', [TBCPaperListBox]);
+end;
+
+{ TBCPaperListBox }
+
+constructor TBCPaperListBox.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  Self.ChildSizing.ControlsPerLine := 1;
+  Self.ChildSizing.LeftRightSPacing := 4;
+  Self.ChildSizing.TopBottomSpacing := 5;
+  FListBox := TBCListBox.Create(Self);
+  FListBox.Align := alClient;
+  FListBox.Parent := Self;
+end;
+
+{ TBCPaperListBox }
+
+procedure TBCPaperPanel.LoadShadowFromBitmapResource;
+var
+  res: TResourceStream;
+begin
+  res := TResourceStream.Create(HInstance, 'SHADOW', RT_RCDATA);
+  FShadow := TBGRASliceScaling.Create(res);
+  FShadow.Margins := Margins(6, 9, 6, 9);
+  res.Free;
+end;
+
+procedure TBCPaperPanel.BCRedraw(Sender: TObject; ABitmap: TBGRABitmap);
+begin
+  FShadow.Draw(ABitmap, 0, 0, ABitmap.Width, ABitmap.Height);
+end;
+
+constructor TBCPaperPanel.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  LoadShadowFromBitmapResource;
+  Self.OnRedraw := @BCRedraw;
+end;
+
+destructor TBCPaperPanel.Destroy;
+begin
+  inherited Destroy;
+  FShadow.Free;
+end;
+
+{ TBCListBox }
+
+procedure TBCListBox.BCDrawItem(Control: TWinControl; Index: integer;
+  ARect: TRect; State: TOwnerDrawState);
+var
+  lb: TListBox;
+  hg: integer;
+begin
+  lb := TListBox(Control);
+
+  lb.Canvas.Clipping := False;
+
+  if odFocused in State then
+    lb.Canvas.Brush.Color := $00e4e4e4
+  else
+    lb.Canvas.Brush.Color := clWhite;
+
+  if odSelected in State then
+    lb.Canvas.Font.Style := [fsBold];
+
+  lb.Canvas.FillRect(ARect);
+  hg := lb.Canvas.TextHeight(lb.Items[Index]);
+  lb.Canvas.Font.Color := clBlack;
+  lb.Canvas.TextOut(ARect.Left + ScaleX(16, 96), ARect.Top +
+    (lb.ItemHeight - hg) div 2, lb.Items[Index]);
+
+  lb.Canvas.Clipping := True;
+  lb.Canvas.ClipRect := Rect(0, 0, 0, 0);
+end;
+
+constructor TBCListBox.Create(TheOwner: TComponent);
+begin
+  inherited Create(TheOwner);
+  Self.Style := lbOwnerDrawFixed;
+  Self.OnDrawItem := @BCDrawItem;
+  Self.ItemHeight := ScaleY(48, 96);
+  Self.BorderStyle := bsNone;
+end;
+
+end.

+ 1 - 0
bcpaperlistbox.rc

@@ -0,0 +1 @@
+SHADOW RCDATA "shadow.png"

+ 93 - 88
bgracontrols.lpk

@@ -25,206 +25,211 @@
     </CompilerOptions>
     <Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
     <License Value="Modified LGPL"/>
-    <Version Major="4" Minor="3" Release="1" Build="1"/>
-    <Files Count="41">
+    <Version Major="4" Minor="3" Release="1" Build="2"/>
+    <Files Count="42">
       <Item1>
         <Filename Value="bcbasectrls.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCBaseCtrls"/>
       </Item1>
       <Item2>
+        <Filename Value="bcbrightandcontrast.pas"/>
+        <AddToUsesPkgSection Value="False"/>
+        <UnitName Value="BCBrightAndContrast"/>
+      </Item2>
+      <Item3>
         <Filename Value="bcbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCButton"/>
-      </Item2>
-      <Item3>
+      </Item3>
+      <Item4>
         <Filename Value="bcbuttonfocus.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCButtonFocus"/>
-      </Item3>
-      <Item4>
+      </Item4>
+      <Item5>
         <Filename Value="bcdefaultthememanager.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCDefaultThemeManager"/>
-      </Item4>
-      <Item5>
-        <Filename Value="bceffect.pas"/>
-        <UnitName Value="BCEffect"/>
       </Item5>
       <Item6>
-        <Filename Value="bcfilters.pas"/>
-        <UnitName Value="bcfilters"/>
+        <Filename Value="bceffect.pas"/>
+        <UnitName Value="BCEffect"/>
       </Item6>
       <Item7>
+        <Filename Value="bcfilters.pas"/>
+        <UnitName Value="bcfilters"/>
+      </Item7>
+      <Item8>
         <Filename Value="bcgamegrid.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCGameGrid"/>
-      </Item7>
-      <Item8>
+      </Item8>
+      <Item9>
         <Filename Value="bcimagebutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCImageButton"/>
-      </Item8>
-      <Item9>
+      </Item9>
+      <Item10>
+        <Filename Value="bckeyboard.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCKeyboard"/>
+      </Item10>
+      <Item11>
         <Filename Value="bclabel.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCLabel"/>
-      </Item9>
-      <Item10>
+      </Item11>
+      <Item12>
+        <Filename Value="bclistbox.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCListBox"/>
+      </Item12>
+      <Item13>
         <Filename Value="bcmaterialdesignbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialDesignButton"/>
-      </Item10>
-      <Item11>
+      </Item13>
+      <Item14>
         <Filename Value="bcnumerickeyboard.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCNumericKeyboard"/>
-      </Item11>
-      <Item12>
+      </Item14>
+      <Item15>
         <Filename Value="bcpanel.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCPanel"/>
-      </Item12>
-      <Item13>
+      </Item15>
+      <Item16>
         <Filename Value="bcradialprogressbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCRadialProgressBar"/>
-      </Item13>
-      <Item14>
+      </Item16>
+      <Item17>
         <Filename Value="bcrtti.pas"/>
         <UnitName Value="BCRTTI"/>
-      </Item14>
-      <Item15>
+      </Item17>
+      <Item18>
         <Filename Value="bcsamples.pas"/>
         <UnitName Value="BCSamples"/>
-      </Item15>
-      <Item16>
+      </Item18>
+      <Item19>
         <Filename Value="bcstylesform.pas"/>
         <UnitName Value="BCStylesForm"/>
-      </Item16>
-      <Item17>
+      </Item19>
+      <Item20>
         <Filename Value="bcthememanager.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCThemeManager"/>
-      </Item17>
-      <Item18>
+      </Item20>
+      <Item21>
         <Filename Value="bctoolbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCToolBar"/>
-      </Item18>
-      <Item19>
+      </Item21>
+      <Item22>
         <Filename Value="bctools.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCTools"/>
-      </Item19>
-      <Item20>
+      </Item22>
+      <Item23>
         <Filename Value="bctrackbarupdown.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCTrackbarUpdown"/>
-      </Item20>
-      <Item21>
+      </Item23>
+      <Item24>
         <Filename Value="bctypes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCTypes"/>
-      </Item21>
-      <Item22>
+      </Item24>
+      <Item25>
         <Filename Value="bgracustomdrawn.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRACustomDrawn"/>
-      </Item22>
-      <Item23>
+      </Item25>
+      <Item26>
         <Filename Value="bgraflashprogressbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAFlashProgressBar"/>
-      </Item23>
-      <Item24>
+      </Item26>
+      <Item27>
         <Filename Value="bgragraphiccontrol.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAGraphicControl"/>
-      </Item24>
-      <Item25>
+      </Item27>
+      <Item28>
         <Filename Value="bgraimagelist.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAImageList"/>
-      </Item25>
-      <Item26>
+      </Item28>
+      <Item29>
         <Filename Value="bgraimagemanipulation.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAImageManipulation"/>
-      </Item26>
-      <Item27>
+      </Item29>
+      <Item30>
         <Filename Value="bgraknob.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAKnob"/>
-      </Item27>
-      <Item28>
+      </Item30>
+      <Item31>
         <Filename Value="bgraresizespeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAResizeSpeedButton"/>
-      </Item28>
-      <Item29>
+      </Item31>
+      <Item32>
         <Filename Value="bgrashape.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAShape"/>
-      </Item29>
-      <Item30>
+      </Item32>
+      <Item33>
         <Filename Value="bgraspeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpeedButton"/>
-      </Item30>
-      <Item31>
+      </Item33>
+      <Item34>
         <Filename Value="bgraspriteanimation.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpriteAnimation"/>
-      </Item31>
-      <Item32>
+      </Item34>
+      <Item35>
         <Filename Value="bgravirtualscreen.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAVirtualScreen"/>
-      </Item32>
-      <Item33>
+      </Item35>
+      <Item36>
         <Filename Value="dtanalogclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="DTAnalogClock"/>
-      </Item33>
-      <Item34>
+      </Item36>
+      <Item37>
         <Filename Value="dtanalogcommon.pp"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="DTAnalogCommon"/>
-      </Item34>
-      <Item35>
+      </Item37>
+      <Item38>
         <Filename Value="dtanaloggauge.pp"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="DTAnalogGauge"/>
-      </Item35>
-      <Item36>
+      </Item38>
+      <Item39>
         <Filename Value="dtthemedclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedclock"/>
-      </Item36>
-      <Item37>
+      </Item39>
+      <Item40>
         <Filename Value="dtthemedgauge.pp"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedgauge"/>
-      </Item37>
-      <Item38>
-        <Filename Value="mouseandkeyinput/mouseandkeyinput.pas"/>
-        <UnitName Value="MouseAndKeyInput"/>
-      </Item38>
-      <Item39>
-        <Filename Value="bckeyboard.pas"/>
-        <HasRegisterProc Value="True"/>
-        <UnitName Value="BCKeyboard"/>
-      </Item39>
-      <Item40>
-        <Filename Value="materialcolors.pas"/>
-        <UnitName Value="MaterialColors"/>
       </Item40>
       <Item41>
-        <Filename Value="bcbrightandcontrast.pas"/>
-        <AddToUsesPkgSection Value="False"/>
-        <UnitName Value="BCBrightAndContrast"/>
+        <Filename Value="materialcolors.pas"/>
+        <UnitName Value="MaterialColors"/>
       </Item41>
+      <Item42>
+        <Filename Value="mouseandkeyinput/mouseandkeyinput.pas"/>
+        <UnitName Value="MouseAndKeyInput"/>
+      </Item42>
     </Files>
     <RequiredPkgs Count="2">
       <Item1>

+ 8 - 7
bgracontrols.pas

@@ -8,14 +8,14 @@ interface
 
 uses
   BCButton, BCButtonFocus, BCDefaultThemeManager, BCEffect, bcfilters, 
-  BCGameGrid, BCImageButton, BCLabel, BCMaterialDesignButton, 
-  BCNumericKeyboard, BCPanel, BCRadialProgressBar, BCRTTI, BCSamples, 
-  BCStylesForm, BCToolBar, BCTrackbarUpdown, BGRACustomDrawn, 
-  BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, 
+  BCGameGrid, BCImageButton, BCKeyboard, BCLabel, BCListBox, 
+  BCMaterialDesignButton, BCNumericKeyboard, BCPanel, BCRadialProgressBar, 
+  BCRTTI, BCSamples, BCStylesForm, BCToolBar, BCTrackbarUpdown, 
+  BGRACustomDrawn, BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, 
   BGRAImageManipulation, BGRAKnob, BGRAResizeSpeedButton, BGRAShape, 
   BGRASpeedButton, BGRASpriteAnimation, BGRAVirtualScreen, DTAnalogClock, 
-  DTAnalogGauge, dtthemedclock, dtthemedgauge, MouseAndKeyInput, BCKeyboard, 
-  MaterialColors, LazarusPackageIntf;
+  DTAnalogGauge, dtthemedclock, dtthemedgauge, MaterialColors, 
+  MouseAndKeyInput, LazarusPackageIntf;
 
 implementation
 
@@ -26,7 +26,9 @@ begin
   RegisterUnit('BCDefaultThemeManager', @BCDefaultThemeManager.Register);
   RegisterUnit('BCGameGrid', @BCGameGrid.Register);
   RegisterUnit('BCImageButton', @BCImageButton.Register);
+  RegisterUnit('BCKeyboard', @BCKeyboard.Register);
   RegisterUnit('BCLabel', @BCLabel.Register);
+  RegisterUnit('BCListBox', @BCListBox.Register);
   RegisterUnit('BCMaterialDesignButton', @BCMaterialDesignButton.Register);
   RegisterUnit('BCNumericKeyboard', @BCNumericKeyboard.Register);
   RegisterUnit('BCPanel', @BCPanel.Register);
@@ -48,7 +50,6 @@ begin
   RegisterUnit('DTAnalogGauge', @DTAnalogGauge.Register);
   RegisterUnit('dtthemedclock', @dtthemedclock.Register);
   RegisterUnit('dtthemedgauge', @dtthemedgauge.Register);
-  RegisterUnit('BCKeyboard', @BCKeyboard.Register);
 end;
 
 initialization

+ 0 - 0
test/test_paperlistbox/shadow.png → shadow.png


+ 11 - 6
test/test_paperlistbox/paperlistbox.lpi → test/test_listbox/test.lpi

@@ -1,20 +1,25 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
   <ProjectOptions>
-    <Version Value="10"/>
+    <Version Value="9"/>
     <PathDelim Value="\"/>
     <General>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
-      <Title Value="Paper ListBox"/>
+      <Title Value="test"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <XPManifest>
         <DpiAware Value="True"/>
-        <TextName Value="CompanyName.ProductName.AppName"/>
-        <TextDesc Value="Your application description."/>
       </XPManifest>
+      <Icon Value="0"/>
     </General>
+    <i18n>
+      <EnableI18N LFM="False"/>
+    </i18n>
+    <VersionInfo>
+      <StringTable ProductVersion=""/>
+    </VersionInfo>
     <BuildModes Count="1">
       <Item1 Name="Default" Default="True"/>
     </BuildModes>
@@ -36,7 +41,7 @@
     </RequiredPackages>
     <Units Count="2">
       <Unit0>
-        <Filename Value="paperlistbox.lpr"/>
+        <Filename Value="test.lpr"/>
         <IsPartOfProject Value="True"/>
       </Unit0>
       <Unit1>
@@ -52,7 +57,7 @@
     <Version Value="11"/>
     <PathDelim Value="\"/>
     <Target>
-      <Filename Value="paperlistbox"/>
+      <Filename Value="test"/>
     </Target>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>

+ 1 - 2
test/test_paperlistbox/paperlistbox.lpr → test/test_listbox/test.lpr

@@ -1,4 +1,4 @@
-program paperlistbox;
+program test;
 
 {$mode objfpc}{$H+}
 
@@ -13,7 +13,6 @@ uses
 {$R *.res}
 
 begin
-  Application.Title:='Paper ListBox';
   RequireDerivedFormResource:=True;
   Application.Initialize;
   Application.CreateForm(TForm1, Form1);

+ 44 - 0
test/test_listbox/umain.lfm

@@ -0,0 +1,44 @@
+object Form1: TForm1
+  Left = 329
+  Height = 286
+  Top = 184
+  Width = 751
+  Caption = 'Form1'
+  ClientHeight = 286
+  ClientWidth = 751
+  Color = 16448250
+  OnCreate = FormCreate
+  LCLVersion = '1.6.2.0'
+  object BCPaperListBox1: TBCPaperListBox
+    Left = 8
+    Height = 272
+    Top = 8
+    Width = 368
+    Alignment = taLeftJustify
+    Caption = 'BCPaperListBox1'
+    ChildSizing.LeftRightSpacing = 4
+    ChildSizing.TopBottomSpacing = 5
+    ChildSizing.ControlsPerLine = 1
+    ClientHeight = 272
+    ClientWidth = 368
+    Color = clWhite
+    ParentColor = False
+    TabOrder = 0
+  end
+  object BCPaperListBox2: TBCPaperListBox
+    Left = 376
+    Height = 120
+    Top = 8
+    Width = 368
+    Alignment = taLeftJustify
+    Caption = 'BCPaperListBox2'
+    ChildSizing.LeftRightSpacing = 4
+    ChildSizing.TopBottomSpacing = 5
+    ChildSizing.ControlsPerLine = 1
+    ClientHeight = 120
+    ClientWidth = 368
+    Color = clWhite
+    ParentColor = False
+    TabOrder = 1
+  end
+end

+ 56 - 0
test/test_listbox/umain.pas

@@ -0,0 +1,56 @@
+unit umain;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, BCListBox;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    BCPaperListBox1: TBCPaperListBox;
+    BCPaperListBox2: TBCPaperListBox;
+    procedure FormCreate(Sender: TObject);
+  private
+    { private declarations }
+  public
+    { public declarations }
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  BCPaperListBox1.ListBox.MultiSelect := True;
+  with BCPaperListBox1.ListBox.Items do
+  begin
+    Add('One');
+    Add('Two');
+    Add('Three');
+    Add('Four');
+    Add('Five');
+  end;
+
+  with BCPaperListBox2.ListBox.Items do
+  begin
+    Add('One');
+    Add('Two');
+    Add('Three');
+    Add('Four');
+    Add('Five');
+  end;
+end;
+
+end.
+

+ 0 - 94
test/test_paperlistbox/umain.lfm

@@ -1,94 +0,0 @@
-object Form1: TForm1
-  Left = 424
-  Height = 486
-  Top = 156
-  Width = 696
-  Caption = 'Paper ListBox'
-  ClientHeight = 486
-  ClientWidth = 696
-  DesignTimePPI = 120
-  OnCreate = FormCreate
-  OnDestroy = FormDestroy
-  LCLVersion = '1.7'
-  object BGRAVirtualScreen1: TBGRAVirtualScreen
-    Left = 0
-    Height = 486
-    Top = 0
-    Width = 696
-    Align = alClient
-    Alignment = taLeftJustify
-    ClientHeight = 486
-    ClientWidth = 696
-    Color = 16448250
-    ParentColor = False
-    TabOrder = 0
-    object BGRAVirtualScreen2: TBGRAVirtualScreen
-      Left = 16
-      Height = 450
-      Top = 16
-      Width = 330
-      OnRedraw = BGRAVirtualScreen2Redraw
-      Alignment = taLeftJustify
-      ChildSizing.LeftRightSpacing = 16
-      ChildSizing.TopBottomSpacing = 16
-      ClientHeight = 450
-      ClientWidth = 330
-      Color = clBlack
-      ParentColor = False
-      TabOrder = 0
-      object ListBox1: TListBox
-        Left = 17
-        Height = 416
-        Top = 17
-        Width = 296
-        Align = alClient
-        BorderStyle = bsNone
-        Items.Strings = (
-          'Inbox'
-          'Starred'
-          'Sent mail'
-          'Drafts'
-        )
-        ItemHeight = 0
-        ItemIndex = 0
-        MultiSelect = True
-        OnDrawItem = ListBox1DrawItem
-        Style = lbOwnerDrawFixed
-        TabOrder = 0
-      end
-    end
-    object BGRAVirtualScreen3: TBGRAVirtualScreen
-      Left = 352
-      Height = 128
-      Top = 16
-      Width = 330
-      OnRedraw = BGRAVirtualScreen2Redraw
-      Alignment = taLeftJustify
-      ChildSizing.LeftRightSpacing = 16
-      ChildSizing.TopBottomSpacing = 16
-      ClientHeight = 128
-      ClientWidth = 330
-      Color = clBlack
-      ParentColor = False
-      TabOrder = 1
-      object ListBox2: TListBox
-        Left = 17
-        Height = 94
-        Top = 17
-        Width = 296
-        Align = alClient
-        BorderStyle = bsNone
-        Items.Strings = (
-          'Inbox'
-          'Starred'
-          'Sent mail'
-          'Drafts'
-        )
-        ItemHeight = 0
-        OnDrawItem = ListBox1DrawItem
-        Style = lbOwnerDrawFixed
-        TabOrder = 0
-      end
-    end
-  end
-end

+ 0 - 106
test/test_paperlistbox/umain.pas

@@ -1,106 +0,0 @@
-unit umain;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
-  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
-  BGRAVirtualScreen, BGRABitmap, BCTypes, BGRASliceScaling, Types, LCLType;
-
-type
-
-  { TForm1 }
-
-  TForm1 = class(TForm)
-    BGRAVirtualScreen1: TBGRAVirtualScreen;
-    BGRAVirtualScreen2: TBGRAVirtualScreen;
-    BGRAVirtualScreen3: TBGRAVirtualScreen;
-    ListBox1: TListBox;
-    ListBox2: TListBox;
-    procedure BGRAVirtualScreen2Redraw(Sender: TObject; Bitmap: TBGRABitmap);
-    procedure FormCreate(Sender: TObject);
-    procedure FormDestroy(Sender: TObject);
-    procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
-      ARect: TRect; State: TOwnerDrawState);
-  private
-    shadow: TBGRASliceScaling;
-  public
-
-  end;
-
-var
-  Form1: TForm1;
-
-implementation
-
-{$R *.lfm}
-
-{ TForm1 }
-
-procedure TForm1.BGRAVirtualScreen2Redraw(Sender: TObject; Bitmap: TBGRABitmap);
-begin
-  if Assigned(shadow) then
-    shadow.Draw(Bitmap, 0, 0, Bitmap.Width, Bitmap.Height);
-end;
-
-procedure TForm1.FormCreate(Sender: TObject);
-begin
-  shadow := TBGRASliceScaling.Create(ProgramDirectory + 'shadow.png');
-  shadow.Margins := Margins(6, 9, 6, 9);
-
-  with BGRAVirtualScreen2.ChildSizing do
-  begin
-    ControlsPerLine := 1;
-    LeftRightSpacing := 4;
-    TopBottomSpacing := 5;
-  end;
-
-  ListBox1.ItemHeight := ScaleY(48, 96);
-  ListBox1.Style := lbOwnerDrawFixed;
-
-  with BGRAVirtualScreen3.ChildSizing do
-  begin
-    ControlsPerLine := 1;
-    LeftRightSpacing := 4;
-    TopBottomSpacing := 5;
-  end;
-
-  ListBox2.ItemHeight := ScaleY(48, 96);
-  ListBox2.Style := lbOwnerDrawFixed;
-end;
-
-procedure TForm1.FormDestroy(Sender: TObject);
-begin
-  shadow.Free;
-end;
-
-procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
-  ARect: TRect; State: TOwnerDrawState);
-var
-  lb: TListBox;
-  hg: integer;
-begin
-  lb := TListBox(Control);
-
-  lb.Canvas.Clipping := False;
-
-  if odFocused in State then
-    lb.Canvas.Brush.Color := $00e4e4e4
-  else
-    lb.Canvas.Brush.Color := clWhite;
-
-  if odSelected in State then
-    lb.Canvas.Font.Style := [fsBold];
-
-  lb.Canvas.FillRect(ARect);
-  hg := lb.Canvas.TextHeight(lb.Items[Index]);
-  lb.Canvas.Font.Color := clBlack;
-  lb.Canvas.TextOut(ARect.Left + ScaleX(16, 96), ARect.Top + (lb.ItemHeight - hg) div 2, lb.Items[Index]);
-
-  lb.Canvas.Clipping := True;
-  lb.Canvas.ClipRect := Rect(0, 0, 0, 0);
-end;
-
-end.
-

+ 1 - 1
update_bgracontrols_force.json

@@ -8,7 +8,7 @@
       "ForceNotify" : false,
       "InternalVersion" : 1,
       "Name" : "bgracontrols.lpk",
-      "Version" : "4.3.1.1"
+      "Version" : "4.3.1.2"
     },
     {
       "ForceNotify" : false,