mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:50:06 +02:00
MG: added OnDrawItem to OI
git-svn-id: trunk@2705 -
This commit is contained in:
parent
fe2d2dbee0
commit
dfe45cdec1
@ -553,7 +553,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorPropertyEditor.ListDrawValue(const CurValue:ansistring;
|
procedure TColorPropertyEditor.ListDrawValue(const CurValue:ansistring;
|
||||||
Index:integer; ACanvas:TCanvas; const ARect:TRect; AState: TPropEditDrawState);
|
Index:integer; ACanvas:TCanvas; const ARect:TRect;
|
||||||
|
AState: TPropEditDrawState);
|
||||||
|
|
||||||
function ColorToBorderColor(AColor: TColor): TColor;
|
function ColorToBorderColor(AColor: TColor): TColor;
|
||||||
type
|
type
|
||||||
@ -577,10 +578,9 @@ var
|
|||||||
vRight,vBottom: Integer;
|
vRight,vBottom: Integer;
|
||||||
vOldPenColor, vOldBrushColor: TColor;
|
vOldPenColor, vOldBrushColor: TColor;
|
||||||
begin
|
begin
|
||||||
vRight := (ARect.Bottom - ARect.Top) {* 2} + ARect.Left - 2;
|
vRight := (ARect.Bottom - ARect.Top) + ARect.Left - 2;
|
||||||
vBottom:=ARect.Bottom-2;
|
vBottom:=ARect.Bottom-2;
|
||||||
with ACanvas do
|
with ACanvas do begin
|
||||||
try
|
|
||||||
// save off things
|
// save off things
|
||||||
vOldPenColor := Pen.Color;
|
vOldPenColor := Pen.Color;
|
||||||
vOldBrushColor := Brush.Color;
|
vOldBrushColor := Brush.Color;
|
||||||
@ -593,21 +593,20 @@ begin
|
|||||||
Brush.Color := StringToColor(CurValue);
|
Brush.Color := StringToColor(CurValue);
|
||||||
Pen.Color := ColorToBorderColor(ColorToRGB(Brush.Color));
|
Pen.Color := ColorToBorderColor(ColorToRGB(Brush.Color));
|
||||||
Rectangle(ARect.Left + 1, ARect.Top + 1, vRight - 1, vBottom - 1);
|
Rectangle(ARect.Left + 1, ARect.Top + 1, vRight - 1, vBottom - 1);
|
||||||
|
|
||||||
// restore the things we twiddled with
|
// restore the things we twiddled with
|
||||||
Brush.Color := vOldBrushColor;
|
Brush.Color := vOldBrushColor;
|
||||||
Pen.Color := vOldPenColor;
|
Pen.Color := vOldPenColor;
|
||||||
finally
|
|
||||||
inherited ListDrawValue(CurValue, Index, ACanvas,
|
|
||||||
Rect(vRight, ARect.Top, ARect.Right, ARect.Bottom),
|
|
||||||
AState);
|
|
||||||
end;
|
end;
|
||||||
|
inherited ListDrawValue(CurValue, Index, ACanvas,
|
||||||
|
Rect(vRight, ARect.Top, ARect.Right, ARect.Bottom),
|
||||||
|
AState);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorPropertyEditor.ListMeasureWidth(const CurValue:ansistring;
|
procedure TColorPropertyEditor.ListMeasureWidth(const CurValue:ansistring;
|
||||||
Index:integer; ACanvas:TCanvas; var AWidth:Integer);
|
Index:integer; ACanvas:TCanvas; var AWidth:Integer);
|
||||||
begin
|
begin
|
||||||
AWidth := AWidth + ACanvas.TextHeight('M') {* 2};
|
AWidth := ACanvas.TextWidth('clGradientInactiveCaption')+25;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TColorPropertyEditor.SetValue(const NewValue: ansistring);
|
procedure TColorPropertyEditor.SetValue(const NewValue: ansistring);
|
||||||
@ -679,9 +678,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TBrushStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
|
procedure TBrushStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
|
||||||
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
|
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
|
||||||
begin
|
begin
|
||||||
AWidth := AWidth + ACanvas.TextHeight('A') {* 2};
|
AWidth := 130;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TPenStylePropertyEditor }
|
{ TPenStylePropertyEditor }
|
||||||
@ -741,9 +740,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPenStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
|
procedure TPenStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
|
||||||
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
|
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
|
||||||
begin
|
begin
|
||||||
AWidth := AWidth + ACanvas.TextHeight('X') * 2;
|
AWidth := 130;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFontPropertyEditor }
|
{ TFontPropertyEditor }
|
||||||
|
Loading…
Reference in New Issue
Block a user