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
|
type
|
||||||
TJvDEFFamily = (pfConstant, pfSystem);
|
TJvDEFFamily = (pfConstant, pfSystem);
|
||||||
|
|
||||||
TJvFullColorProperty = class(TPropertyEditor) //, ICustomPropertyDrawing)
|
TJvFullColorProperty = class(TPropertyEditor)
|
||||||
private
|
private
|
||||||
function GetIsColorProperty: Boolean;
|
function GetIsColorProperty: Boolean;
|
||||||
procedure DialogApply(Sender: TObject; AFullColor: TJvFullColor);
|
procedure DialogApply(Sender: TObject; AFullColor: TJvFullColor);
|
||||||
@ -50,8 +50,6 @@ type
|
|||||||
procedure Edit; override;
|
procedure Edit; override;
|
||||||
procedure EditSpace(AColorID: TJvFullColorSpaceID);
|
procedure EditSpace(AColorID: TJvFullColorSpaceID);
|
||||||
procedure SetColor(AFullColor: TJvFullColor);
|
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;
|
procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect; {%H-}AState: TPropEditDrawState); override;
|
||||||
property IsColorProperty: Boolean read GetIsColorProperty;
|
property IsColorProperty: Boolean read GetIsColorProperty;
|
||||||
end;
|
end;
|
||||||
@ -147,6 +145,7 @@ type
|
|||||||
procedure FormApply(Sender: TObject);
|
procedure FormApply(Sender: TObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure RegisterFullColorSpaceEditor(AColorSpaceID: TJvFullColorSpaceID;
|
procedure RegisterFullColorSpaceEditor(AColorSpaceID: TJvFullColorSpaceID;
|
||||||
AEditorClass: TJvFullColorSpacePropertyClass);
|
AEditorClass: TJvFullColorSpacePropertyClass);
|
||||||
|
|
||||||
@ -303,18 +302,12 @@ begin
|
|||||||
Proc(ColorSpaceByIndex[I].ShortName);
|
Proc(ColorSpaceByIndex[I].ShortName);
|
||||||
end;
|
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;
|
procedure TJvFullColorProperty.PropDrawValue(ACanvas: TCanvas;
|
||||||
const ARect: TRect; AState: TPropEditDrawState);
|
const ARect: TRect; AState: TPropEditDrawState);
|
||||||
var
|
var
|
||||||
OldPenColor, OldBrushColor: TColor;
|
OldPenColor, OldBrushColor: TColor;
|
||||||
Right: Integer;
|
Right: Integer;
|
||||||
|
h: Integer;
|
||||||
begin
|
begin
|
||||||
with ACanvas do
|
with ACanvas do
|
||||||
begin
|
begin
|
||||||
@ -330,13 +323,13 @@ begin
|
|||||||
|
|
||||||
Right := (ARect.Bottom - ARect.Top) + ARect.Left;
|
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;
|
Pen.Color := OldPenColor;
|
||||||
Brush.Color := OldBrushColor;
|
Brush.Color := OldBrushColor;
|
||||||
end;
|
end;
|
||||||
ACanvas.TextOut(ARect.Left, ARect.Top, GetVisualValue);
|
h := ACanvas.TextHeight('Tg');
|
||||||
// DefaultPropertyDrawValue(Self, ACanvas, Rect(Right, ARect.Top, ARect.Right, ARect.Bottom));
|
ACanvas.TextOut(Right + 2, (ARect.Top + ARect.Bottom - h) div 2, GetVisualValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvFullColorProperty.SetColor(AFullColor: TJvFullColor);
|
procedure TJvFullColorProperty.SetColor(AFullColor: TJvFullColor);
|
||||||
@ -368,6 +361,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
//=== { TJvFullColorSpaceProperty } ==========================================
|
//=== { TJvFullColorSpaceProperty } ==========================================
|
||||||
|
|
||||||
constructor TJvFullColorSpaceProperty.Create(AParent: TJvFullColorProperty;
|
constructor TJvFullColorSpaceProperty.Create(AParent: TJvFullColorProperty;
|
||||||
@ -408,6 +402,7 @@ begin
|
|||||||
Result := ColorSpace.Name;
|
Result := ColorSpace.Name;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
//=== { TJvFullColorAxisProperty } ===========================================
|
//=== { TJvFullColorAxisProperty } ===========================================
|
||||||
|
|
||||||
constructor TJvFullColorAxisProperty.Create(AParent: TJvFullColorSpaceProperty;
|
constructor TJvFullColorAxisProperty.Create(AParent: TJvFullColorSpaceProperty;
|
||||||
|
Reference in New Issue
Block a user