Fulfill rfe #692 "Add color-coding settings to data-appearance tab in preferences". Including new default color for ENUM fields and settings to enable/disable the grid editors.

This commit is contained in:
Ansgar Becker
2008-09-07 15:13:24 +00:00
parent 5aa13c8195
commit efbadf5b58
5 changed files with 281 additions and 13 deletions

View File

@ -169,6 +169,7 @@ type
function BinToWideHex(bin: string): WideString;
procedure CheckHex(text: WideString; errorMessage: string);
procedure FixVT(VT: TVirtualStringTree);
function ColorAdjustBrightness(Col: TColor; ShiftPercent: ShortInt): TColor;
var
MYSQL_KEYWORDS : TStringList;
@ -2652,6 +2653,28 @@ begin
end;
function ColorAdjustBrightness(Col: TColor; ShiftPercent: ShortInt): TColor;
var
r, g, b, ShiftBytes: SmallInt;
begin
// Split colors
r := GetRValue(Col);
g := GetGValue(Col);
b := GetBValue(Col);
// Convert percent value to bytes
ShiftBytes := Round(ShiftPercent * 255 / 100);
// Adjust single colors
r := r + ShiftBytes;
g := g + ShiftBytes;
b := b + ShiftBytes;
// Fix exceeded bounds
if r > 255 then r := 255 else if r < 0 then r := 0;
if g > 255 then g := 255 else if g < 0 then g := 0;
if b > 255 then b := 255 else if b < 0 then b := 0;
// Merge result
Result := RGB(r, g, b);
end;
initialization