MG: added OnDrawItem to OI

git-svn-id: trunk@2705 -
This commit is contained in:
lazarus 2002-08-18 04:56:53 +00:00
parent fe2d2dbee0
commit dfe45cdec1

View File

@ -553,7 +553,8 @@ begin
end;
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;
type
@ -577,10 +578,9 @@ var
vRight,vBottom: Integer;
vOldPenColor, vOldBrushColor: TColor;
begin
vRight := (ARect.Bottom - ARect.Top) {* 2} + ARect.Left - 2;
vRight := (ARect.Bottom - ARect.Top) + ARect.Left - 2;
vBottom:=ARect.Bottom-2;
with ACanvas do
try
with ACanvas do begin
// save off things
vOldPenColor := Pen.Color;
vOldBrushColor := Brush.Color;
@ -597,17 +597,16 @@ begin
// restore the things we twiddled with
Brush.Color := vOldBrushColor;
Pen.Color := vOldPenColor;
finally
end;
inherited ListDrawValue(CurValue, Index, ACanvas,
Rect(vRight, ARect.Top, ARect.Right, ARect.Bottom),
AState);
end;
end;
procedure TColorPropertyEditor.ListMeasureWidth(const CurValue:ansistring;
Index:integer; ACanvas:TCanvas; var AWidth:Integer);
begin
AWidth := AWidth + ACanvas.TextHeight('M') {* 2};
AWidth := ACanvas.TextWidth('clGradientInactiveCaption')+25;
end;
procedure TColorPropertyEditor.SetValue(const NewValue: ansistring);
@ -681,7 +680,7 @@ end;
procedure TBrushStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
begin
AWidth := AWidth + ACanvas.TextHeight('A') {* 2};
AWidth := 130;
end;
{ TPenStylePropertyEditor }
@ -743,7 +742,7 @@ end;
procedure TPenStylePropertyEditor.ListMeasureWidth(const CurValue: ansistring;
Index:integer; ACanvas: TCanvas; var AWidth: Integer);
begin
AWidth := AWidth + ACanvas.TextHeight('X') * 2;
AWidth := 130;
end;
{ TFontPropertyEditor }