IDEIntf: TColorPropertyEditor.ListDrawValue: fixed wrong values

git-svn-id: trunk@35846 -
This commit is contained in:
mattias 2012-03-09 16:11:05 +00:00
parent f5e46fffd7
commit 22aeb25172
2 changed files with 9 additions and 1 deletions

View File

@ -402,7 +402,7 @@ begin
Rectangle(ARect.Left, ARect.Top, vRight, vBottom);
// set things up and do the work
Brush.Color := StringToColor(CurValue);
Brush.Color := StringToColorDef(CurValue,clNone);
Pen.Color := ColorToBorderColor(ColorToRGB(Brush.Color));
Rectangle(ARect.Left + 1, ARect.Top + 1, vRight - 1, vBottom - 1);

View File

@ -1915,6 +1915,7 @@ function SysColorToSysColorIndex(Color: TColor): integer;
function ColorToRGB(Color: TColor): Longint;
function ColorToString(Color: TColor): AnsiString;
function StringToColor(const S: shortstring): TColor;
function StringToColorDef(const S: shortstring; const DefaultValue: TColor): TColor;
procedure GetColorValues(Proc: TGetColorStringProc);
function InvertColor(AColor: TColor): TColor;
function DecColor(AColor: TColor; AQuantity: Byte): TColor;
@ -2573,6 +2574,13 @@ begin
Result := TColor(StrToInt(S));
end;
function StringToColorDef(const S: shortstring; const DefaultValue: TColor): TColor;
begin
Result := DefaultValue;
if not IdentToColor(S, Longint(Result)) then
Result := TColor(StrToIntDef(S,DefaultValue));
end;
procedure GetColorValues(Proc: TGetColorStringProc);
var
I: Integer;