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
This commit is contained in:
wp_xxyyzz
2016-12-16 21:14:22 +00:00
parent 46dad57cfa
commit b29d878e22
4 changed files with 19 additions and 18 deletions

View File

@@ -104,7 +104,7 @@ implementation
constructor THSLRingPicker.Create(AOwner: TComponent); constructor THSLRingPicker.Create(AOwner: TComponent);
begin begin
inherited; inherited;
ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque{$IFDEF DELPHI_7_UP}, csParentBackground{$ENDIF}]; // ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque{$IFDEF DELPHI_7_UP}, csParentBackground{$ENDIF}];
DoubleBuffered := true; DoubleBuffered := true;
PBack := TBitmap.Create; PBack := TBitmap.Create;
PBack.PixelFormat := pf32bit; PBack.PixelFormat := pf32bit;

View File

@@ -48,7 +48,7 @@ type
procedure HPickerChange(Sender: TObject); procedure HPickerChange(Sender: TObject);
procedure SLPickerChange(Sender: TObject); procedure SLPickerChange(Sender: TObject);
protected protected
procedure CreateWnd; override; // procedure CreateWnd; override;
procedure DoChange; procedure DoChange;
procedure DoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); procedure DoMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
function GetColorUnderCursor: TColor; override; function GetColorUnderCursor: TColor; override;
@@ -109,7 +109,7 @@ const
constructor TSLHColorPicker.Create(AOwner: TComponent); constructor TSLHColorPicker.Create(AOwner: TComponent);
begin begin
inherited; inherited;
ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque]; //ControlStyle := ControlStyle - [csAcceptsControls] + [csOpaque];
DoubleBuffered := true; DoubleBuffered := true;
PBack := TBitmap.Create; PBack := TBitmap.Create;
PBack.PixelFormat := pf32bit; PBack.PixelFormat := pf32bit;
@@ -358,11 +358,11 @@ begin
PaintParentBack(Canvas); PaintParentBack(Canvas);
// Canvas.Draw(0, 0, PBack); // Canvas.Draw(0, 0, PBack);
end; end;
(*
procedure TSLHColorPicker.CreateWnd; procedure TSLHColorPicker.CreateWnd;
begin begin
inherited; inherited;
PaintParentBack; PaintParentBack;
end; end;
*)
end. end.

View File

@@ -42,9 +42,9 @@ object Form1: TForm1
Height = 384 Height = 384
Top = 6 Top = 6
Width = 403 Width = 403
ActivePage = TabSheet10 ActivePage = TabSheet3
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
TabIndex = 10 TabIndex = 2
TabOrder = 0 TabOrder = 0
OnChange = PageControl1Change OnChange = PageControl1Change
OnMouseMove = PageControl1MouseMove OnMouseMove = PageControl1MouseMove
@@ -57,7 +57,7 @@ object Form1: TForm1
Height = 340 Height = 340
Top = 8 Top = 8
Width = 381 Width = 381
SelectedColor = 2048 SelectedColor = 1024
HSPickerHintFormat = 'H: %h S: %s'#13'Hex: #%hex' HSPickerHintFormat = 'H: %h S: %s'#13'Hex: #%hex'
LPickerHintFormat = 'Luminance: %l' LPickerHintFormat = 'Luminance: %l'
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@@ -218,7 +218,7 @@ object Form1: TForm1
TabOrder = 3 TabOrder = 3
object mbColorPalette1: TmbColorPalette object mbColorPalette1: TmbColorPalette
Left = 0 Left = 0
Height = 234 Height = 272
Top = 0 Top = 0
Width = 378 Width = 378
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
@@ -865,16 +865,17 @@ object Form1: TForm1
end end
object CColorPicker1: TCColorPicker object CColorPicker1: TCColorPicker
Left = 4 Left = 4
Height = 267 Height = 334
Top = 18 Top = 18
Width = 22 Width = 22
HintFormat = 'Cyan: %c (selected)' HintFormat = 'Cyan: %c (selected)'
Anchors = [akTop, akLeft, akBottom]
TabOrder = 0 TabOrder = 0
SelectedColor = clAqua SelectedColor = clAqua
end end
object MColorPicker1: TMColorPicker object MColorPicker1: TMColorPicker
Left = 34 Left = 34
Height = 267 Height = 334
Top = 18 Top = 18
Width = 22 Width = 22
HintFormat = 'Magenta: %m (selected)' HintFormat = 'Magenta: %m (selected)'
@@ -884,7 +885,7 @@ object Form1: TForm1
end end
object YColorPicker1: TYColorPicker object YColorPicker1: TYColorPicker
Left = 68 Left = 68
Height = 267 Height = 333
Top = 19 Top = 19
Width = 31 Width = 31
HintFormat = 'Yellow: %y (selected)' HintFormat = 'Yellow: %y (selected)'
@@ -894,7 +895,7 @@ object Form1: TForm1
end end
object KColorPicker1: TKColorPicker object KColorPicker1: TKColorPicker
Left = 120 Left = 120
Height = 267 Height = 334
Top = 18 Top = 18
Width = 22 Width = 22
HintFormat = 'Black: %k (selected)' HintFormat = 'Black: %k (selected)'
@@ -906,7 +907,7 @@ object Form1: TForm1
end end
object RColorPicker1: TRColorPicker object RColorPicker1: TRColorPicker
Left = 150 Left = 150
Height = 268 Height = 334
Top = 18 Top = 18
Width = 22 Width = 22
HintFormat = 'Red: %r (selected)' HintFormat = 'Red: %r (selected)'
@@ -917,7 +918,7 @@ object Form1: TForm1
end end
object GColorPicker1: TGColorPicker object GColorPicker1: TGColorPicker
Left = 182 Left = 182
Height = 268 Height = 334
Top = 18 Top = 18
Width = 34 Width = 34
HintFormat = 'Green: %g (selected)' HintFormat = 'Green: %g (selected)'
@@ -928,7 +929,7 @@ object Form1: TForm1
end end
object BColorPicker1: TBColorPicker object BColorPicker1: TBColorPicker
Left = 224 Left = 224
Height = 268 Height = 334
Top = 18 Top = 18
Width = 22 Width = 22
HintFormat = 'Blue: %b (selected)' HintFormat = 'Blue: %b (selected)'
@@ -1192,7 +1193,7 @@ object Form1: TForm1
Height = 19 Height = 19
Top = 371 Top = 371
Width = 62 Width = 62
Anchors = [akLeft, akBottom] Anchors = [akRight, akBottom]
Caption = 'Enabled' Caption = 'Enabled'
Checked = True Checked = True
OnChange = CbEnabledChange OnChange = CbEnabledChange

View File

@@ -117,7 +117,7 @@ uses
constructor TmbCustomPicker.Create(AOwner: TComponent); constructor TmbCustomPicker.Create(AOwner: TComponent);
begin begin
inherited; inherited;
ControlStyle := ControlStyle + [csOpaque] - [csAcceptsControls]; //ControlStyle := ControlStyle + [csOpaque] - [csAcceptsControls];
DoubleBuffered := true; DoubleBuffered := true;
TabStop := true; TabStop := true;
{$IFDEF DELPHI_7_UP}{$IFDEF DELPHI} {$IFDEF DELPHI_7_UP}{$IFDEF DELPHI}