You've already forked lazarus-ccr
jvcllaz: Fix painting of FullColor property editor.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7095 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -37,7 +37,7 @@ uses
|
||||
type
|
||||
TJvDEFFamily = (pfConstant, pfSystem);
|
||||
|
||||
TJvFullColorProperty = class(TPropertyEditor) //, ICustomPropertyDrawing)
|
||||
TJvFullColorProperty = class(TPropertyEditor)
|
||||
private
|
||||
function GetIsColorProperty: Boolean;
|
||||
procedure DialogApply(Sender: TObject; AFullColor: TJvFullColor);
|
||||
@ -50,8 +50,6 @@ type
|
||||
procedure Edit; override;
|
||||
procedure EditSpace(AColorID: TJvFullColorSpaceID);
|
||||
procedure SetColor(AFullColor: TJvFullColor);
|
||||
// ICustomPropertyDrawing
|
||||
procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect; {%H-}AState: TPropEditDrawState); override;
|
||||
procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect; {%H-}AState: TPropEditDrawState); override;
|
||||
property IsColorProperty: Boolean read GetIsColorProperty;
|
||||
end;
|
||||
@ -147,6 +145,7 @@ type
|
||||
procedure FormApply(Sender: TObject);
|
||||
end;
|
||||
|
||||
|
||||
procedure RegisterFullColorSpaceEditor(AColorSpaceID: TJvFullColorSpaceID;
|
||||
AEditorClass: TJvFullColorSpacePropertyClass);
|
||||
|
||||
@ -303,18 +302,12 @@ begin
|
||||
Proc(ColorSpaceByIndex[I].ShortName);
|
||||
end;
|
||||
|
||||
procedure TJvFullColorProperty.PropDrawName(ACanvas: TCanvas;
|
||||
const ARect: TRect; AState: TPropEditDrawState);
|
||||
begin
|
||||
ACanvas.TextOut(ARect.Left, ARect.Top, GetName);
|
||||
// DefaultPropertyDrawName(Self, ACanvas, ARect);
|
||||
end;
|
||||
|
||||
procedure TJvFullColorProperty.PropDrawValue(ACanvas: TCanvas;
|
||||
const ARect: TRect; AState: TPropEditDrawState);
|
||||
var
|
||||
OldPenColor, OldBrushColor: TColor;
|
||||
Right: Integer;
|
||||
h: Integer;
|
||||
begin
|
||||
with ACanvas do
|
||||
begin
|
||||
@ -330,13 +323,13 @@ begin
|
||||
|
||||
Right := (ARect.Bottom - ARect.Top) + ARect.Left;
|
||||
|
||||
Rectangle(ARect.Left + 1, ARect.Top + 1, Right - 1, ARect.Bottom - 1);
|
||||
Rectangle(ARect.Left + 2, ARect.Top + 2, Right - 2, ARect.Bottom - 2);
|
||||
|
||||
Pen.Color := OldPenColor;
|
||||
Brush.Color := OldBrushColor;
|
||||
end;
|
||||
ACanvas.TextOut(ARect.Left, ARect.Top, GetVisualValue);
|
||||
// DefaultPropertyDrawValue(Self, ACanvas, Rect(Right, ARect.Top, ARect.Right, ARect.Bottom));
|
||||
h := ACanvas.TextHeight('Tg');
|
||||
ACanvas.TextOut(Right + 2, (ARect.Top + ARect.Bottom - h) div 2, GetVisualValue);
|
||||
end;
|
||||
|
||||
procedure TJvFullColorProperty.SetColor(AFullColor: TJvFullColor);
|
||||
@ -368,6 +361,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
//=== { TJvFullColorSpaceProperty } ==========================================
|
||||
|
||||
constructor TJvFullColorSpaceProperty.Create(AParent: TJvFullColorProperty;
|
||||
@ -408,6 +402,7 @@ begin
|
||||
Result := ColorSpace.Name;
|
||||
end;
|
||||
|
||||
|
||||
//=== { TJvFullColorAxisProperty } ===========================================
|
||||
|
||||
constructor TJvFullColorAxisProperty.Create(AParent: TJvFullColorSpaceProperty;
|
||||
|
Reference in New Issue
Block a user