IDE: messages options: started button to set color to editor

git-svn-id: trunk@45337 -
This commit is contained in:
mattias 2014-06-04 16:28:42 +00:00
parent f7c3dcd538
commit 7c5607770a
4 changed files with 78 additions and 38 deletions

View File

@ -156,7 +156,7 @@ type
procedure OnSpecialLineMarkup(Sender: TObject; Line: Integer;
var Special: boolean; aMarkup: TSynSelectedColor);
function GeneralPage: TEditorGeneralOptionsFrame; inline;
function GeneralPage: TEditorGeneralOptionsFrame;
function DoSynEditMouse(var AnInfo: TSynEditMouseActionInfo;
HandleActionProc: TSynEditMouseActionHandler): Boolean;
procedure LanguageMenuItemClick(Sender: TObject);
@ -1260,7 +1260,7 @@ begin
ColorElementTree.Invalidate;
end;
function TEditorColorOptionsFrame.GeneralPage: TEditorGeneralOptionsFrame; inline;
function TEditorColorOptionsFrame.GeneralPage: TEditorGeneralOptionsFrame;
begin
Result := TEditorGeneralOptionsFrame(FDialog.FindEditor(TEditorGeneralOptionsFrame));
end;

View File

@ -25,12 +25,12 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
object MWColorListBox: TColorListBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideTop.Control = MWColorsGroupBox
AnchorSideRight.Control = MWSetDefaultColorsButton
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorBox
Left = 6
Height = 108
Top = 6
Width = 307
Width = 303
Style = [cbCustomColors]
OnGetColors = MWColorListBoxGetColors
Anchors = [akTop, akLeft, akRight, akBottom]
@ -42,47 +42,56 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
end
object MWColorBox: TColorBox
AnchorSideLeft.Control = MWColorsGroupBox
AnchorSideRight.Control = MWColorsGroupBox
AnchorSideRight.Side = asrBottom
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
AnchorSideBottom.Control = MWColorsGroupBox
AnchorSideBottom.Side = asrBottom
Left = 6
Height = 29
Top = 120
Width = 479
Width = 303
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
object MWSpeedSetColorsGroupBox: TGroupBox
Left = 315
Height = 143
Top = 6
Width = 129
Caption = 'MWSetAllColorsToLabel'
ParentColor = False
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
end
end
object MWOptionsLabel: TLabel

View File

@ -30,9 +30,9 @@ unit MsgWnd_Options;
interface
uses
Classes, SysUtils, FileUtil, LazLoggerBase, IDEOptionsIntf, Forms, Controls,
Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls, LazarusIDEStrConsts,
EnvironmentOpts;
Classes, SysUtils, FileUtil, LazLoggerBase, IDEOptionsIntf, SynEdit, Forms,
Controls, Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls,
LazarusIDEStrConsts, EnvironmentOpts, editor_general_options, EditorOptions;
type
@ -48,15 +48,19 @@ type
MWColorsGroupBox: TGroupBox;
MWOptionsLabel: TLabel;
MWOptsRightBevel: TBevel;
MWSetAllColorsToLabel: TLabel;
MWSetDefaultColorsButton: TButton;
MWSetEditorColorsButton: TButton;
MWSpeedSetColorsGroupBox: TGroupBox;
procedure MWColorBoxChange(Sender: TObject);
procedure MWColorListBoxGetColors(Sender: TCustomColorListBox;
Items: TStrings);
procedure MWColorListBoxSelectionChange(Sender: TObject; User: boolean);
procedure MWSetDefaultColorsButtonClick(Sender: TObject);
procedure MWSetEditorColorsButtonClick(Sender: TObject);
private
fReady: boolean;
FDialog: TAbstractOptionsEditorDialog;
function GeneralPage: TEditorGeneralOptionsFrame;
public
constructor Create(AOwner: TComponent); override;
function GetTitle: String; override;
@ -112,14 +116,38 @@ begin
MWColorBox.Selected := MWColorListBox.Selected;
end;
procedure TMsgWndOptionsFrame.MWSetEditorColorsButtonClick(Sender: TObject);
var
Page: TEditorGeneralOptionsFrame;
begin
Page:=GeneralPage;
if Page=nil then exit;
{MWColorListBox.Colors[mwBackground]:=aSynEdit.Color;
MWColorListBox.Colors[mwRunning]:=aSynEdit.
MWColorListBox.Colors[mwSuccess]:=aSynEdit.
MWColorListBox.Colors[mwFailed]:=aSynEdit.
MWColorListBox.Colors[mwAutoHeader]:=aSynEdit.}
MWColorBox.Selected := MWColorListBox.Selected;
end;
function TMsgWndOptionsFrame.GeneralPage: TEditorGeneralOptionsFrame;
begin
Result:=nil;
if FDialog<>nil then
Result := TEditorGeneralOptionsFrame(FDialog.FindEditor(TEditorGeneralOptionsFrame));
end;
constructor TMsgWndOptionsFrame.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
MWOptionsLabel.Caption:=dlgOIOptions;
MWColorsGroupBox.Caption:=dlgColors;
MWSetAllColorsToLabel.Caption:=lisSetAllColors;
MWSpeedSetColorsGroupBox.Caption:=lisSetAllColors;
MWSetDefaultColorsButton.Caption:=lisLazarusDefault;
MWSetEditorColorsButton.Caption:=lisEditorColors;
MWHideIconsCheckBox.Caption := dlgHideMessagesIcons;
MWDblClickJumpsCheckBox.Caption:=lisEnvJumpFromMessageToSrcOnDblClickOtherwiseSingleClick;
MWFocusCheckBox.Caption:=dlgEOFocusMessagesAfterCompilation;
@ -133,6 +161,8 @@ end;
procedure TMsgWndOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
fReady:=false;
FDialog := ADialog;
MWSetEditorColorsButton.Visible:=false;
{$IFDEF EnableNewExtTools}
{$ELSE}
MWColorsGroupBox.Visible:=false;

View File

@ -1177,6 +1177,7 @@ resourcestring
+' Linux Window Managers like Cinnamon do not support this and always show'
+' one button per window.';
dlgHideMessagesIcons = 'Hide Messages Icons';
lisEditorColors = 'Editor Colors';
lisIDETitleStartsWithProjectName = 'IDE title starts with project name';
lisIDETitleShowsProjectDir = 'IDE title shows project directory';
lisIDETitleShowsBuildMode = 'IDE title shows selected build mode';