IDE: options: messages: colors

git-svn-id: trunk@45197 -
This commit is contained in:
mattias 2014-05-27 13:16:16 +00:00
parent 503ddc71ad
commit 856f36c29c
9 changed files with 301 additions and 46 deletions

View File

@ -233,6 +233,7 @@ const
EnvOptionsCompPalette = 350;
EnvOptionsFormEd = 400;
EnvOptionsOI = 500;
EnvOptionsMessages = 550;
EnvOptionsFpDoc = 600;
EnvOptionsBackup = 700;
EnvOptionsNaming = 800;

View File

@ -171,6 +171,38 @@ const
'Never'
);
{ Messages window }
type
TMsgWndColor = (
mwBackground,
mwRunning,
mwSuccess,
mwFailed,
mwAutoHeader
);
const
MsgWndDefBackgroundColor = clWindow;
MsgWndDefHeaderBackgroundRunning = TColor($00F0F0); // yellow
MsgWndDefHeaderBackgroundSuccess = TColor($A0F0A0); // light green
MsgWndDefHeaderBackgroundFailed = TColor($A0A0F0); // light red
MsgWndDefAutoHeaderBackground = TColor($FFC0A0); // light blue
MsgWndDefaultColors: array[TMsgWndColor] of TColor = (
MsgWndDefBackgroundColor, // mwBackground
MsgWndDefHeaderBackgroundRunning, // mwRunning
MsgWndDefHeaderBackgroundSuccess, // mwSuccess
MsgWndDefHeaderBackgroundFailed, // mwFailed
MsgWndDefAutoHeaderBackground // mwAutoHeader
);
MsgWndColorNames: array[TMsgWndColor] of string = (
'Background',
'Running',
'Success',
'Failed',
'AutoHeader'
);
{ External Tools - the user menu items in the Tools menu }
{$IFDEF EnableNewExtTools}
type
TBaseExternalUserTools = class
@ -248,7 +280,6 @@ type
FIDEDialogLayoutList: TIDEDialogLayoutList;
FSingleTaskBarButton: boolean;
FHideIDEOnRun: boolean;
FHideMessagesIcons: boolean;
FComponentPaletteVisible: boolean;
// CompletionWindow
FCompletionWindowWidth: Integer;
@ -301,6 +332,8 @@ type
// messages
fMsgViewDblClickJumps: boolean;
fMsgViewFocus: boolean;
FHideMessagesIcons: boolean;
fMsgViewColors: array[TMsgWndColor] of TColor;
// compiler + debugger + lazarus files
FParseValues: array[TEnvOptParseType] of TParseString;
@ -387,6 +420,7 @@ type
function GetFPDocPaths: string;
function GetLazarusDirectory: string;
function GetMakeFilename: string;
function GetMsgViewColors(c: TMsgWndColor): TColor;
function GetTestBuildDirectory: string;
procedure SetCompilerFilename(const AValue: string);
procedure SetCompilerMessagesFilename(AValue: string);
@ -398,6 +432,7 @@ type
procedure SetDebuggerFilename(AValue: string);
procedure SetFPCSourceDirectory(const AValue: string);
procedure SetLazarusDirectory(const AValue: string);
procedure SetMsgViewColors(c: TMsgWndColor; AValue: TColor);
procedure SetParseValue(o: TEnvOptParseType; const NewValue: string);
procedure InitLayoutList;
@ -463,7 +498,6 @@ type
property SingleTaskBarButton: boolean read FSingleTaskBarButton
write FSingleTaskBarButton;
property HideIDEOnRun: boolean read FHideIDEOnRun write FHideIDEOnRun;
property HideMessagesIcons: boolean read fHideMessagesIcons write fHideMessagesIcons;
property IDETitleStartsWithProject: boolean read FIDETitleStartsWithProject
write FIDETitleStartsWithProject;
property IDETitleIncludesBuildMode: boolean read FIDETitleIncludesBuildMode
@ -676,8 +710,11 @@ type
// messages view
property MsgViewDblClickJumps: boolean read fMsgViewDblClickJumps
write fMsgViewDblClickJumps; // true=dbl click jump to error, false=single click jumps
property MsgViewFocus: boolean read fMsgViewFocus write fMsgViewFocus; // when showing the message window, focus it
write fMsgViewDblClickJumps; // true=dbl click jump to error, false=single click jumps
property MsgViewFocus: boolean read fMsgViewFocus
write fMsgViewFocus; // when showing the message window, focus it
property HideMessagesIcons: boolean read fHideMessagesIcons write fHideMessagesIcons;
property MsgViewColors[c: TMsgWndColor]: TColor read GetMsgViewColors write SetMsgViewColors;
// glyphs
property ShowButtonGlyphs: TApplicationShowGlyphs read FShowButtonGlyphs write FShowButtonGlyphs;
@ -829,6 +866,7 @@ end;
constructor TEnvironmentOptions.Create;
var
o: TEnvOptParseType;
c: TMsgWndColor;
begin
inherited Create;
for o:=low(FParseValues) to high(FParseValues) do
@ -853,7 +891,6 @@ begin
IDEWindowIntf.IDEDialogLayoutList:=FIDEDialogLayoutList;
FSingleTaskBarButton:=false;
FHideIDEOnRun:=false;
FHideMessagesIcons:=false;
FIDETitleStartsWithProject:=false;
FIDETitleIncludesBuildMode:=false;
FIDEProjectDirectoryInIdeTitle:=false;
@ -910,6 +947,9 @@ begin
// messages view
fMsgViewDblClickJumps:=true;
fMsgViewFocus:=DefaultMsgViewFocus;
FHideMessagesIcons:=false;
for c:=low(TMsgWndColor) to high(TMsgWndColor) do
fMsgViewColors[c]:=MsgWndDefaultColors[c];
// glyphs
FShowButtonGlyphs := sbgSystem;
@ -1116,6 +1156,7 @@ var
Cfg: TXMLOptionsStorage;
EventType: TDBGEventType;
NodeName: String;
mwc: TMsgWndColor;
begin
Cfg:=nil;
try
@ -1157,14 +1198,13 @@ begin
FAutoCloseCompileDialog:=XMLConfig.GetValue(
Path+'AutoCloseCompileDialog/Value',false);
// Windows layout
IDEWindowCreators.SimpleLayoutStorage.LoadFromConfig(Cfg,Path+'Desktop/');
FIDEDialogLayoutList.LoadFromConfig(FConfigStore, Path+'Desktop/Dialogs/');
FSingleTaskBarButton := XMLConfig.GetValue(
Path+'Desktop/SingleTaskBarButton/Value', False);
FHideIDEOnRun:=XMLConfig.GetValue(
Path+'Desktop/HideIDEOnRun/Value',false);
FHideMessagesIcons:=XMLConfig.GetValue(
Path+'Desktop/HideMessagesIcons/Value',false);
FIDETitleStartsWithProject:=XMLConfig.GetValue(
Path+'Desktop/IDETitleStartsWithProject/Value',false);
FIDETitleIncludesBuildMode:=XMLConfig.GetValue(
@ -1357,6 +1397,11 @@ begin
Path+'MsgViewDblClickJumps/Value',false);
fMsgViewFocus:=XMLConfig.GetValue(
Path+'MsgViewFocus/Value',DefaultMsgViewFocus);
FHideMessagesIcons:=XMLConfig.GetValue(
Path+'Desktop/HideMessagesIcons/Value',false);
for mwc:=low(TMsgWndColor) to high(TMsgWndColor) do
fMsgViewColors[mwc]:=XMLConfig.GetValue(
Path+'MsgView/Colors/'+MsgWndColorNames[mwc],MsgWndDefaultColors[mwc]);
// glyphs
FShowButtonGlyphs := TApplicationShowGlyphs(XMLConfig.GetValue(Path+'ShowButtonGlyphs/Value',
@ -1499,6 +1544,7 @@ var
EventType: TDBGEventType;
CurLazDir: String;
BaseDir: String;
mwc: TMsgWndColor;
begin
Cfg:=nil;
try
@ -1534,8 +1580,6 @@ begin
FSingleTaskBarButton, False);
XMLConfig.SetDeleteValue(Path+'Desktop/HideIDEOnRun/Value',FHideIDEOnRun,
false);
XMLConfig.SetDeleteValue(Path+'Desktop/HideMessagesIcons/Value',FHideMessagesIcons,
false);
XMLConfig.SetDeleteValue(Path+'Desktop/IDETitleStartsWithProject/Value',
FIDETitleStartsWithProject,false);
XMLConfig.SetDeleteValue(Path+'Desktop/IDETitleIncludesBuildMode/Value',
@ -1727,6 +1771,11 @@ begin
fMsgViewDblClickJumps,false);
XMLConfig.SetDeleteValue(Path+'MsgViewFocus/Value',
fMsgViewFocus,DefaultMsgViewFocus);
XMLConfig.SetDeleteValue(Path+'Desktop/HideMessagesIcons/Value',
FHideMessagesIcons,false);
for mwc:=low(TMsgWndColor) to high(TMsgWndColor) do
XMLConfig.SetDeleteValue(Path+'MsgView/Colors/'+MsgWndColorNames[mwc],
fMsgViewColors[mwc],MsgWndDefaultColors[mwc]);
// glyphs
XMLConfig.SetDeleteValue(Path+'ShowButtonGlyphs/Value',
@ -2188,6 +2237,11 @@ begin
SetParseValue(eopLazarusDirectory,NewValue);
end;
procedure TEnvironmentOptions.SetMsgViewColors(c: TMsgWndColor; AValue: TColor);
begin
fMsgViewColors[c]:=AValue;
end;
procedure TEnvironmentOptions.SetParseValue(o: TEnvOptParseType;
const NewValue: string);
begin
@ -2259,6 +2313,11 @@ begin
Result:=FParseValues[eopMakeFilename].UnparsedValue;
end;
function TEnvironmentOptions.GetMsgViewColors(c: TMsgWndColor): TColor;
begin
Result:=fMsgViewColors[c];
end;
function TEnvironmentOptions.GetTestBuildDirectory: string;
begin
Result:=FParseValues[eopTestBuildDirectory].UnparsedValue;

View File

@ -103,13 +103,6 @@ type
end;
const
MCDefaultBackground = clWindow;
MCDefaultHeaderBackgroundRunning = TColor($00F0F0); // yellow
MCDefaultHeaderBackgroundSuccess = TColor($A0F0A0); // light green
MCDefaultHeaderBackgroundFailed = TColor($A0A0F0); // light red
MCDefaultAutoHeaderBackground = TColor($FFC0A0); // light blue
type
TMessagesCtrl = class;
@ -366,8 +359,8 @@ type
function ApplySrcChanges(Changes: TETSrcChanges): boolean; // true if something changed
public
// properties
property AutoHeaderBackground: TColor read FAutoHeaderBackground write SetAutoHeaderBackground default MCDefaultAutoHeaderBackground;
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default MCDefaultBackground;
property AutoHeaderBackground: TColor read FAutoHeaderBackground write SetAutoHeaderBackground default MsgWndDefAutoHeaderBackground;
property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor default MsgWndDefBackgroundColor;
property Color default clWindow;
property FilenameStyle: TMsgCtrlFileNameStyle read FFilenameStyle write SetFilenameStyle;
property HeaderBackground[aToolState: TLMVToolState]: TColor read GetHeaderBackground write SetHeaderBackground;
@ -2763,11 +2756,11 @@ begin
FSelectedView:=nil;
FSelectedLine:=-1;
BorderWidth:=0;
fBackgroundColor:=MCDefaultBackground;
FHeaderBackground[lmvtsRunning]:=MCDefaultHeaderBackgroundRunning;
FHeaderBackground[lmvtsSuccess]:=MCDefaultHeaderBackgroundSuccess;
FHeaderBackground[lmvtsFailed]:=MCDefaultHeaderBackgroundFailed;
FAutoHeaderBackground:=MCDefaultAutoHeaderBackground;
fBackgroundColor:=MsgWndDefBackgroundColor;
FHeaderBackground[lmvtsRunning]:=MsgWndDefHeaderBackgroundRunning;
FHeaderBackground[lmvtsSuccess]:=MsgWndDefHeaderBackgroundSuccess;
FHeaderBackground[lmvtsFailed]:=MsgWndDefHeaderBackgroundFailed;
FAutoHeaderBackground:=MsgWndDefAutoHeaderBackground;
TabStop := True;
ParentColor := False;
FImageChangeLink := TChangeLink.Create;

View File

@ -1,39 +1,44 @@
object MsgWndOptionsFrame: TMsgWndOptionsFrame
Left = 0
Height = 331
Height = 355
Top = 0
Width = 470
ClientHeight = 331
ClientWidth = 470
Width = 495
ClientHeight = 355
ClientWidth = 495
TabOrder = 0
DesignLeft = 386
DesignTop = 221
object MWColorsGroupBox: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 152
Top = 0
Width = 225
Width = 495
Anchors = [akTop, akLeft, akRight]
Caption = 'MWColorsGroupBox'
ClientHeight = 130
ClientWidth = 217
ClientHeight = 135
ClientWidth = 491
TabOrder = 0
object MWColorListBox: TColorListBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideRight.Control = MWColorsGroupBox
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = MWSetDefaultColorsButton
AnchorSideBottom.Control = MWColorBox
Left = 6
Height = 92
Height = 88
Top = 6
Width = 205
Width = 307
Style = [cbCustomColors]
OnGetColors = MWColorListBoxGetColors
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
OnSelectionChange = MWColorListBoxSelectionChange
TabOrder = 0
TopIndex = -1
end
object MWColorBox: TColorBox
AnchorSideLeft.Control = MWColorsGroupBox
@ -42,13 +47,79 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
AnchorSideBottom.Control = MWColorsGroupBox
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 20
Top = 104
Width = 205
Height = 29
Top = 100
Width = 479
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 0
OnChange = MWColorBoxChange
TabOrder = 1
end
object MWSetDefaultColorsButton: TButton
AnchorSideTop.Control = MWSetAllColorsToLabel
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = MWColorsGroupBox
AnchorSideRight.Side = asrBottom
Left = 319
Height = 27
Top = 27
Width = 166
Anchors = [akTop, akRight]
AutoSize = True
BorderSpacing.Top = 6
BorderSpacing.Right = 6
Caption = 'MWSetDefaultColorsButton'
OnClick = MWSetDefaultColorsButtonClick
TabOrder = 2
end
object MWSetAllColorsToLabel: TLabel
AnchorSideLeft.Control = MWColorListBox
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MWColorListBox
Left = 319
Height = 15
Top = 6
Width = 129
Caption = 'MWSetAllColorsToLabel'
ParentColor = False
end
end
object MWOptionsLabel: TLabel
AnchorSideLeft.Control = MWOptsLeftBevel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideTop.Side = asrBottom
Left = 70
Height = 15
Top = 158
Width = 93
BorderSpacing.Left = 10
BorderSpacing.Top = 6
BorderSpacing.Right = 10
Caption = 'MWOptionsLabel'
ParentColor = False
end
object MWOptsLeftBevel: TBevel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = MWOptionsLabel
AnchorSideTop.Side = asrCenter
Left = 0
Height = 3
Top = 164
Width = 60
end
object MWOptsRightBevel: TBevel
AnchorSideLeft.Control = MWOptionsLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MWOptionsLabel
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 173
Height = 3
Top = 164
Width = 322
Anchors = [akTop, akLeft, akRight]
end
end

View File

@ -17,6 +17,11 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Author: Mattias Gaertner
Abstract:
IDE option frame for Messages window.
}
unit MsgWnd_Options;
@ -25,19 +30,37 @@ unit MsgWnd_Options;
interface
uses
Classes, SysUtils, FileUtil, IDEOptionsIntf, Forms, Controls, Graphics,
Dialogs, StdCtrls, ColorBox;
Classes, SysUtils, FileUtil, LazLoggerBase, IDEOptionsIntf, Forms, Controls,
Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls, LazarusIDEStrConsts,
EnvironmentOpts;
type
{ TMsgWndOptionsFrame }
TMsgWndOptionsFrame = class(TAbstractIDEOptionsEditor)
MWOptsLeftBevel: TBevel;
MWColorBox: TColorBox;
MWColorListBox: TColorListBox;
MWColorsGroupBox: TGroupBox;
MWOptionsLabel: TLabel;
MWOptsRightBevel: TBevel;
MWSetAllColorsToLabel: TLabel;
MWSetDefaultColorsButton: TButton;
procedure MWColorBoxChange(Sender: TObject);
procedure MWColorListBoxGetColors(Sender: TCustomColorListBox;
Items: TStrings);
procedure MWColorListBoxSelectionChange(Sender: TObject; User: boolean);
procedure MWSetDefaultColorsButtonClick(Sender: TObject);
private
fReady: boolean;
public
constructor Create(AOwner: TComponent); override;
function GetTitle: String; override;
procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
procedure ReadSettings(AOptions: TAbstractIDEOptions); override;
procedure WriteSettings(AOptions: TAbstractIDEOptions); override;
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
end;
var
@ -47,5 +70,100 @@ implementation
{$R *.lfm}
{ TMsgWndOptionsFrame }
procedure TMsgWndOptionsFrame.MWColorListBoxGetColors(
Sender: TCustomColorListBox; Items: TStrings);
begin
Items.Add(dlgBackColor);
Items.Add('Tool Header: Running');
Items.Add('Tool Header: Success');
Items.Add('Tool Header: Failed');
Items.Add('Tool Header: Scrolled up');
end;
procedure TMsgWndOptionsFrame.MWColorBoxChange(Sender: TObject);
var
i: Integer;
begin
i:=MWColorListBox.ItemIndex;
if not fReady or (i < 0) then
exit;
MWColorListBox.Colors[i]:=MWColorBox.Selected;
end;
procedure TMsgWndOptionsFrame.MWColorListBoxSelectionChange(Sender: TObject;
User: boolean);
begin
if not (fReady and User) then
Exit;
MWColorBox.Selected := MWColorListBox.Selected;
end;
procedure TMsgWndOptionsFrame.MWSetDefaultColorsButtonClick(Sender: TObject);
var
c: TMsgWndColor;
begin
for c in TMsgWndColor do
MWColorListBox.Colors[ord(c)]:=MsgWndDefaultColors[c];
MWColorBox.Selected := MWColorListBox.Selected;
end;
constructor TMsgWndOptionsFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
MWOptionsLabel.Caption:=dlgOIOptions;
MWColorsGroupBox.Caption:=dlgColors;
MWSetAllColorsToLabel.Caption:=lisSetAllColors;
MWSetDefaultColorsButton.Caption:=lisLazarusDefault;
end;
function TMsgWndOptionsFrame.GetTitle: String;
begin
Result:=lisMenuViewMessages;
end;
procedure TMsgWndOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
fReady:=false;
{$IFDEF EnableNewExtTools}
{$ELSE}
MWColorsGroupBox.Visible:=false;
{$ENDIF}
end;
procedure TMsgWndOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
var
o: TEnvironmentOptions;
c: TMsgWndColor;
begin
o:=(AOptions as TEnvironmentOptions);
for c in TMsgWndColor do
MWColorListBox.Colors[ord(c)]:=o.MsgViewColors[c];
fReady:=true;
end;
procedure TMsgWndOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
var
o: TEnvironmentOptions;
c: TMsgWndColor;
begin
o:=(AOptions as TEnvironmentOptions);
for c in TMsgWndColor do
o.MsgViewColors[c]:=MWColorListBox.Colors[ord(c)];
end;
class function TMsgWndOptionsFrame.
SupportedOptionsClass: TAbstractIDEOptionsClass;
begin
Result := TEnvironmentOptions;
end;
initialization
//RegisterIDEOptionsEditor(GroupEnvironment, TMsgWndOptionsFrame, EnvOptionsMessages);
end.

View File

@ -17,6 +17,9 @@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************
Abstract:
IDE option frame for Object Inspector.
}
unit OI_options;
@ -212,8 +215,7 @@ var
OIColor: TOIColor;
begin
for OIColor := Low(TOIColor) to High(TOIColor) do
ColorsListBox.Items.Objects[Ord(OIColor)] := TObject(PtrInt(ASettings.Colors[OIColor]));
ColorsListBox.Invalidate;
ColorsListBox.Colors[Ord(OIColor)] := ASettings.Colors[OIColor];
OIShowComponentTreeCheckBox.Checked := ASettings.Options[ooShowComponentTree];
OIShowHintCheckBox.Checked := ASettings.Options[ooShowHints];

View File

@ -1620,6 +1620,8 @@ resourcestring
dlgUseSchemeLocal = 'Use local scheme settings';
dlgColor = 'Color';
dlgColors = 'Colors';
lisSetAllColors = 'Set all colors:';
lisLazarusDefault = 'Lazarus Default';
dlgColorNotModified = 'Not modified';
dlgPriorities = 'Priorities';

View File

@ -118,7 +118,7 @@ uses
ChgEncodingDlg, ConvertDelphi, ConvCodeTool, MissingPropertiesDlg, LazXMLForms,
// environment option frames
editor_general_options, componentpalette_options, formed_options, OI_options,
files_options, desktop_options, window_options,
MsgWnd_Options, files_options, desktop_options, window_options,
Backup_Options, naming_options, fpdoc_options,
editor_display_options, editor_keymapping_options, editor_mouseaction_options,
editor_mouseaction_options_advanced, editor_color_options, editor_markup_options,
@ -11918,6 +11918,7 @@ var
if not BossResult then begin
CodeToolBossErrMsg:=CodeToolBoss.ErrorMessage;
DoJumpToCodeToolBossError;
// raise an exception to stop the rename
raise Exception.Create(ErrorMsg+LineEnding+LineEnding+lisError
+CodeToolBossErrMsg+LineEnding+LineEnding+lisSeeMessages);
end;

View File

@ -155,10 +155,11 @@ type
FOnGetColors: TLBGetColorsEvent;
FSelected: TColor;
FStyle: TColorBoxStyle;
function GetColor(Index : Integer): TColor;
function GetColors(Index : Integer): TColor;
function GetColorName(Index: Integer): string;
function GetSelected: TColor;
procedure SetColorRectWidth(AValue: Integer);
procedure SetColors(Index: Integer; AValue: TColor);
procedure SetDefaultColorColor(const AValue: TColor);
procedure SetNoneColorColor(const AValue: TColor);
procedure SetSelected(Value: TColor);
@ -177,7 +178,7 @@ type
property ColorRectWidth: Integer read FColorRectWidth write SetColorRectWidth default 14;
property Style: TColorBoxStyle read FStyle write SetStyle
default [cbStandardColors, cbExtendedColors, cbSystemColors];
property Colors[Index: Integer]: TColor read GetColor;
property Colors[Index: Integer]: TColor read GetColors write SetColors;
property ColorNames[Index: Integer]: string read GetColorName;
property Selected: TColor read GetSelected write SetSelected default clBlack;
property DefaultColorColor: TColor read FDefaultColorColor write SetDefaultColorColor default clBlack;
@ -710,6 +711,13 @@ begin
Invalidate;
end;
procedure TCustomColorListBox.SetColors(Index: Integer; AValue: TColor);
begin
if Colors[Index]=AValue then exit;
Items.Objects[Index]:=TObject(PtrInt(AValue));
Invalidate;
end;
procedure TCustomColorListBox.SetDefaultColorColor(const AValue: TColor);
begin
if FDefaultColorColor <> AValue then
@ -729,14 +737,14 @@ begin
end;
{------------------------------------------------------------------------------
Method: TCustomColorListBox.GetColor
Method: TCustomColorListBox.GetColors
Params: Index
Returns: Color at position Index
Used as read procedure from Colors property.
------------------------------------------------------------------------------}
function TCustomColorListBox.GetColor(Index : Integer): TColor;
function TCustomColorListBox.GetColors(Index : Integer): TColor;
begin
Result := PtrInt(Items.Objects[Index]);
end;