IDE Options: allow to set colors for messages in message window by urgency.

git-svn-id: trunk@48789 -
This commit is contained in:
martin 2015-04-20 21:59:46 +00:00
parent 691df1520b
commit 045b4fea7a
5 changed files with 370 additions and 142 deletions

View File

@ -347,6 +347,7 @@ type
FMsgViewAlwaysDrawFocused: boolean;
FMsgViewFilenameStyle: TMsgWndFileNameStyle;
fMsgViewColors: array[TMsgWndColor] of TColor;
fMsgColors: array[TMessageLineUrgency] of TColor;
FShowCompileDialog: Boolean; // show dialog during compile
FAutoCloseCompileDialog: Boolean; // auto close dialog after succesed compile
FMsgViewFilters: TLMsgViewFilters;
@ -429,6 +430,7 @@ type
function GetFPDocPaths: string;
function GetLazarusDirectory: string;
function GetMakeFilename: string;
function GetMsgColors(u: TMessageLineUrgency): TColor;
function GetMsgViewColors(c: TMsgWndColor): TColor;
function GetTestBuildDirectory: string;
procedure SetCompilerFilename(const AValue: string);
@ -441,6 +443,7 @@ type
procedure SetDebuggerFilename(AValue: string);
procedure SetFPCSourceDirectory(const AValue: string);
procedure SetLazarusDirectory(const AValue: string);
procedure SetMsgColors(u: TMessageLineUrgency; AValue: TColor);
procedure SetMsgViewColors(c: TMsgWndColor; AValue: TColor);
procedure SetParseValue(o: TEnvOptParseType; const NewValue: string);
@ -717,6 +720,7 @@ type
write FMsgViewFilenameStyle;
property MsgViewColors[c: TMsgWndColor]: TColor read GetMsgViewColors write SetMsgViewColors;
property MsgViewFilters: TLMsgViewFilters read FMsgViewFilters;
property MsgColors[u: TMessageLineUrgency]: TColor read GetMsgColors write SetMsgColors;
// glyphs
property ShowButtonGlyphs: TApplicationShowGlyphs read FShowButtonGlyphs write FShowButtonGlyphs;
@ -759,6 +763,7 @@ const
);
function dbgs(o: TEnvOptParseType): string; overload;
function dbgs(u: TMessageLineUrgency): string; overload;
implementation
@ -833,12 +838,18 @@ begin
Result:=EnvOptParseTypeNames[o];
end;
function dbgs(u: TMessageLineUrgency): string;
begin
WriteStr(Result, u);
end;
{ TEnvironmentOptions }
constructor TEnvironmentOptions.Create;
var
o: TEnvOptParseType;
c: TMsgWndColor;
u: TMessageLineUrgency;
begin
inherited Create;
for o:=low(FParseValues) to high(FParseValues) do
@ -930,6 +941,8 @@ begin
FMsgViewFilenameStyle:=mwfsShort;
for c:=low(TMsgWndColor) to high(TMsgWndColor) do
fMsgViewColors[c]:=MsgWndDefaultColors[c];
for u:=low(TMessageLineUrgency) to high(TMessageLineUrgency) do
fMsgColors[u] := clDefault;
FMsgViewFilters:=TLMsgViewFilters.Create(nil);
// glyphs
@ -1134,6 +1147,7 @@ var
EventType: TDBGEventType;
NodeName: String;
mwc: TMsgWndColor;
u: TMessageLineUrgency;
begin
Cfg:=nil;
try
@ -1389,6 +1403,9 @@ begin
for mwc:=low(TMsgWndColor) to high(TMsgWndColor) do
fMsgViewColors[mwc]:=XMLConfig.GetValue(
Path+'MsgView/Colors/'+MsgWndColorNames[mwc],MsgWndDefaultColors[mwc]);
for u:=low(TMessageLineUrgency) to high(TMessageLineUrgency) do
fMsgColors[u] := XMLConfig.GetValue(
Path+'MsgView/MsgColors/'+dbgs(u),clDefault);
MsgViewFilters.LoadFromXMLConfig(XMLConfig,'MsgView/Filters/');
// glyphs
@ -1532,6 +1549,7 @@ var
CurLazDir: String;
BaseDir: String;
mwc: TMsgWndColor;
u: TMessageLineUrgency;
begin
Cfg:=nil;
try
@ -1774,6 +1792,9 @@ begin
for mwc:=low(TMsgWndColor) to high(TMsgWndColor) do
XMLConfig.SetDeleteValue(Path+'MsgView/Colors/'+MsgWndColorNames[mwc],
fMsgViewColors[mwc],MsgWndDefaultColors[mwc]);
for u:=low(TMessageLineUrgency) to high(TMessageLineUrgency) do
XMLConfig.SetDeleteValue(Path+'MsgView/MsgColors/'+dbgs(u),
fMsgColors[u],clDefault);
MsgViewFilters.SaveToXMLConfig(XMLConfig,'MsgView/Filters/');
// glyphs
@ -2236,6 +2257,11 @@ begin
SetParseValue(eopLazarusDirectory,NewValue);
end;
procedure TEnvironmentOptions.SetMsgColors(u: TMessageLineUrgency; AValue: TColor);
begin
fMsgColors[u] := AValue;
end;
procedure TEnvironmentOptions.SetMsgViewColors(c: TMsgWndColor; AValue: TColor);
begin
fMsgViewColors[c]:=AValue;
@ -2312,6 +2338,11 @@ begin
Result:=FParseValues[eopMakeFilename].UnparsedValue;
end;
function TEnvironmentOptions.GetMsgColors(u: TMessageLineUrgency): TColor;
begin
Result:=fMsgColors[u];
end;
function TEnvironmentOptions.GetMsgViewColors(c: TMsgWndColor): TColor;
begin
Result:=fMsgViewColors[c];

View File

@ -1598,9 +1598,9 @@ begin
inc(NodeRect.Left,Images.Width+2);
end;
// message text
col:=TextColor;
if col=clDefault then
col:=UrgencyStyles[Line.Urgency].Color;
if col=clDefault then
col:=TextColor;
DrawText(NodeRect,GetLineText(Line),IsSelected,col);
inc(y,ItemHeight);
inc(j);
@ -1629,9 +1629,9 @@ begin
if (y+ItemHeight>0) and (y<ClientHeight) then begin
// progress text
NodeRect:=Rect(Indent,y,ClientWidth,y+ItemHeight);
col:=TextColor;
if col=clDefault then
col:=UrgencyStyles[View.ProgressLine.Urgency].Color;
if col=clDefault then
col:=TextColor;
DrawText(NodeRect,View.ProgressLine.Msg,
(fSelectedView=View) and (FSelectedLine=View.Lines.Count),col);
end;
@ -3439,22 +3439,31 @@ begin
Align:=alClient;
Parent:=Self;
UrgencyStyles[mluNone].SetValues('?',ImgIDInfo,clDefault);
UrgencyStyles[mluProgress].SetValues(lisPDProgress, ImgIDInfo, clDefault);
UrgencyStyles[mluDebug].SetValues(lisDebug, ImgIDInfo, clDefault);
UrgencyStyles[mluNone].SetValues('?',ImgIDInfo,EnvironmentOptions.MsgColors[mluNone]);
UrgencyStyles[mluProgress].SetValues(lisPDProgress, ImgIDInfo,
EnvironmentOptions.MsgColors[mluProgress]);
UrgencyStyles[mluDebug].SetValues(lisDebug, ImgIDInfo,
EnvironmentOptions.MsgColors[mluDebug]);
UrgencyStyles[mluVerbose3].SetValues(lisExtremelyVerbose, ImgIDInfo,
clDefault);
UrgencyStyles[mluVerbose2].SetValues(lisVeryVerbose, ImgIDInfo, clDefault);
UrgencyStyles[mluVerbose].SetValues(lisVerbose, ImgIDInfo, clDefault);
UrgencyStyles[mluHint].SetValues(lisHint, ImgIDHint, clDefault);
UrgencyStyles[mluNote].SetValues(lisNote, ImgIDNote, clDefault);
EnvironmentOptions.MsgColors[mluVerbose3]);
UrgencyStyles[mluVerbose2].SetValues(lisVeryVerbose, ImgIDInfo,
EnvironmentOptions.MsgColors[mluVerbose2]);
UrgencyStyles[mluVerbose].SetValues(lisVerbose, ImgIDInfo,
EnvironmentOptions.MsgColors[mluVerbose]);
UrgencyStyles[mluHint].SetValues(lisHint, ImgIDHint,
EnvironmentOptions.MsgColors[mluHint]);
UrgencyStyles[mluNote].SetValues(lisNote, ImgIDNote,
EnvironmentOptions.MsgColors[mluNote]);
UrgencyStyles[mluWarning].SetValues(lisCCOWarningCaption, ImgIDWarning,
clDefault);
UrgencyStyles[mluImportant].SetValues(lisImportant, ImgIDInfo, clDefault);
UrgencyStyles[mluError].SetValues(lisCCOErrorCaption, ImgIDError, clDefault
);
UrgencyStyles[mluFatal].SetValues(lisFatal, ImgIDFatal, clDefault);
UrgencyStyles[mluPanic].SetValues(lisPanic, ImgIDFatal, clDefault);
EnvironmentOptions.MsgColors[mluWarning]);
UrgencyStyles[mluImportant].SetValues(lisImportant, ImgIDInfo,
EnvironmentOptions.MsgColors[mluImportant]);
UrgencyStyles[mluError].SetValues(lisCCOErrorCaption, ImgIDError,
EnvironmentOptions.MsgColors[mluError]);
UrgencyStyles[mluFatal].SetValues(lisFatal, ImgIDFatal,
EnvironmentOptions.MsgColors[mluFatal]);
UrgencyStyles[mluPanic].SetValues(lisPanic, ImgIDFatal,
EnvironmentOptions.MsgColors[mluPanic]);
Images:=IDEImages.Images_12;
PopupMenu:=MsgCtrlPopupMenu;
end;

View File

@ -8,113 +8,15 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
TabOrder = 0
DesignLeft = 386
DesignTop = 221
object MWColorsGroupBox: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 172
Top = 0
Width = 495
Anchors = [akTop, akLeft, akRight]
Caption = 'MWColorsGroupBox'
ClientHeight = 155
ClientWidth = 491
TabOrder = 0
object MWColorListBox: TColorListBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorBox
Left = 6
Height = 108
Top = 6
Width = 303
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
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorsGroupBox
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 29
Top = 120
Width = 303
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeNone, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 20
OnChange = MWColorBoxChange
TabOrder = 1
end
object MWSpeedSetColorsGroupBox: TGroupBox
Left = 315
Height = 143
Top = 6
Width = 170
Align = alRight
BorderSpacing.Around = 6
Caption = 'MWSpeedSetColorsGroupBox'
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 126
ClientWidth = 166
TabOrder = 2
object MWSetEditorColorsButton: TButton
Left = 0
Height = 27
Top = 0
Width = 166
AutoSize = True
Caption = 'MWSetEditorColorsButton'
OnClick = MWSetEditorColorsButtonClick
TabOrder = 0
end
object MWSetDefaultColorsButton: TButton
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 0
Height = 27
Top = 33
Width = 166
AutoSize = True
BorderSpacing.Top = 6
BorderSpacing.Right = 6
Caption = 'MWSetDefaultColorsButton'
OnClick = MWSetDefaultColorsButtonClick
TabOrder = 1
end
object MWSetPastelColorsButton: TButton
Left = 0
Height = 27
Top = 66
Width = 166
AutoSize = True
BorderSpacing.Top = 6
Caption = 'MWSetPastelColorsButton'
OnClick = MWSetPastelColorsButtonClick
TabOrder = 2
end
end
end
object MWOptionsLabel: TLabel
AnchorSideLeft.Control = MWOptsLeftBevel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideTop.Control = Notebook1
AnchorSideTop.Side = asrBottom
Left = 70
Height = 15
Top = 178
Width = 93
Top = 206
Width = 92
BorderSpacing.Left = 10
BorderSpacing.Top = 6
BorderSpacing.Right = 10
@ -128,7 +30,7 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
AnchorSideTop.Side = asrCenter
Left = 0
Height = 3
Top = 184
Top = 212
Width = 60
end
object MWOptsRightBevel: TBevel
@ -138,10 +40,10 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 173
Left = 172
Height = 3
Top = 184
Width = 322
Top = 212
Width = 323
Anchors = [akTop, akLeft, akRight]
end
object MWShowIconsCheckBox: TCheckBox
@ -149,53 +51,53 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
AnchorSideTop.Control = MWOptionsLabel
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 199
Width = 158
Height = 19
Top = 227
Width = 151
BorderSpacing.Left = 6
Caption = 'MWShowIconsCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 1
TabOrder = 0
end
object MWFocusCheckBox: TCheckBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = MWAlwaysDrawFocusedCheckBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 247
Width = 132
Height = 19
Top = 265
Width = 125
BorderSpacing.Left = 6
Caption = 'MWFocusCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 2
TabOrder = 1
end
object MWAlwaysDrawFocusedCheckBox: TCheckBox
AnchorSideLeft.Control = MWShowIconsCheckBox
AnchorSideTop.Control = MWShowIconsCheckBox
AnchorSideTop.Side = asrBottom
Left = 6
Height = 24
Top = 223
Width = 212
Height = 19
Top = 246
Width = 202
Caption = 'MWAlwaysDrawFocusedCheckBox'
ParentShowHint = False
ShowHint = True
TabOrder = 3
TabOrder = 2
end
object MWMaxProcsSpinEdit: TSpinEdit
AnchorSideLeft.Control = MWMaxProcsLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = MWFocusCheckBox
AnchorSideTop.Side = asrBottom
Left = 110
Height = 25
Top = 271
Left = 109
Height = 23
Top = 284
Width = 50
BorderSpacing.Left = 2
TabOrder = 4
TabOrder = 3
end
object MWMaxProcsLabel: TLabel
AnchorSideLeft.Control = Owner
@ -203,10 +105,195 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
AnchorSideTop.Side = asrCenter
Left = 6
Height = 15
Top = 276
Width = 102
Top = 288
Width = 101
BorderSpacing.Left = 6
Caption = 'MWMaxProcsLabel'
ParentColor = False
end
object ToolBar1: TToolBar
Left = 0
Height = 26
Top = 0
Width = 495
Caption = 'ToolBar1'
ShowCaptions = True
TabOrder = 4
object BtnHeaderColor: TToolButton
Left = 1
Top = 2
AllowAllUp = True
Caption = 'BtnHeaderColor'
Down = True
Grouped = True
OnClick = BtnHeaderColorClick
Style = tbsCheck
end
object BtnMsgColor: TToolButton
Left = 94
Top = 2
AllowAllUp = True
Caption = 'BtnMsgColor'
Grouped = True
OnClick = BtnMsgColorClick
Style = tbsCheck
end
end
object Notebook1: TNotebook
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ToolBar1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 174
Top = 26
Width = 495
PageIndex = 1
Anchors = [akTop, akLeft, akRight]
TabOrder = 5
TabStop = True
object PageHeader: TPage
object MWColorsGroupBox: TGroupBox
Left = 0
Height = 174
Top = 0
Width = 495
Align = alClient
Anchors = [akTop, akLeft, akRight]
Caption = 'MWColorsGroupBox'
ClientHeight = 154
ClientWidth = 491
TabOrder = 0
object MWColorListBox: TColorListBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorBox
Left = 6
Height = 110
Top = 6
Width = 303
Style = [cbCustomColors]
OnGetColors = MWColorListBoxGetColors
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
ItemHeight = 0
OnSelectionChange = MWColorListBoxSelectionChange
TabOrder = 0
end
object MWColorBox: TColorBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideTop.Control = MWColorListBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorsGroupBox
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 26
Top = 122
Width = 303
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeNone, cbIncludeDefault, cbCustomColor, cbPrettyNames, cbCustomColors]
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6
ItemHeight = 20
OnChange = MWColorBoxChange
TabOrder = 1
end
object MWSpeedSetColorsGroupBox: TGroupBox
Left = 315
Height = 142
Top = 6
Width = 170
Align = alRight
BorderSpacing.Around = 6
Caption = 'MWSpeedSetColorsGroupBox'
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 122
ClientWidth = 166
TabOrder = 2
object MWSetEditorColorsButton: TButton
Left = 0
Height = 25
Top = 0
Width = 172
AutoSize = True
Caption = 'MWSetEditorColorsButton'
OnClick = MWSetEditorColorsButtonClick
TabOrder = 0
end
object MWSetDefaultColorsButton: TButton
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 0
Height = 25
Top = 31
Width = 172
AutoSize = True
BorderSpacing.Top = 6
BorderSpacing.Right = 6
Caption = 'MWSetDefaultColorsButton'
OnClick = MWSetDefaultColorsButtonClick
TabOrder = 1
end
object MWSetPastelColorsButton: TButton
Left = 0
Height = 25
Top = 62
Width = 172
AutoSize = True
BorderSpacing.Top = 6
Caption = 'MWSetPastelColorsButton'
OnClick = MWSetPastelColorsButtonClick
TabOrder = 2
end
end
end
end
object PageMsg: TPage
object MsgColorGroupBox: TGroupBox
Left = 0
Height = 174
Top = 0
Width = 495
Align = alClient
Caption = 'MsgColorGroupBox'
ClientHeight = 154
ClientWidth = 491
TabOrder = 0
object MsgColorListBox: TColorListBox
AnchorSideLeft.Control = MsgColorGroupBox
AnchorSideTop.Control = MsgColorGroupBox
Left = 6
Height = 110
Top = 6
Width = 303
Style = [cbCustomColors]
OnGetColors = MsgColorListBoxGetColors
BorderSpacing.Around = 6
ItemHeight = 0
OnSelectionChange = MsgColorListBoxSelectionChange
TabOrder = 0
end
object MsgColorBox: TColorBox
AnchorSideLeft.Control = MsgColorGroupBox
AnchorSideTop.Control = MsgColorListBox
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = MsgColorListBox
AnchorSideRight.Side = asrBottom
Left = 6
Height = 24
Top = 122
Width = 297
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbIncludeDefault, cbCustomColor]
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Around = 6
ItemHeight = 16
OnChange = MsgColorBoxChange
TabOrder = 1
end
end
end
end
end

View File

@ -31,7 +31,7 @@ interface
uses
Classes, SysUtils, FileUtil, LazLoggerBase, SynEdit, Forms,
Controls, Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls, Spin,
Controls, Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls, Spin, ComCtrls,
IDEOptionsIntf, IDEExternToolIntf,
LazarusIDEStrConsts, EnvironmentOpts, editor_general_options, EditorOptions;
@ -40,6 +40,9 @@ type
{ TMsgWndOptionsFrame }
TMsgWndOptionsFrame = class(TAbstractIDEOptionsEditor)
MsgColorBox: TColorBox;
MsgColorListBox: TColorListBox;
MsgColorGroupBox: TGroupBox;
MWAlwaysDrawFocusedCheckBox: TCheckBox;
MWFocusCheckBox: TCheckBox;
MWSetPastelColorsButton: TButton;
@ -55,6 +58,17 @@ type
MWSetDefaultColorsButton: TButton;
MWSetEditorColorsButton: TButton;
MWSpeedSetColorsGroupBox: TGroupBox;
Notebook1: TNotebook;
PageHeader: TPage;
PageMsg: TPage;
ToolBar1: TToolBar;
BtnHeaderColor: TToolButton;
BtnMsgColor: TToolButton;
procedure BtnHeaderColorClick(Sender: TObject);
procedure BtnMsgColorClick(Sender: TObject);
procedure MsgColorBoxChange(Sender: TObject);
procedure MsgColorListBoxGetColors(Sender: TCustomColorListBox; Items: TStrings);
procedure MsgColorListBoxSelectionChange(Sender: TObject; User: boolean);
procedure MWColorBoxChange(Sender: TObject);
procedure MWColorListBoxGetColors(Sender: TCustomColorListBox;
Items: TStrings);
@ -105,6 +119,67 @@ begin
MWColorListBox.Colors[i]:=MWColorBox.Selected;
end;
procedure TMsgWndOptionsFrame.BtnHeaderColorClick(Sender: TObject);
begin
Notebook1.PageIndex := 0;
end;
procedure TMsgWndOptionsFrame.BtnMsgColorClick(Sender: TObject);
begin
Notebook1.PageIndex := 1;
end;
procedure TMsgWndOptionsFrame.MsgColorBoxChange(Sender: TObject);
var
i: Integer;
begin
i:=MsgColorListBox.ItemIndex;
if not fReady or (i < 0) then
exit;
MsgColorListBox.Colors[i]:=MsgColorBox.Selected;
end;
procedure TMsgWndOptionsFrame.MsgColorListBoxGetColors(Sender: TCustomColorListBox;
Items: TStrings);
begin
(*
mluNone,
mluProgress, // time and statistics about the run
mluDebug, // extreme verbosity, only useful for tool authors
mluVerbose3, // all infos
mluVerbose2, // almost all infos
mluVerbose, // extra infos
mluHint, // tool found something unusual
mluNote, // maybe wrong or unnecessary
mluWarning, // probably something is wrong
mluImportant, // message has no urgency level, but should be shown
mluError, // tool could not finish, some tools can still continue
mluFatal, // critical error in input, tool had to abort
mluPanic // bug in tool
*)
Items.Add(dlgMsgWinColorUrgentNone);
Items.Add(dlgMsgWinColorUrgentProgress);
Items.Add(dlgMsgWinColorUrgentDebug);
Items.Add(dlgMsgWinColorUrgentVerbose3);
Items.Add(dlgMsgWinColorUrgentVerbose2);
Items.Add(dlgMsgWinColorUrgentVerbose);
Items.Add(dlgMsgWinColorUrgentHint);
Items.Add(dlgMsgWinColorUrgentNote);
Items.Add(dlgMsgWinColorUrgentWarning);
Items.Add(dlgMsgWinColorUrgentImportant);
Items.Add(dlgMsgWinColorUrgentError);
Items.Add(dlgMsgWinColorUrgentFatal);
Items.Add(dlgMsgWinColorUrgentPanic);
end;
procedure TMsgWndOptionsFrame.MsgColorListBoxSelectionChange(Sender: TObject; User: boolean);
begin
if not (fReady and User) then
Exit;
MsgColorBox.Selected := MWColorListBox.Selected;
end;
procedure TMsgWndOptionsFrame.MWColorListBoxSelectionChange(Sender: TObject;
User: boolean);
begin
@ -160,7 +235,10 @@ begin
inherited Create(AOwner);
MWOptionsLabel.Caption:=lisOptions;
BtnHeaderColor.Caption := lisHeaderColors;
BtnMsgColor.Caption := lisMsgColors;
MWColorsGroupBox.Caption:=dlgColors;
MsgColorGroupBox.Caption:=dlgColors;
MWSpeedSetColorsGroupBox.Caption:=lisSetAllColors;
MWSetDefaultColorsButton.Caption:=lisLazarusDefault;
MWSetPastelColorsButton.Caption:=lisPastelColors;
@ -172,6 +250,7 @@ begin
MWFocusCheckBox.Caption:=dlgEOFocusMessagesAfterCompilation;
MWMaxProcsLabel.Caption:=Format(lisMaximumParallelProcesses0MeansDefault, [
IntToStr(DefaultMaxProcessCount)]);
Notebook1.PageIndex := 0;
end;
function TMsgWndOptionsFrame.GetTitle: String;
@ -190,10 +269,13 @@ procedure TMsgWndOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
var
o: TEnvironmentOptions;
c: TMsgWndColor;
u: TMessageLineUrgency;
begin
o:=(AOptions as TEnvironmentOptions);
for c in TMsgWndColor do
MWColorListBox.Colors[ord(c)] := o.MsgViewColors[c];
for u in TMessageLineUrgency do
MsgColorListBox.Colors[ord(u)] := o.MsgColors[u];
MWShowIconsCheckBox.Checked := o.ShowMessagesIcons;
MWAlwaysDrawFocusedCheckBox.Checked := o.MsgViewAlwaysDrawFocused;
MWFocusCheckBox.Checked := o.MsgViewFocus;
@ -205,10 +287,13 @@ procedure TMsgWndOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
var
o: TEnvironmentOptions;
c: TMsgWndColor;
u: TMessageLineUrgency;
begin
o:=(AOptions as TEnvironmentOptions);
for c in TMsgWndColor do
o.MsgViewColors[c] := MWColorListBox.Colors[ord(c)];
for u in TMessageLineUrgency do
o.MsgColors[u] := MsgColorListBox.Colors[ord(u)];
o.ShowMessagesIcons := MWShowIconsCheckBox.Checked;
o.MsgViewAlwaysDrawFocused := MWAlwaysDrawFocusedCheckBox.Checked;
o.MsgViewFocus := MWFocusCheckBox.Checked;

View File

@ -1756,11 +1756,27 @@ resourcestring
dlgUseSchemeLocal = 'Use local scheme settings';
dlgColor = 'Color';
dlgColors = 'Colors';
lisHeaderColors = 'Header colors';
lisMsgColors = 'Message colors:';
lisSetAllColors = 'Set all colors:';
lisLazarusDefault = 'Lazarus Default';
dlgColorNotModified = 'Not modified';
dlgPriorities = 'Priorities';
dlgMsgWinColorUrgentNone = 'Normal';
dlgMsgWinColorUrgentProgress = 'time and statistics';
dlgMsgWinColorUrgentDebug = 'Debug';
dlgMsgWinColorUrgentVerbose3 = 'Verbose 3';
dlgMsgWinColorUrgentVerbose2 = 'Verbose 2';
dlgMsgWinColorUrgentVerbose = 'Verbose';
dlgMsgWinColorUrgentHint = 'Hint';
dlgMsgWinColorUrgentNote = 'Note';
dlgMsgWinColorUrgentWarning = 'Warning';
dlgMsgWinColorUrgentImportant = 'Important';
dlgMsgWinColorUrgentError = 'Error';
dlgMsgWinColorUrgentFatal = 'Fatal';
dlgMsgWinColorUrgentPanic = 'Panic';
dlgForecolor = 'Foreground';
dlgFrameColor = 'Text-mark';
dlgUnsavedLineColor = 'Unsaved line';