From b29d878e22d6b71535d31d08ce8f393106b5f8d3 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Fri, 16 Dec 2016 21:14:22 +0000 Subject: [PATCH] mbColorLib: Fix incorrect background painting of some controls (lost in one of previous commits). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5522 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/mbColorLib/HSLRingPicker.pas | 2 +- components/mbColorLib/SLHColorPicker.pas | 8 +++--- .../mbColorLib/examples/fulldemo/main.lfm | 25 ++++++++++--------- .../mbColorLib/mbColorPickerControl.pas | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/components/mbColorLib/HSLRingPicker.pas b/components/mbColorLib/HSLRingPicker.pas index fc42854e8..012a5ecbc 100644 --- a/components/mbColorLib/HSLRingPicker.pas +++ b/components/mbColorLib/HSLRingPicker.pas @@ -104,7 +104,7 @@ implementation constructor THSLRingPicker.Create(AOwner: TComponent); begin inherited; - ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque{$IFDEF DELPHI_7_UP}, csParentBackground{$ENDIF}]; +// ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque{$IFDEF DELPHI_7_UP}, csParentBackground{$ENDIF}]; DoubleBuffered := true; PBack := TBitmap.Create; PBack.PixelFormat := pf32bit; diff --git a/components/mbColorLib/SLHColorPicker.pas b/components/mbColorLib/SLHColorPicker.pas index d8ee7c718..651b92384 100644 --- a/components/mbColorLib/SLHColorPicker.pas +++ b/components/mbColorLib/SLHColorPicker.pas @@ -48,7 +48,7 @@ type procedure HPickerChange(Sender: TObject); procedure SLPickerChange(Sender: TObject); protected - procedure CreateWnd; override; +// procedure CreateWnd; override; procedure DoChange; procedure DoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); function GetColorUnderCursor: TColor; override; @@ -109,7 +109,7 @@ const constructor TSLHColorPicker.Create(AOwner: TComponent); begin inherited; - ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque]; + //ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque]; DoubleBuffered := true; PBack := TBitmap.Create; PBack.PixelFormat := pf32bit; @@ -358,11 +358,11 @@ begin PaintParentBack(Canvas); // Canvas.Draw(0, 0, PBack); end; - + (* procedure TSLHColorPicker.CreateWnd; begin inherited; PaintParentBack; end; - + *) end. diff --git a/components/mbColorLib/examples/fulldemo/main.lfm b/components/mbColorLib/examples/fulldemo/main.lfm index fa2f62643..2bc825698 100644 --- a/components/mbColorLib/examples/fulldemo/main.lfm +++ b/components/mbColorLib/examples/fulldemo/main.lfm @@ -42,9 +42,9 @@ object Form1: TForm1 Height = 384 Top = 6 Width = 403 - ActivePage = TabSheet10 + ActivePage = TabSheet3 Anchors = [akTop, akLeft, akRight, akBottom] - TabIndex = 10 + TabIndex = 2 TabOrder = 0 OnChange = PageControl1Change OnMouseMove = PageControl1MouseMove @@ -57,7 +57,7 @@ object Form1: TForm1 Height = 340 Top = 8 Width = 381 - SelectedColor = 2048 + SelectedColor = 1024 HSPickerHintFormat = 'H: %h S: %s'#13'Hex: #%hex' LPickerHintFormat = 'Luminance: %l' Anchors = [akTop, akLeft, akRight, akBottom] @@ -218,7 +218,7 @@ object Form1: TForm1 TabOrder = 3 object mbColorPalette1: TmbColorPalette Left = 0 - Height = 234 + Height = 272 Top = 0 Width = 378 Anchors = [akTop, akLeft, akRight, akBottom] @@ -865,16 +865,17 @@ object Form1: TForm1 end object CColorPicker1: TCColorPicker Left = 4 - Height = 267 + Height = 334 Top = 18 Width = 22 HintFormat = 'Cyan: %c (selected)' + Anchors = [akTop, akLeft, akBottom] TabOrder = 0 SelectedColor = clAqua end object MColorPicker1: TMColorPicker Left = 34 - Height = 267 + Height = 334 Top = 18 Width = 22 HintFormat = 'Magenta: %m (selected)' @@ -884,7 +885,7 @@ object Form1: TForm1 end object YColorPicker1: TYColorPicker Left = 68 - Height = 267 + Height = 333 Top = 19 Width = 31 HintFormat = 'Yellow: %y (selected)' @@ -894,7 +895,7 @@ object Form1: TForm1 end object KColorPicker1: TKColorPicker Left = 120 - Height = 267 + Height = 334 Top = 18 Width = 22 HintFormat = 'Black: %k (selected)' @@ -906,7 +907,7 @@ object Form1: TForm1 end object RColorPicker1: TRColorPicker Left = 150 - Height = 268 + Height = 334 Top = 18 Width = 22 HintFormat = 'Red: %r (selected)' @@ -917,7 +918,7 @@ object Form1: TForm1 end object GColorPicker1: TGColorPicker Left = 182 - Height = 268 + Height = 334 Top = 18 Width = 34 HintFormat = 'Green: %g (selected)' @@ -928,7 +929,7 @@ object Form1: TForm1 end object BColorPicker1: TBColorPicker Left = 224 - Height = 268 + Height = 334 Top = 18 Width = 22 HintFormat = 'Blue: %b (selected)' @@ -1192,7 +1193,7 @@ object Form1: TForm1 Height = 19 Top = 371 Width = 62 - Anchors = [akLeft, akBottom] + Anchors = [akRight, akBottom] Caption = 'Enabled' Checked = True OnChange = CbEnabledChange diff --git a/components/mbColorLib/mbColorPickerControl.pas b/components/mbColorLib/mbColorPickerControl.pas index 8f60c4f58..209e61285 100644 --- a/components/mbColorLib/mbColorPickerControl.pas +++ b/components/mbColorLib/mbColorPickerControl.pas @@ -117,7 +117,7 @@ uses constructor TmbCustomPicker.Create(AOwner: TComponent); begin inherited; - ControlStyle := ControlStyle + [csOpaque] - [csAcceptsControls]; + //ControlStyle := ControlStyle + [csOpaque] - [csAcceptsControls]; DoubleBuffered := true; TabStop := true; {$IFDEF DELPHI_7_UP}{$IFDEF DELPHI}