mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 11:59:13 +02:00
IDE: messages options: started button to set color to editor
git-svn-id: trunk@45337 -
This commit is contained in:
parent
f7c3dcd538
commit
7c5607770a
@ -156,7 +156,7 @@ type
|
|||||||
procedure OnSpecialLineMarkup(Sender: TObject; Line: Integer;
|
procedure OnSpecialLineMarkup(Sender: TObject; Line: Integer;
|
||||||
var Special: boolean; aMarkup: TSynSelectedColor);
|
var Special: boolean; aMarkup: TSynSelectedColor);
|
||||||
|
|
||||||
function GeneralPage: TEditorGeneralOptionsFrame; inline;
|
function GeneralPage: TEditorGeneralOptionsFrame;
|
||||||
function DoSynEditMouse(var AnInfo: TSynEditMouseActionInfo;
|
function DoSynEditMouse(var AnInfo: TSynEditMouseActionInfo;
|
||||||
HandleActionProc: TSynEditMouseActionHandler): Boolean;
|
HandleActionProc: TSynEditMouseActionHandler): Boolean;
|
||||||
procedure LanguageMenuItemClick(Sender: TObject);
|
procedure LanguageMenuItemClick(Sender: TObject);
|
||||||
@ -1260,7 +1260,7 @@ begin
|
|||||||
ColorElementTree.Invalidate;
|
ColorElementTree.Invalidate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TEditorColorOptionsFrame.GeneralPage: TEditorGeneralOptionsFrame; inline;
|
function TEditorColorOptionsFrame.GeneralPage: TEditorGeneralOptionsFrame;
|
||||||
begin
|
begin
|
||||||
Result := TEditorGeneralOptionsFrame(FDialog.FindEditor(TEditorGeneralOptionsFrame));
|
Result := TEditorGeneralOptionsFrame(FDialog.FindEditor(TEditorGeneralOptionsFrame));
|
||||||
end;
|
end;
|
||||||
|
@ -25,12 +25,12 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
|
|||||||
object MWColorListBox: TColorListBox
|
object MWColorListBox: TColorListBox
|
||||||
AnchorSideLeft.Control = MWColorsGroupBox
|
AnchorSideLeft.Control = MWColorsGroupBox
|
||||||
AnchorSideTop.Control = MWColorsGroupBox
|
AnchorSideTop.Control = MWColorsGroupBox
|
||||||
AnchorSideRight.Control = MWSetDefaultColorsButton
|
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
|
||||||
AnchorSideBottom.Control = MWColorBox
|
AnchorSideBottom.Control = MWColorBox
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 108
|
Height = 108
|
||||||
Top = 6
|
Top = 6
|
||||||
Width = 307
|
Width = 303
|
||||||
Style = [cbCustomColors]
|
Style = [cbCustomColors]
|
||||||
OnGetColors = MWColorListBoxGetColors
|
OnGetColors = MWColorListBoxGetColors
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
@ -42,47 +42,56 @@ object MsgWndOptionsFrame: TMsgWndOptionsFrame
|
|||||||
end
|
end
|
||||||
object MWColorBox: TColorBox
|
object MWColorBox: TColorBox
|
||||||
AnchorSideLeft.Control = MWColorsGroupBox
|
AnchorSideLeft.Control = MWColorsGroupBox
|
||||||
AnchorSideRight.Control = MWColorsGroupBox
|
AnchorSideRight.Control = MWSpeedSetColorsGroupBox
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
AnchorSideBottom.Control = MWColorsGroupBox
|
AnchorSideBottom.Control = MWColorsGroupBox
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 29
|
Height = 29
|
||||||
Top = 120
|
Top = 120
|
||||||
Width = 479
|
Width = 303
|
||||||
Anchors = [akLeft, akRight, akBottom]
|
Anchors = [akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Around = 6
|
BorderSpacing.Around = 6
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
OnChange = MWColorBoxChange
|
OnChange = MWColorBoxChange
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
object MWSetDefaultColorsButton: TButton
|
object MWSpeedSetColorsGroupBox: TGroupBox
|
||||||
AnchorSideTop.Control = MWSetAllColorsToLabel
|
Left = 315
|
||||||
AnchorSideTop.Side = asrBottom
|
Height = 143
|
||||||
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
|
Top = 6
|
||||||
Width = 129
|
Width = 170
|
||||||
Caption = 'MWSetAllColorsToLabel'
|
Align = alRight
|
||||||
ParentColor = False
|
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
|
||||||
end
|
end
|
||||||
object MWOptionsLabel: TLabel
|
object MWOptionsLabel: TLabel
|
||||||
|
@ -30,9 +30,9 @@ unit MsgWnd_Options;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, LazLoggerBase, IDEOptionsIntf, Forms, Controls,
|
Classes, SysUtils, FileUtil, LazLoggerBase, IDEOptionsIntf, SynEdit, Forms,
|
||||||
Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls, LazarusIDEStrConsts,
|
Controls, Graphics, Dialogs, StdCtrls, ColorBox, ExtCtrls,
|
||||||
EnvironmentOpts;
|
LazarusIDEStrConsts, EnvironmentOpts, editor_general_options, EditorOptions;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -48,15 +48,19 @@ type
|
|||||||
MWColorsGroupBox: TGroupBox;
|
MWColorsGroupBox: TGroupBox;
|
||||||
MWOptionsLabel: TLabel;
|
MWOptionsLabel: TLabel;
|
||||||
MWOptsRightBevel: TBevel;
|
MWOptsRightBevel: TBevel;
|
||||||
MWSetAllColorsToLabel: TLabel;
|
|
||||||
MWSetDefaultColorsButton: TButton;
|
MWSetDefaultColorsButton: TButton;
|
||||||
|
MWSetEditorColorsButton: TButton;
|
||||||
|
MWSpeedSetColorsGroupBox: TGroupBox;
|
||||||
procedure MWColorBoxChange(Sender: TObject);
|
procedure MWColorBoxChange(Sender: TObject);
|
||||||
procedure MWColorListBoxGetColors(Sender: TCustomColorListBox;
|
procedure MWColorListBoxGetColors(Sender: TCustomColorListBox;
|
||||||
Items: TStrings);
|
Items: TStrings);
|
||||||
procedure MWColorListBoxSelectionChange(Sender: TObject; User: boolean);
|
procedure MWColorListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||||
procedure MWSetDefaultColorsButtonClick(Sender: TObject);
|
procedure MWSetDefaultColorsButtonClick(Sender: TObject);
|
||||||
|
procedure MWSetEditorColorsButtonClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
fReady: boolean;
|
fReady: boolean;
|
||||||
|
FDialog: TAbstractOptionsEditorDialog;
|
||||||
|
function GeneralPage: TEditorGeneralOptionsFrame;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
function GetTitle: String; override;
|
function GetTitle: String; override;
|
||||||
@ -112,14 +116,38 @@ begin
|
|||||||
MWColorBox.Selected := MWColorListBox.Selected;
|
MWColorBox.Selected := MWColorListBox.Selected;
|
||||||
end;
|
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);
|
constructor TMsgWndOptionsFrame.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
|
||||||
MWOptionsLabel.Caption:=dlgOIOptions;
|
MWOptionsLabel.Caption:=dlgOIOptions;
|
||||||
MWColorsGroupBox.Caption:=dlgColors;
|
MWColorsGroupBox.Caption:=dlgColors;
|
||||||
MWSetAllColorsToLabel.Caption:=lisSetAllColors;
|
MWSpeedSetColorsGroupBox.Caption:=lisSetAllColors;
|
||||||
MWSetDefaultColorsButton.Caption:=lisLazarusDefault;
|
MWSetDefaultColorsButton.Caption:=lisLazarusDefault;
|
||||||
|
MWSetEditorColorsButton.Caption:=lisEditorColors;
|
||||||
MWHideIconsCheckBox.Caption := dlgHideMessagesIcons;
|
MWHideIconsCheckBox.Caption := dlgHideMessagesIcons;
|
||||||
MWDblClickJumpsCheckBox.Caption:=lisEnvJumpFromMessageToSrcOnDblClickOtherwiseSingleClick;
|
MWDblClickJumpsCheckBox.Caption:=lisEnvJumpFromMessageToSrcOnDblClickOtherwiseSingleClick;
|
||||||
MWFocusCheckBox.Caption:=dlgEOFocusMessagesAfterCompilation;
|
MWFocusCheckBox.Caption:=dlgEOFocusMessagesAfterCompilation;
|
||||||
@ -133,6 +161,8 @@ end;
|
|||||||
procedure TMsgWndOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
procedure TMsgWndOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||||
begin
|
begin
|
||||||
fReady:=false;
|
fReady:=false;
|
||||||
|
FDialog := ADialog;
|
||||||
|
MWSetEditorColorsButton.Visible:=false;
|
||||||
{$IFDEF EnableNewExtTools}
|
{$IFDEF EnableNewExtTools}
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
MWColorsGroupBox.Visible:=false;
|
MWColorsGroupBox.Visible:=false;
|
||||||
|
@ -1177,6 +1177,7 @@ resourcestring
|
|||||||
+' Linux Window Managers like Cinnamon do not support this and always show'
|
+' Linux Window Managers like Cinnamon do not support this and always show'
|
||||||
+' one button per window.';
|
+' one button per window.';
|
||||||
dlgHideMessagesIcons = 'Hide Messages Icons';
|
dlgHideMessagesIcons = 'Hide Messages Icons';
|
||||||
|
lisEditorColors = 'Editor Colors';
|
||||||
lisIDETitleStartsWithProjectName = 'IDE title starts with project name';
|
lisIDETitleStartsWithProjectName = 'IDE title starts with project name';
|
||||||
lisIDETitleShowsProjectDir = 'IDE title shows project directory';
|
lisIDETitleShowsProjectDir = 'IDE title shows project directory';
|
||||||
lisIDETitleShowsBuildMode = 'IDE title shows selected build mode';
|
lisIDETitleShowsBuildMode = 'IDE title shows selected build mode';
|
||||||
|
Loading…
Reference in New Issue
Block a user