mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: categories Editor,FindFiles in HotKeys
ADD: FunctionButtons panel now can be zoomed on Ctrl+Wheel ADD: Dbl click in Options-HotKeys at unassigned hotkey show Add hotkey form
This commit is contained in:
parent
44f66b03f9
commit
b10f3e0a50
13 changed files with 612 additions and 251 deletions
|
|
@ -1,7 +1,7 @@
|
|||
object frmFindDlg: TfrmFindDlg
|
||||
Left = 413
|
||||
Left = 275
|
||||
Height = 397
|
||||
Top = 226
|
||||
Top = 176
|
||||
Width = 839
|
||||
Caption = 'Find files'
|
||||
ClientHeight = 397
|
||||
|
|
@ -18,7 +18,7 @@ object frmFindDlg: TfrmFindDlg
|
|||
Position = poScreenCenter
|
||||
SessionProperties = 'Height;Left;Top;Width;WindowState'
|
||||
ShowInTaskBar = stAlways
|
||||
LCLVersion = '1.4.4.0'
|
||||
LCLVersion = '1.7'
|
||||
object pnlFindFile: TPanel
|
||||
Left = 3
|
||||
Height = 391
|
||||
|
|
@ -46,6 +46,7 @@ object frmFindDlg: TfrmFindDlg
|
|||
ChildSizing.TopBottomSpacing = 3
|
||||
ClientHeight = 363
|
||||
ClientWidth = 716
|
||||
OnEnter = tsStandardEnter
|
||||
object gbDirectories: TGroupBox
|
||||
AnchorSideLeft.Control = tsStandard
|
||||
AnchorSideTop.Control = tsStandard
|
||||
|
|
@ -1385,4 +1386,58 @@ object frmFindDlg: TfrmFindDlg
|
|||
OnClick = miShowAllFoundClick
|
||||
end
|
||||
end
|
||||
object actList: TActionList
|
||||
left = 424
|
||||
object actIntelliFocus: TAction
|
||||
Caption = 'actIntelliFocus'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actStart: TAction
|
||||
Caption = 'actStart'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actCancel: TAction
|
||||
Caption = 'actCancel'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actClose: TAction
|
||||
Caption = 'actClose'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actNewSearch: TAction
|
||||
Caption = 'actNewSearch'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actLastSearch: TAction
|
||||
Caption = 'actLastSearch'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actView: TAction
|
||||
Caption = 'actView'
|
||||
end
|
||||
object actEdit: TAction
|
||||
Caption = 'actEdit'
|
||||
end
|
||||
object actGoToFile: TAction
|
||||
Caption = 'actGoToFile'
|
||||
end
|
||||
object actFeedToListbox: TAction
|
||||
Caption = 'actFeedToListbox'
|
||||
end
|
||||
object actPageStandard: TAction
|
||||
Caption = 'actPageStandard'
|
||||
end
|
||||
object actPageAdvanced: TAction
|
||||
Caption = 'actPageAdvanced'
|
||||
end
|
||||
object actPagePlugins: TAction
|
||||
Caption = 'actPagePlugins'
|
||||
end
|
||||
object actPageLoadSave: TAction
|
||||
Caption = 'actPageLoadSave'
|
||||
end
|
||||
object actPageResults: TAction
|
||||
Caption = 'actPageResults'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -60,3 +60,18 @@ TFRMFINDDLG.MISHOWINVIEWER.CAPTION=Show In Viewer
|
|||
TFRMFINDDLG.MISHOWINEDITOR.CAPTION=Show In Editor
|
||||
TFRMFINDDLG.MIREMOVEFROMLLIST.CAPTION=Remove from list
|
||||
TFRMFINDDLG.MISHOWALLFOUND.CAPTION=Show all found items
|
||||
TFRMFINDDLG.ACTINTELLIFOCUS.CAPTION=actIntelliFocus
|
||||
TFRMFINDDLG.ACTSTART.CAPTION=actStart
|
||||
TFRMFINDDLG.ACTCANCEL.CAPTION=actCancel
|
||||
TFRMFINDDLG.ACTCLOSE.CAPTION=actClose
|
||||
TFRMFINDDLG.ACTNEWSEARCH.CAPTION=actNewSearch
|
||||
TFRMFINDDLG.ACTLASTSEARCH.CAPTION=actLastSearch
|
||||
TFRMFINDDLG.ACTVIEW.CAPTION=actView
|
||||
TFRMFINDDLG.ACTEDIT.CAPTION=actEdit
|
||||
TFRMFINDDLG.ACTGOTOFILE.CAPTION=actGoToFile
|
||||
TFRMFINDDLG.ACTFEEDTOLISTBOX.CAPTION=actFeedToListbox
|
||||
TFRMFINDDLG.ACTPAGESTANDARD.CAPTION=actPageStandard
|
||||
TFRMFINDDLG.ACTPAGEADVANCED.CAPTION=actPageAdvanced
|
||||
TFRMFINDDLG.ACTPAGEPLUGINS.CAPTION=actPagePlugins
|
||||
TFRMFINDDLG.ACTPAGELOADSAVE.CAPTION=actPageLoadSave
|
||||
TFRMFINDDLG.ACTPAGERESULTS.CAPTION=actPageResults
|
||||
|
|
|
|||
189
src/fFindDlg.pas
189
src/fFindDlg.pas
|
|
@ -33,14 +33,35 @@ uses
|
|||
Graphics, SysUtils, Classes, Controls, Forms, Dialogs, StdCtrls, ComCtrls,
|
||||
ExtCtrls, Menus, EditBtn, Spin, Buttons, ZVDateTimePicker, KASComboBox,
|
||||
fAttributesEdit, uDsxModule, DsxPlugin, uFindThread, uFindFiles,
|
||||
uSearchTemplate, fSearchPlugin, uFileView, types, DCStrUtils,ShellCtrls,
|
||||
uOSForms,uShellContextMenu,uExceptions,uFileSystemFileSource;
|
||||
uSearchTemplate, fSearchPlugin, uFileView, types, DCStrUtils, ShellCtrls,
|
||||
ActnList, uOSForms, uShellContextMenu, uExceptions, uFileSystemFileSource,
|
||||
uFormCommands, uHotkeyManager;
|
||||
|
||||
const
|
||||
HotkeysCategory = 'Find files';
|
||||
|
||||
|
||||
type
|
||||
|
||||
{ TfrmFindDlg }
|
||||
|
||||
TfrmFindDlg = class(TForm)
|
||||
TfrmFindDlg = class(TForm,IFormCommands)
|
||||
actIntelliFocus: TAction;
|
||||
actCancel: TAction;
|
||||
actClose: TAction;
|
||||
actEdit: TAction;
|
||||
actGoToFile: TAction;
|
||||
actFeedToListbox: TAction;
|
||||
actPageResults: TAction;
|
||||
actPageLoadSave: TAction;
|
||||
actPagePlugins: TAction;
|
||||
actPageAdvanced: TAction;
|
||||
actPageStandard: TAction;
|
||||
actView: TAction;
|
||||
actLastSearch: TAction;
|
||||
actNewSearch: TAction;
|
||||
actStart: TAction;
|
||||
actList: TActionList;
|
||||
Bevel2: TBevel;
|
||||
btnAddAttribute: TButton;
|
||||
btnAttrsHelp: TButton;
|
||||
|
|
@ -137,6 +158,7 @@ type
|
|||
ZVTimeFrom: TZVDateTimePicker;
|
||||
ZVTimeTo: TZVDateTimePicker;
|
||||
|
||||
procedure actExecute(Sender: TObject);
|
||||
procedure btnAddAttributeClick(Sender: TObject);
|
||||
procedure btnAttrsHelpClick(Sender: TObject);
|
||||
procedure btnEditClick(Sender: TObject);
|
||||
|
|
@ -221,6 +243,9 @@ type
|
|||
|
||||
|
||||
FRButtonPanelSender:TObject; // last focused button on Right Panel (pnlButtons)
|
||||
FCommands: TFormCommands;
|
||||
|
||||
property Commands: TFormCommands read FCommands implements IFormCommands;
|
||||
|
||||
procedure DisableControlsForTemplate;
|
||||
procedure StopSearch;
|
||||
|
|
@ -252,6 +277,27 @@ type
|
|||
procedure ThreadTerminate(Sender:TObject);
|
||||
|
||||
procedure FocusOnResults(Sender:TObject); // if press VK_LEFT or VK_RIGHT when on any button on left panel - focus on results and remember button in FRButtonPanelSender
|
||||
|
||||
published
|
||||
procedure cm_IntelliFocus(const Params: array of string);
|
||||
procedure cm_Start(const Params: array of string);
|
||||
procedure cm_CancelClose(const Params: array of string);
|
||||
procedure cm_Cancel(const Params: array of string);
|
||||
procedure cm_Close(const Params: array of string);
|
||||
procedure cm_NewSearch(const Params: array of string);
|
||||
procedure cm_LastSearch(const Params: array of string);
|
||||
procedure cm_View(const Params: array of string);
|
||||
procedure cm_Edit(const Params: array of string);
|
||||
procedure cm_GoToFile(const Params: array of string);
|
||||
procedure cm_FeedToListbox(const Params: array of string);
|
||||
|
||||
procedure cm_PageStandard(const Params: array of string);
|
||||
procedure cm_PageAdvanced(const Params: array of string);
|
||||
procedure cm_PagePlugins(const Params: array of string);
|
||||
procedure cm_PageLoadSave(const Params: array of string);
|
||||
procedure cm_PageResults(const Params: array of string);
|
||||
|
||||
|
||||
end;
|
||||
|
||||
var
|
||||
|
|
@ -458,6 +504,7 @@ end;
|
|||
procedure TfrmFindDlg.FormCreate(Sender: TObject);
|
||||
var
|
||||
I: Integer;
|
||||
HMFindFiles: THMForm;
|
||||
begin
|
||||
Height:= pnlFindFile.Height + 22;
|
||||
DsxPlugins := TDSXModuleList.Create;
|
||||
|
|
@ -517,6 +564,9 @@ begin
|
|||
cbPartialNameSearch.Checked:= gPartialNameSearch;
|
||||
|
||||
InitPropStorage(Self);
|
||||
|
||||
HMFindFiles := HotMan.Register(Self, HotkeysCategory);
|
||||
HMFindFiles.RegisterActionList(actList);
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cbUsePluginChange(Sender: TObject);
|
||||
|
|
@ -556,6 +606,8 @@ begin
|
|||
FUpdateTimer.Interval := 100;
|
||||
FUpdateTimer.Enabled := False;
|
||||
FUpdateTimer.OnTimer := @OnUpdateTimer;
|
||||
|
||||
FCommands := TFormCommands.Create(Self, actList);
|
||||
end;
|
||||
|
||||
destructor TfrmFindDlg.Destroy;
|
||||
|
|
@ -695,6 +747,16 @@ begin
|
|||
ShowEditorByGlob(lsFoundedFiles.Items[lsFoundedFiles.ItemIndex]);
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.actExecute(Sender: TObject);
|
||||
var
|
||||
cmd: string;
|
||||
begin
|
||||
cmd := (Sender as TAction).Name;
|
||||
cmd := 'cm_' + Copy(cmd, 4, Length(cmd) - 3);
|
||||
Commands.ExecuteCommand(cmd, []);
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmFindDlg.btnAddAttributeClick(Sender: TObject);
|
||||
begin
|
||||
if not Assigned(FFrmAttributesEdit) then
|
||||
|
|
@ -1244,6 +1306,115 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_IntelliFocus(const Params: array of string);
|
||||
begin
|
||||
if FFindThread<>nil then
|
||||
begin
|
||||
FFindThread.OnTerminate:=nil;
|
||||
FFindThread.Terminate;
|
||||
FUpdateTimer.OnTimer(FUpdateTimer);
|
||||
FUpdateTimer.Enabled := False;
|
||||
FFindThread := nil;
|
||||
end;
|
||||
|
||||
AfterSearchStopped;
|
||||
{$IF NOT (DEFINED(LCLGTK) or DEFINED(LCLGTK2))}
|
||||
btnStart.Default := True;
|
||||
{$ENDIF}
|
||||
|
||||
if cmbFindText.Focused then // if F7 on already focused textSearch field- disable text search and set focun on file mask
|
||||
begin
|
||||
cbFindText.Checked:=False;
|
||||
cmbFindFileMask.SetFocus;
|
||||
cmbFindFileMask.SelectAll;
|
||||
exit;
|
||||
end else
|
||||
begin
|
||||
pgcSearch.PageIndex:= 0;
|
||||
cbFindText.Checked:=True;
|
||||
cmbFindText.SetFocus;
|
||||
cmbFindText.SelectAll;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_Start(const Params: array of string);
|
||||
begin
|
||||
btnStart.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_CancelClose(const Params: array of string);
|
||||
begin
|
||||
if FSearchingActive then
|
||||
StopSearch
|
||||
else
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_Cancel(const Params: array of string);
|
||||
begin
|
||||
btnStop.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_Close(const Params: array of string);
|
||||
begin
|
||||
btnClose.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_NewSearch(const Params: array of string);
|
||||
begin
|
||||
btnNewSearch.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_LastSearch(const Params: array of string);
|
||||
begin
|
||||
btnLastSearch.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_View(const Params: array of string);
|
||||
begin
|
||||
btnView.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_Edit(const Params: array of string);
|
||||
begin
|
||||
btnEdit.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_GoToFile(const Params: array of string);
|
||||
begin
|
||||
btnGoToPath.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_FeedToListbox(const Params: array of string);
|
||||
begin
|
||||
btnWorkWithFound.Click;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_PageStandard(const Params: array of string);
|
||||
begin
|
||||
pgcSearch.PageIndex:=0;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_PageAdvanced(const Params: array of string);
|
||||
begin
|
||||
pgcSearch.PageIndex:=1;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_PagePlugins(const Params: array of string);
|
||||
begin
|
||||
pgcSearch.PageIndex:=2;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_PageLoadSave(const Params: array of string);
|
||||
begin
|
||||
pgcSearch.PageIndex:=3;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.cm_PageResults(const Params: array of string);
|
||||
begin
|
||||
pgcSearch.PageIndex:=4;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.btnStopClick(Sender: TObject);
|
||||
begin
|
||||
StopSearch;
|
||||
|
|
@ -1251,8 +1422,8 @@ begin
|
|||
btnNewSearch.SetFocus;
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.FormCloseQuery(Sender: TObject;
|
||||
var CanClose: Boolean);
|
||||
procedure TfrmFindDlg.FormCloseQuery(Sender: TObject;var CanClose: Boolean);
|
||||
// was on F7
|
||||
begin
|
||||
if FFindThread<>nil then // we can't call StopSearch because it method will set focus on unavailable field
|
||||
begin
|
||||
|
|
@ -1283,6 +1454,7 @@ end;
|
|||
|
||||
procedure TfrmFindDlg.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
begin
|
||||
{
|
||||
case Key of
|
||||
{$IF DEFINED(LCLGTK) or DEFINED(LCLGTK2)}
|
||||
// On LCLGTK2 default button on Enter does not work.
|
||||
|
|
@ -1357,6 +1529,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
procedure TfrmFindDlg.frmFindDlgClose(Sender: TObject;
|
||||
|
|
@ -1918,6 +2091,12 @@ begin
|
|||
SelectTemplate(FLastTemplateName);
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
TFormCommands.RegisterCommandsForm(TfrmFindDlg, HotkeysCategory, @rsHotkeyCategoryFindFiles);
|
||||
|
||||
|
||||
|
||||
finalization
|
||||
FreeAndNil(GfrmFindDlgInstance);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
object frmEditor: TfrmEditor
|
||||
Left = 255
|
||||
Left = 566
|
||||
Height = 480
|
||||
Top = 163
|
||||
Top = 271
|
||||
Width = 640
|
||||
ActiveControl = Editor
|
||||
Caption = 'Editor'
|
||||
|
|
@ -48,14 +48,11 @@ object frmEditor: TfrmEditor
|
|||
}
|
||||
KeyPreview = True
|
||||
Menu = MainMenu1
|
||||
OnClose = frmEditorClose
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnMouseWheelDown = FormMouseWheelDown
|
||||
OnMouseWheelUp = FormMouseWheelUp
|
||||
SessionProperties = 'Height;Width;WindowState;Left;Top'
|
||||
ShowInTaskBar = stAlways
|
||||
LCLVersion = '1.4.4.0'
|
||||
LCLVersion = '1.7'
|
||||
object StatusBar: TStatusBar
|
||||
Left = 0
|
||||
Height = 23
|
||||
|
|
@ -736,7 +733,9 @@ object frmEditor: TfrmEditor
|
|||
81FF818181FF818181FF818181FF818181FF818181FF818181FF818181FF7C8C
|
||||
8CFF729F9FFF6AAEAFFF36E4EDFF000000000000000000000000
|
||||
}
|
||||
OnClick = actFileNewExecute
|
||||
end
|
||||
object MenuItem1: TMenuItem
|
||||
Caption = '-'
|
||||
end
|
||||
object Open1: TMenuItem
|
||||
Action = actFileOpen
|
||||
|
|
@ -776,7 +775,6 @@ object frmEditor: TfrmEditor
|
|||
6DFF6B6F6DFF6B6F6DFF6B6F6DFF6B6F6DFF656967FF656967FF000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actFileOpenExecute
|
||||
end
|
||||
object Save1: TMenuItem
|
||||
Action = actFileSave
|
||||
|
|
@ -816,7 +814,6 @@ object frmEditor: TfrmEditor
|
|||
0000000000008B6738FF8B6738FF8B6738FF8A693DFF80714AFF7A7858FF0000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actFileSaveExecute
|
||||
end
|
||||
object SaveAs1: TMenuItem
|
||||
Action = actFileSaveAs
|
||||
|
|
@ -857,7 +854,6 @@ object frmEditor: TfrmEditor
|
|||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
ImageIndex = 8
|
||||
OnClick = actFileSaveAsExecute
|
||||
end
|
||||
object miDiv: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -900,7 +896,6 @@ object frmEditor: TfrmEditor
|
|||
99FF818181FF818181FF818181FF818181FF818181FF818181FF818181FF8181
|
||||
81FF818181FF818181FF818181FF818181FF0000000000000000
|
||||
}
|
||||
OnClick = actConfHighExecute
|
||||
end
|
||||
object N1: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -943,7 +938,6 @@ object frmEditor: TfrmEditor
|
|||
55FF535755FF535755FF535755FF535755FF535755FF535755FF545856FF5A5E
|
||||
5CFF626564FF666968FF676A68FF636765FF6B6E6DFF00000000
|
||||
}
|
||||
OnClick = actFileExitExecute
|
||||
end
|
||||
end
|
||||
object miEdit: TMenuItem
|
||||
|
|
@ -986,7 +980,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000000000000000000000A0C4FF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditUndoExecute
|
||||
end
|
||||
object miRedo: TMenuItem
|
||||
Action = actEditRedo
|
||||
|
|
@ -1026,7 +1019,6 @@ object frmEditor: TfrmEditor
|
|||
000000000000000000000000000000000000000000000000000000000000069A
|
||||
4EFF000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditRedoExecute
|
||||
end
|
||||
object N3: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -1069,7 +1061,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000888D8BFF909593FF0000000000000000000000000000
|
||||
0000888D8BFF8C918FFF00000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditCutExecute
|
||||
end
|
||||
object miCopy: TMenuItem
|
||||
Action = actEditCopy
|
||||
|
|
@ -1109,7 +1100,6 @@ object frmEditor: TfrmEditor
|
|||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditCopyExecute
|
||||
end
|
||||
object miPaste: TMenuItem
|
||||
Action = actEditPaste
|
||||
|
|
@ -1149,7 +1139,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000000000005E5F5FFF5C5C5CFF5C5C5CFF5C5C5CFF5C5C
|
||||
5CFF5E5F5FFF0000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditPasteExecute
|
||||
end
|
||||
object miDelete: TMenuItem
|
||||
Action = actEditDelete
|
||||
|
|
@ -1189,7 +1178,6 @@ object frmEditor: TfrmEditor
|
|||
00008F9391FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
|
||||
88FF858A88FF858A88FF858A88FF8F9391FF0000000000000000
|
||||
}
|
||||
OnClick = actEditDeleteExecute
|
||||
end
|
||||
object miSelectAll: TMenuItem
|
||||
Action = actEditSelectAll
|
||||
|
|
@ -1229,7 +1217,6 @@ object frmEditor: TfrmEditor
|
|||
8BFF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF898E8CFF00000000
|
||||
}
|
||||
OnClick = actEditSelectAllExecute
|
||||
end
|
||||
object N4: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -1272,11 +1259,9 @@ object frmEditor: TfrmEditor
|
|||
88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
|
||||
88FF858A88FF8A8F8DFF00000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditFindExecute
|
||||
end
|
||||
object miFindNext: TMenuItem
|
||||
Action = actEditFindNext
|
||||
OnClick = actEditFindNextExecute
|
||||
end
|
||||
object miReplace: TMenuItem
|
||||
Action = actEditRplc
|
||||
|
|
@ -1316,7 +1301,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000808381FF808381FF808381FF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditRplcExecute
|
||||
end
|
||||
object miGotoLine: TMenuItem
|
||||
Action = actEditGotoLine
|
||||
|
|
@ -1381,9 +1365,11 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'En&coding'
|
||||
object miEncodingIn: TMenuItem
|
||||
Caption = 'Open as'
|
||||
OnClick = actExecute
|
||||
end
|
||||
object miEncodingOut: TMenuItem
|
||||
Caption = 'Save as'
|
||||
OnClick = actExecute
|
||||
end
|
||||
end
|
||||
object miHighlight: TMenuItem
|
||||
|
|
@ -1429,13 +1415,12 @@ object frmEditor: TfrmEditor
|
|||
0000000000000000000000000000874A20FF874A20FF874A20FF874A20FF874A
|
||||
20FF874A20FF0000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actAboutExecute
|
||||
end
|
||||
end
|
||||
end
|
||||
object ActListEdit: TActionList
|
||||
Images = ilImageList
|
||||
left = 96
|
||||
left = 112
|
||||
top = 32
|
||||
object actAbout: TAction
|
||||
Category = 'Help'
|
||||
|
|
@ -1443,7 +1428,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'About'
|
||||
ImageIndex = 13
|
||||
OnExecute = actAboutExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actFileOpen: TAction
|
||||
Category = 'File'
|
||||
|
|
@ -1451,7 +1436,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Open'
|
||||
ImageIndex = 1
|
||||
OnExecute = actFileOpenExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16463
|
||||
end
|
||||
object actFileClose: TAction
|
||||
|
|
@ -1459,6 +1444,7 @@ object frmEditor: TfrmEditor
|
|||
Caption = '&Close'
|
||||
HelpType = htKeyword
|
||||
Hint = 'Close'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actFileSave: TAction
|
||||
Category = 'File'
|
||||
|
|
@ -1466,7 +1452,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Save'
|
||||
ImageIndex = 2
|
||||
OnExecute = actFileSaveExecute
|
||||
OnExecute = actExecute
|
||||
SecondaryShortCuts.Strings = (
|
||||
'Ctrl+S'
|
||||
)
|
||||
|
|
@ -1478,7 +1464,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Save As'
|
||||
ImageIndex = 3
|
||||
OnExecute = actFileSaveAsExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actFileNew: TAction
|
||||
Category = 'File'
|
||||
|
|
@ -1486,7 +1472,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'New'
|
||||
ImageIndex = 0
|
||||
OnExecute = actFileNewExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16462
|
||||
end
|
||||
object actFileExit: TAction
|
||||
|
|
@ -1495,7 +1481,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Exit'
|
||||
ImageIndex = 12
|
||||
OnExecute = actFileExitExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 32856
|
||||
end
|
||||
object actSaveAll: TAction
|
||||
|
|
@ -1503,15 +1489,16 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'Sa&ve All'
|
||||
HelpType = htKeyword
|
||||
Hint = 'Save All'
|
||||
OnExecute = actExecute
|
||||
ShortCut = 24659
|
||||
end
|
||||
object actEditFind: TAction
|
||||
Category = 'Edit'
|
||||
Caption = '&Find'
|
||||
Caption = '&Find '
|
||||
HelpType = htKeyword
|
||||
Hint = 'Find'
|
||||
ImageIndex = 10
|
||||
OnExecute = actEditFindExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16454
|
||||
end
|
||||
object actEditRplc: TAction
|
||||
|
|
@ -1520,7 +1507,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Replace'
|
||||
ImageIndex = 11
|
||||
OnExecute = actEditRplcExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16466
|
||||
end
|
||||
object actConfHigh: TAction
|
||||
|
|
@ -1529,7 +1516,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Configuration'
|
||||
ImageIndex = 4
|
||||
OnExecute = actConfHighExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actEditCut: TAction
|
||||
Category = 'Edit'
|
||||
|
|
@ -1537,7 +1524,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Cut'
|
||||
ImageIndex = 5
|
||||
OnExecute = actEditCutExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16472
|
||||
end
|
||||
object actEditCopy: TAction
|
||||
|
|
@ -1546,7 +1533,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Copy'
|
||||
ImageIndex = 6
|
||||
OnExecute = actEditCopyExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16451
|
||||
end
|
||||
object actEditPaste: TAction
|
||||
|
|
@ -1555,7 +1542,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Paste'
|
||||
ImageIndex = 7
|
||||
OnExecute = actEditPasteExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16470
|
||||
end
|
||||
object actEditUndo: TAction
|
||||
|
|
@ -1564,7 +1551,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Undo'
|
||||
ImageIndex = 8
|
||||
OnExecute = actEditUndoExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16474
|
||||
end
|
||||
object actEditRedo: TAction
|
||||
|
|
@ -1573,7 +1560,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Redo'
|
||||
ImageIndex = 9
|
||||
OnExecute = actEditRedoExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 24666
|
||||
end
|
||||
object actEditSelectAll: TAction
|
||||
|
|
@ -1582,7 +1569,7 @@ object frmEditor: TfrmEditor
|
|||
HelpType = htKeyword
|
||||
Hint = 'Select All'
|
||||
ImageIndex = 15
|
||||
OnExecute = actEditSelectAllExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16449
|
||||
end
|
||||
object actEditDelete: TAction
|
||||
|
|
@ -1590,14 +1577,14 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'Delete'
|
||||
Hint = 'Delete'
|
||||
ImageIndex = 14
|
||||
OnExecute = actEditDeleteExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 46
|
||||
end
|
||||
object actEditFindNext: TAction
|
||||
Category = 'Edit'
|
||||
Caption = 'Find next'
|
||||
Hint = 'Find next'
|
||||
OnExecute = actEditFindNextExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 114
|
||||
end
|
||||
object actEditLineEndCr: TAction
|
||||
|
|
@ -1606,7 +1593,7 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'Mac (CR)'
|
||||
GroupIndex = 1
|
||||
Hint = 'Mac (CR)'
|
||||
OnExecute = actEditLineEndCrExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actEditLineEndLf: TAction
|
||||
Category = 'Edit'
|
||||
|
|
@ -1614,7 +1601,7 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'Unix (LF)'
|
||||
GroupIndex = 1
|
||||
Hint = 'Unix (LF)'
|
||||
OnExecute = actEditLineEndLfExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actEditLineEndCrLf: TAction
|
||||
Category = 'Edit'
|
||||
|
|
@ -1622,18 +1609,18 @@ object frmEditor: TfrmEditor
|
|||
Caption = 'Windows (CRLF)'
|
||||
GroupIndex = 1
|
||||
Hint = 'Windows (CRLF)'
|
||||
OnExecute = actEditLineEndCrLfExecute
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actEditGotoLine: TAction
|
||||
Category = 'Edit'
|
||||
Caption = 'Goto Line...'
|
||||
OnExecute = actEditGotoLineExecute
|
||||
OnExecute = actExecute
|
||||
ShortCut = 16455
|
||||
end
|
||||
end
|
||||
object pmContextMenu: TPopupMenu
|
||||
Images = ilImageList
|
||||
left = 144
|
||||
left = 208
|
||||
top = 32
|
||||
object miUndoContext: TMenuItem
|
||||
Action = actEditUndo
|
||||
|
|
@ -1673,7 +1660,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000000000000000000000A0C4FF00000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditUndoExecute
|
||||
end
|
||||
object miSeparator1: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -1716,7 +1702,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000888D8BFF909593FF0000000000000000000000000000
|
||||
0000888D8BFF8C918FFF00000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditCutExecute
|
||||
end
|
||||
object miCopyContext: TMenuItem
|
||||
Action = actEditCopy
|
||||
|
|
@ -1756,7 +1741,6 @@ object frmEditor: TfrmEditor
|
|||
0000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditCopyExecute
|
||||
end
|
||||
object miPasteContext: TMenuItem
|
||||
Action = actEditPaste
|
||||
|
|
@ -1796,7 +1780,6 @@ object frmEditor: TfrmEditor
|
|||
00000000000000000000000000005E5F5FFF5C5C5CFF5C5C5CFF5C5C5CFF5C5C
|
||||
5CFF5E5F5FFF0000000000000000000000000000000000000000
|
||||
}
|
||||
OnClick = actEditPasteExecute
|
||||
end
|
||||
object miDeleteContext: TMenuItem
|
||||
Action = actEditDelete
|
||||
|
|
@ -1836,7 +1819,6 @@ object frmEditor: TfrmEditor
|
|||
00008F9391FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
|
||||
88FF858A88FF858A88FF858A88FF8F9391FF0000000000000000
|
||||
}
|
||||
OnClick = actEditDeleteExecute
|
||||
end
|
||||
object miSeparator2: TMenuItem
|
||||
Caption = '-'
|
||||
|
|
@ -1879,11 +1861,10 @@ object frmEditor: TfrmEditor
|
|||
8BFF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A88FF858A
|
||||
88FF858A88FF858A88FF858A88FF858A88FF898E8CFF00000000
|
||||
}
|
||||
OnClick = actEditSelectAllExecute
|
||||
end
|
||||
end
|
||||
object ilImageList: TImageList
|
||||
left = 192
|
||||
left = 304
|
||||
top = 32
|
||||
Bitmap = {
|
||||
4C691100000010000000100000009E9E9EFF818181FF818181FF818181FF8181
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
TFRMEDITOR.CAPTION=Editor
|
||||
TFRMEDITOR.MIFILE.CAPTION=&File
|
||||
TFRMEDITOR.MENUITEM1.CAPTION=-
|
||||
TFRMEDITOR.MIDIV.CAPTION=-
|
||||
TFRMEDITOR.N1.CAPTION=-
|
||||
TFRMEDITOR.MIEDIT.CAPTION=&Edit
|
||||
|
|
@ -28,7 +29,7 @@ TFRMEDITOR.ACTFILEEXIT.CAPTION=E&xit
|
|||
TFRMEDITOR.ACTFILEEXIT.HINT=Exit
|
||||
TFRMEDITOR.ACTSAVEALL.CAPTION=Sa&ve All
|
||||
TFRMEDITOR.ACTSAVEALL.HINT=Save All
|
||||
TFRMEDITOR.ACTEDITFIND.CAPTION=&Find
|
||||
TFRMEDITOR.ACTEDITFIND.CAPTION=&Find
|
||||
TFRMEDITOR.ACTEDITFIND.HINT=Find
|
||||
TFRMEDITOR.ACTEDITRPLC.CAPTION=&Replace
|
||||
TFRMEDITOR.ACTEDITRPLC.HINT=Replace
|
||||
|
|
|
|||
415
src/feditor.pas
415
src/feditor.pas
|
|
@ -20,13 +20,19 @@ interface
|
|||
|
||||
uses
|
||||
SysUtils, Classes, Controls, Forms, ActnList, Menus, SynEdit,
|
||||
ComCtrls, SynEditSearch, SynEditHighlighter, uDebug, uOSForms, uShowForm, types, Graphics;
|
||||
ComCtrls, SynEditSearch, SynEditHighlighter, uDebug, uOSForms, uShowForm, types, Graphics,
|
||||
uFormCommands, uHotkeyManager;
|
||||
|
||||
|
||||
const
|
||||
HotkeysCategory = 'Editor';
|
||||
|
||||
|
||||
type
|
||||
|
||||
{ TfrmEditor }
|
||||
|
||||
TfrmEditor = class(TAloneForm)
|
||||
TfrmEditor = class(TAloneForm,IFormCommands)
|
||||
actEditCut: TAction;
|
||||
actEditCopy: TAction;
|
||||
actEditSelectAll: TAction;
|
||||
|
|
@ -112,46 +118,22 @@ type
|
|||
tbSeparator3: TToolButton;
|
||||
tbConfig: TToolButton;
|
||||
tbHelp: TToolButton;
|
||||
procedure actEditFindNextExecute(Sender: TObject);
|
||||
procedure actEditGotoLineExecute(Sender: TObject);
|
||||
procedure actEditLineEndCrExecute(Sender: TObject);
|
||||
procedure actEditLineEndCrLfExecute(Sender: TObject);
|
||||
procedure actEditLineEndLfExecute(Sender: TObject);
|
||||
|
||||
procedure actExecute(Sender: TObject);
|
||||
procedure EditorMouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure EditorMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure actEditDeleteExecute(Sender: TObject);
|
||||
procedure actEditRedoExecute(Sender: TObject);
|
||||
procedure EditorKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure EditorReplaceText(Sender: TObject; const ASearch, AReplace: string;
|
||||
Line, Column: integer; var ReplaceAction: TSynReplaceAction);
|
||||
procedure actAboutExecute(Sender: TObject);
|
||||
procedure actEditCopyExecute(Sender: TObject);
|
||||
procedure actEditCutExecute(Sender: TObject);
|
||||
procedure actEditPasteExecute(Sender: TObject);
|
||||
procedure actEditSelectAllExecute(Sender: TObject);
|
||||
procedure actFileNewExecute(Sender: TObject);
|
||||
procedure actFileOpenExecute(Sender: TObject);
|
||||
procedure actEditUndoExecute(Sender: TObject);
|
||||
procedure EditorChange(Sender: TObject);
|
||||
procedure actFileSaveExecute(Sender: TObject);
|
||||
procedure actFileSaveAsExecute(Sender: TObject);
|
||||
procedure EditorStatusChange(Sender: TObject;
|
||||
Changes: TSynStatusChanges);
|
||||
procedure actFileExitExecute(Sender: TObject);
|
||||
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
||||
procedure EditorKeyPress(Sender: TObject; var Key: Char);
|
||||
procedure actEditFindExecute(Sender: TObject);
|
||||
procedure actEditRplcExecute(Sender: TObject);
|
||||
procedure actSave2Execute(Sender: TObject);
|
||||
procedure actConfHighExecute(Sender: TObject);
|
||||
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure frmEditorClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||
private
|
||||
{ Private declarations }
|
||||
|
|
@ -170,6 +152,12 @@ type
|
|||
sOriginalText: String;
|
||||
FWaitData: TEditorWaitData;
|
||||
|
||||
|
||||
FCommands: TFormCommands;
|
||||
|
||||
|
||||
property Commands: TFormCommands read FCommands implements IFormCommands;
|
||||
|
||||
procedure ChooseEncoding(mnuMenuItem: TMenuItem; sEncoding: String);
|
||||
{en
|
||||
Saves editor content to a file.
|
||||
|
|
@ -200,6 +188,33 @@ type
|
|||
procedure ShowSearchReplaceDialog(AReplace: boolean);
|
||||
|
||||
property FileName: String read FFileName write SetFileName;
|
||||
|
||||
published
|
||||
procedure cm_EditFind(const Params:array of string);
|
||||
|
||||
|
||||
|
||||
procedure cm_EditFindNext(const Params:array of string);
|
||||
procedure cm_EditGotoLine(const Params:array of string);
|
||||
procedure cm_EditLineEndCr(const Params:array of string);
|
||||
procedure cm_EditLineEndCrLf(const Params:array of string);
|
||||
procedure cm_EditLineEndLf(const Params:array of string);
|
||||
procedure cm_EditDelete(const Params:array of string);
|
||||
procedure cm_EditRedo(const Params:array of string);
|
||||
procedure cm_About(const Params:array of string);
|
||||
procedure cm_EditCopy(const Params:array of string);
|
||||
procedure cm_EditCut(const Params:array of string);
|
||||
procedure cm_EditPaste(const Params:array of string);
|
||||
procedure cm_EditSelectAll(const Params:array of string);
|
||||
procedure cm_FileNew(const Params:array of string);
|
||||
procedure cm_FileOpen(const Params:array of string);
|
||||
procedure cm_EditUndo(const Params:array of string);
|
||||
procedure cm_FileSave(const Params:array of string);
|
||||
procedure cm_FileSaveAs(const Params:array of string);
|
||||
procedure cm_FileExit(const Params:array of string);
|
||||
// procedure cm_Save2(const Params:array of string);
|
||||
procedure cm_ConfHigh(const Params:array of string);
|
||||
|
||||
end;
|
||||
|
||||
procedure ShowEditor(WaitData: TEditorWaitData);
|
||||
|
|
@ -219,7 +234,7 @@ begin
|
|||
Result := TfrmEditor.Create(Application);
|
||||
|
||||
if sFileName = '' then
|
||||
Result.actFileNew.Execute
|
||||
Result.cm_FileNew([''])
|
||||
else
|
||||
begin
|
||||
if not Result.OpenFile(sFileName) then
|
||||
|
|
@ -242,6 +257,7 @@ var
|
|||
i:Integer;
|
||||
mi:TMenuItem;
|
||||
EncodingsList: TStringList;
|
||||
HMEditor: THMForm;
|
||||
begin
|
||||
InitPropStorage(Self);
|
||||
|
||||
|
|
@ -294,54 +310,22 @@ begin
|
|||
end;
|
||||
|
||||
FixFormIcon(Handle);
|
||||
|
||||
HMEditor := HotMan.Register(Self, HotkeysCategory);
|
||||
HMEditor.RegisterActionList(ActListEdit);
|
||||
FCommands := TFormCommands.Create(Self, ActListEdit);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditFindNextExecute(Sender: TObject);
|
||||
begin
|
||||
if gFirstTextSearch then
|
||||
begin
|
||||
ShowSearchReplaceDialog(False);
|
||||
Exit;
|
||||
end;
|
||||
if sSearchText <> '' then
|
||||
begin
|
||||
DoSearchReplaceText(False, bSearchBackwards);
|
||||
bSearchFromCaret:= True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditGotoLineExecute(Sender: TObject);
|
||||
procedure TfrmEditor.actExecute(Sender: TObject);
|
||||
var
|
||||
P: TPoint;
|
||||
Value: String;
|
||||
NewTopLine: Integer;
|
||||
cmd: string;
|
||||
begin
|
||||
if ShowInputQuery(rsEditGotoLineTitle, rsEditGotoLineQuery, Value) then
|
||||
begin
|
||||
P.X := 1;
|
||||
P.Y := StrToIntDef(Value, 1);
|
||||
NewTopLine := P.Y - (Editor.LinesInWindow div 2);
|
||||
if NewTopLine < 1 then NewTopLine:= 1;
|
||||
Editor.CaretXY := P;
|
||||
Editor.TopLine := NewTopLine;
|
||||
Editor.SetFocus;
|
||||
end;
|
||||
cmd := (Sender as TAction).Name;
|
||||
cmd := 'cm_' + Copy(cmd, 4, Length(cmd) - 3);
|
||||
Commands.ExecuteCommand(cmd, []);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditLineEndCrExecute(Sender: TObject);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsCR;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditLineEndCrLfExecute(Sender: TObject);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsCRLF;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditLineEndLfExecute(Sender: TObject);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsLF;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.EditorMouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
|
|
@ -549,15 +533,6 @@ begin
|
|||
if Assigned(FWaitData) then EditDone(FWaitData);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actFileNewExecute(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
FileName := rsMsgNewFile;
|
||||
Editor.Lines.Clear;
|
||||
bChanged:=False;
|
||||
bNoname:=True;
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.EditorReplaceText(Sender: TObject; const ASearch,
|
||||
AReplace: string; Line, Column: integer; var ReplaceAction: TSynReplaceAction );
|
||||
|
|
@ -580,11 +555,12 @@ procedure TfrmEditor.EditorKeyDown(Sender: TObject; var Key: Word;
|
|||
Shift: TShiftState);
|
||||
begin
|
||||
// this is hack, action hot key not work yet
|
||||
|
||||
{
|
||||
case Key of
|
||||
|
||||
VK_F2:
|
||||
begin
|
||||
actFileSave.Execute;
|
||||
cm_FileSave(['']);
|
||||
Key:=0;
|
||||
end;
|
||||
// To prevent else one editor or viewer open on key F4 in viewer
|
||||
|
|
@ -595,14 +571,14 @@ begin
|
|||
end;
|
||||
VK_F3:
|
||||
begin
|
||||
actEditFindNext.Execute;
|
||||
cm_EditFindNext;
|
||||
Key:=0;
|
||||
end;
|
||||
VK_N:
|
||||
begin
|
||||
if Shift=[ssCtrl] then
|
||||
begin
|
||||
actFileNew.Execute;
|
||||
cm_FileNew;
|
||||
Key:=0;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -610,7 +586,7 @@ begin
|
|||
begin
|
||||
if Shift=[ssCtrl] then
|
||||
begin
|
||||
actFileSave.Execute;
|
||||
cm_FileSave;
|
||||
Key:=0;
|
||||
end;
|
||||
end;
|
||||
|
|
@ -618,60 +594,21 @@ begin
|
|||
begin
|
||||
if Shift=[ssCtrl] then
|
||||
begin
|
||||
actEditFind.Execute;
|
||||
cm_EditFind;
|
||||
Key:=0;
|
||||
end;
|
||||
end;
|
||||
|
||||
VK_ESCAPE:
|
||||
begin
|
||||
Close;
|
||||
Key:=0;
|
||||
end;
|
||||
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actAboutExecute(Sender: TObject);
|
||||
begin
|
||||
msgOK(rsEditAboutText);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditCopyExecute(Sender: TObject);
|
||||
begin
|
||||
editor.CopyToClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditCutExecute(Sender: TObject);
|
||||
begin
|
||||
Editor.CutToClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditPasteExecute(Sender: TObject);
|
||||
begin
|
||||
editor.PasteFromClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditDeleteExecute(Sender: TObject);
|
||||
begin
|
||||
Editor.ClearSelection;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditRedoExecute(Sender: TObject);
|
||||
begin
|
||||
editor.Redo;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditSelectAllExecute(Sender: TObject);
|
||||
begin
|
||||
editor.SelectAll;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actFileOpenExecute(Sender: TObject);
|
||||
begin
|
||||
dmComData.OpenDialog.Filter:='*.*';
|
||||
if not dmComData.OpenDialog.Execute then Exit;
|
||||
if OpenFile(dmComData.OpenDialog.FileName) then
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.SetHighLighter(Sender:TObject);
|
||||
var
|
||||
|
|
@ -686,7 +623,7 @@ This is code for multi tabs editor, it's buggy because
|
|||
Synedit bad handle scrollbars in page control, maybe in
|
||||
future, workaround: new tab must be visible and maybe must have focus
|
||||
|
||||
procedure TfrmEditor.actFileNewExecute(Sender: TObject);
|
||||
procedure TfrmEditor.cm_FileNewExecute(Sender: TObject);
|
||||
var
|
||||
iPageIndex:Integer;
|
||||
begin
|
||||
|
|
@ -719,7 +656,7 @@ begin
|
|||
end;
|
||||
|
||||
|
||||
procedure TfrmEditor.actFileOpenExecute(Sender: TObject);
|
||||
procedure TfrmEditor.cm_FileOpenExecute(const Params:array of string);
|
||||
var
|
||||
iPageIndex:Integer;
|
||||
begin
|
||||
|
|
@ -761,12 +698,6 @@ begin
|
|||
end;
|
||||
*)
|
||||
|
||||
procedure TfrmEditor.actEditUndoExecute(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
Editor.Undo;
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.EditorChange(Sender: TObject);
|
||||
begin
|
||||
|
|
@ -775,37 +706,6 @@ begin
|
|||
UpdateStatus;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actFileSaveExecute(Sender: TObject);
|
||||
begin
|
||||
if bNoname then
|
||||
actFileSaveAs.Execute
|
||||
else
|
||||
begin
|
||||
SaveFile(FileName);
|
||||
bChanged:=False;
|
||||
UpdateStatus;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actFileSaveAsExecute(Sender: TObject);
|
||||
var
|
||||
Highlighter: TSynCustomHighlighter;
|
||||
begin
|
||||
dmComData.SaveDialog.FileName := FileName;
|
||||
dmComData.SaveDialog.Filter:='*.*'; // rewrite for highlighter
|
||||
if not dmComData.SaveDialog.Execute then
|
||||
Exit;
|
||||
|
||||
FileName := dmComData.SaveDialog.FileName;
|
||||
SaveFile(FileName);
|
||||
bChanged:=False;
|
||||
bNoname:=False;
|
||||
|
||||
UpdateStatus;
|
||||
Highlighter:= dmHighl.GetHighlighterByExt(ExtractFileExt(FileName));
|
||||
UpdateHighlighter(Highlighter);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.UpdateStatus;
|
||||
begin
|
||||
if bChanged then
|
||||
|
|
@ -842,10 +742,6 @@ begin
|
|||
StatusBar.Panels[3].Text:= Highlighter.GetLanguageName;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actFileExitExecute(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.FormCloseQuery(Sender: TObject;
|
||||
var CanClose: Boolean);
|
||||
|
|
@ -854,7 +750,7 @@ begin
|
|||
CanClose:=False;
|
||||
if bChanged then
|
||||
case msgYesNoCancel(Format(rsMsgFileChangedSave,[FileName])) of
|
||||
mmrYes: actFileSave.Execute;
|
||||
mmrYes: cm_FileSave(['']);
|
||||
mmrNo: bChanged:=False;
|
||||
else
|
||||
Exit;
|
||||
|
|
@ -958,41 +854,174 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditFindExecute(Sender: TObject);
|
||||
|
||||
procedure TfrmEditor.cm_EditFind(const Params: array of string);
|
||||
begin
|
||||
ShowSearchReplaceDialog(False);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actEditRplcExecute(Sender: TObject);
|
||||
|
||||
procedure TfrmEditor.cm_EditFindNext(const Params:array of string);
|
||||
begin
|
||||
ShowSearchReplaceDialog(True);
|
||||
if gFirstTextSearch then
|
||||
begin
|
||||
ShowSearchReplaceDialog(False);
|
||||
Exit;
|
||||
end;
|
||||
if sSearchText <> '' then
|
||||
begin
|
||||
DoSearchReplaceText(False, bSearchBackwards);
|
||||
bSearchFromCaret:= True;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actSave2Execute(Sender: TObject);
|
||||
|
||||
|
||||
procedure TfrmEditor.cm_EditGotoLine(const Params:array of string);
|
||||
var
|
||||
P: TPoint;
|
||||
Value: String;
|
||||
NewTopLine: Integer;
|
||||
begin
|
||||
if ShowInputQuery(rsEditGotoLineTitle, rsEditGotoLineQuery, Value) then
|
||||
begin
|
||||
P.X := 1;
|
||||
P.Y := StrToIntDef(Value, 1);
|
||||
NewTopLine := P.Y - (Editor.LinesInWindow div 2);
|
||||
if NewTopLine < 1 then NewTopLine:= 1;
|
||||
Editor.CaretXY := P;
|
||||
Editor.TopLine := NewTopLine;
|
||||
Editor.SetFocus;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditLineEndCr(const Params:array of string);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsCR;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditLineEndCrLf(const Params:array of string);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsCRLF;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditLineEndLf(const Params:array of string);
|
||||
begin
|
||||
Editor.Lines.TextLineBreakStyle:= tlbsLF;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TfrmEditor.cm_About(const Params:array of string);
|
||||
begin
|
||||
msgOK(rsEditAboutText);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditCopy(const Params:array of string);
|
||||
begin
|
||||
editor.CopyToClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditCut(const Params:array of string);
|
||||
begin
|
||||
Editor.CutToClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditPaste(const Params:array of string);
|
||||
begin
|
||||
editor.PasteFromClipboard;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditDelete(const Params:array of string);
|
||||
begin
|
||||
Editor.ClearSelection;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditRedo(const Params:array of string);
|
||||
begin
|
||||
editor.Redo;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditSelectAll(const Params:array of string);
|
||||
begin
|
||||
editor.SelectAll;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_FileNew(const Params:array of string);
|
||||
begin
|
||||
inherited;
|
||||
FileName := rsMsgNewFile;
|
||||
Editor.Lines.Clear;
|
||||
bChanged:=False;
|
||||
bNoname:=True;
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_FileOpen(const Params:array of string);
|
||||
begin
|
||||
dmComData.OpenDialog.Filter:='*.*';
|
||||
if not dmComData.OpenDialog.Execute then Exit;
|
||||
if OpenFile(dmComData.OpenDialog.FileName) then
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmEditor.cm_EditUndo(const Params:array of string);
|
||||
begin
|
||||
inherited;
|
||||
Editor.Undo;
|
||||
UpdateStatus;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmEditor.cm_FileSave(const Params:array of string);
|
||||
begin
|
||||
if bNoname then
|
||||
actFileSaveAs.Execute
|
||||
else
|
||||
begin
|
||||
SaveFile(FileName);
|
||||
bChanged:=False;
|
||||
UpdateStatus;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_FileSaveAs(const Params:array of string);
|
||||
var
|
||||
Highlighter: TSynCustomHighlighter;
|
||||
begin
|
||||
dmComData.SaveDialog.FileName := FileName;
|
||||
dmComData.SaveDialog.Filter:='*.*'; // rewrite for highlighter
|
||||
if not dmComData.SaveDialog.Execute then
|
||||
Exit;
|
||||
|
||||
FileName := dmComData.SaveDialog.FileName;
|
||||
SaveFile(FileName);
|
||||
bChanged:=False;
|
||||
bNoname:=False;
|
||||
|
||||
UpdateStatus;
|
||||
Highlighter:= dmHighl.GetHighlighterByExt(ExtractFileExt(FileName));
|
||||
UpdateHighlighter(Highlighter);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_FileExit(const Params:array of string);
|
||||
begin
|
||||
Close;
|
||||
end;
|
||||
|
||||
{
|
||||
procedure TfrmEditor.cm_Save2(const Params:array of string);
|
||||
begin
|
||||
inherited;
|
||||
actFileSave.Execute;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.actConfHighExecute(Sender: TObject);
|
||||
}
|
||||
procedure TfrmEditor.cm_ConfHigh(const Params:array of string);
|
||||
begin
|
||||
ShowOptions(TfrmOptionsEditor);
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
begin
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
|
||||
begin
|
||||
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.frmEditorClose(Sender: TObject;
|
||||
var CloseAction: TCloseAction);
|
||||
|
|
@ -1000,6 +1029,7 @@ begin
|
|||
CloseAction:=caFree;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmEditor.ChooseEncoding(mnuMenuItem: TMenuItem; sEncoding: String);
|
||||
var
|
||||
I: Integer;
|
||||
|
|
@ -1010,4 +1040,7 @@ begin
|
|||
mnuMenuItem.Items[I].Checked:= True;
|
||||
end;
|
||||
|
||||
initialization
|
||||
TFormCommands.RegisterCommandsForm(TfrmEditor, HotkeysCategory, @rsHotkeyCategoryEditor);
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ object frmMain: TfrmMain
|
|||
SessionProperties = 'nbConsole.Height;seLogWindow.Height;TreePanel.Width'
|
||||
ShowHint = True
|
||||
ShowInTaskBar = stAlways
|
||||
LCLVersion = '1.4.4.0'
|
||||
LCLVersion = '1.7'
|
||||
Visible = True
|
||||
object MainToolBar: TKASToolBar
|
||||
AnchorSideTop.Control = Owner
|
||||
|
|
@ -927,6 +927,8 @@ object frmMain: TfrmMain
|
|||
Width = 89
|
||||
Action = actView
|
||||
Flat = True
|
||||
OnMouseWheelDown = btnF3MouseWheelDown
|
||||
OnMouseWheelUp = btnF3MouseWheelUp
|
||||
end
|
||||
object btnF4: TSpeedButton
|
||||
Left = 89
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ uses
|
|||
{$ELSEIF DEFINED(LCLGTK2)}
|
||||
, Glib2, Gtk2
|
||||
{$ENDIF}
|
||||
;
|
||||
, Types;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -511,6 +511,10 @@ type
|
|||
miOpenDirInNewTab: TMenuItem;
|
||||
actResaveFavoriteTabs: TAction;
|
||||
procedure actExecute(Sender: TObject);
|
||||
procedure btnF3MouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure btnF3MouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
procedure btnF8MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
procedure FormKeyUp( Sender: TObject; var Key: Word; Shift: TShiftState) ;
|
||||
|
|
@ -765,6 +769,7 @@ type
|
|||
procedure UpdateTreeView;
|
||||
procedure UpdateDiskCount;
|
||||
procedure UpdateSelectedDrives;
|
||||
procedure UpdateGUIFunctionKeys;
|
||||
procedure CreateDiskPanel(dskPanel : TKASToolBar);
|
||||
function CreateFileView(sType: String; Page: TFileViewPage; AConfig: TIniFileEx; ASectionName: String; ATabIndex: Integer): TFileView;
|
||||
function CreateFileView(sType: String; Page: TFileViewPage; AConfig: TXmlConfig; ANode: TXmlNode): TFileView;
|
||||
|
|
@ -1064,6 +1069,28 @@ begin
|
|||
Commands.Commands.ExecuteCommand(cmd, []);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.btnF3MouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
begin
|
||||
if (ssCtrl in Shift) and (gFonts[dcfFunctionButtons].Size>MIN_FONT_SIZE_FUNCTION_BUTTONS) then
|
||||
begin
|
||||
dec(gFonts[dcfFunctionButtons].Size);
|
||||
pnlKeys.Height:=pnlKeys.Height-1;
|
||||
end;
|
||||
UpdateGUIFunctionKeys;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.btnF3MouseWheelUp(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
begin
|
||||
if (ssCtrl in Shift) and (gFonts[dcfFunctionButtons].Size<MAX_FONT_SIZE_FUNCTION_BUTTONS) then
|
||||
begin
|
||||
inc(gFonts[dcfFunctionButtons].Size);
|
||||
pnlKeys.Height:=pnlKeys.Height+1;
|
||||
end;
|
||||
UpdateGUIFunctionKeys;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.btnF8MouseDown(Sender: TObject; Button: TMouseButton;
|
||||
Shift: TShiftState; X, Y: Integer);
|
||||
var
|
||||
|
|
@ -5504,6 +5531,23 @@ begin
|
|||
UpdateDriveButtonSelection(btnRightDrive, FrameRight);
|
||||
end;
|
||||
|
||||
procedure TfrmMain.UpdateGUIFunctionKeys;
|
||||
var
|
||||
i,c1,c2:integer;
|
||||
begin
|
||||
i:=0;
|
||||
c1:=pnlKeys.ControlCount;
|
||||
c2:=pnlKeys.ComponentCount;
|
||||
while(i<pnlKeys.ControlCount)do
|
||||
begin
|
||||
if pnlKeys.Controls[i] is TSpeedButton then
|
||||
begin
|
||||
TSpeedButton(pnlKeys.Controls[i]).Font.Size:=gFonts[dcfFunctionButtons].Size;
|
||||
end;
|
||||
inc(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmMain.ShowDrivesList(APanel: TFilePanelSelect);
|
||||
var
|
||||
p: TPoint;
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ inherited frmOptionsHotkeys: TfrmOptionsHotkeys
|
|||
RowCount = 1
|
||||
TabOrder = 3
|
||||
TitleStyle = tsNative
|
||||
OnDblClick = stgCommandsDblClick
|
||||
OnDrawCell = stgCommandsDrawCell
|
||||
OnResize = stgCommandsResize
|
||||
OnSelectCell = stgCommandsSelectCell
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ type
|
|||
procedure edtFilterChange(Sender: TObject);
|
||||
procedure lbSCFilesListChange(Sender: TObject);
|
||||
procedure lbxCategoriesChange(Sender: TObject);
|
||||
procedure stgCommandsDblClick(Sender: TObject);
|
||||
procedure stgCommandsDrawCell(Sender: TObject; aCol, aRow: Integer;
|
||||
aRect: TRect; aState: TGridDrawState);
|
||||
procedure stgCommandsResize(Sender: TObject);
|
||||
|
|
@ -249,6 +250,12 @@ begin
|
|||
FillCommandList('');
|
||||
end;
|
||||
|
||||
procedure TfrmOptionsHotkeys.stgCommandsDblClick(Sender: TObject);
|
||||
begin
|
||||
// add hot key
|
||||
ShowEditHotkeyForm(False, GetSelectedForm, GetSelectedCommand, nil, nil);
|
||||
end;
|
||||
|
||||
procedure TfrmOptionsHotkeys.stgCommandsDrawCell(Sender: TObject; aCol,
|
||||
aRow: Integer; aRect: TRect; aState: TGridDrawState);
|
||||
var
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ uses
|
|||
procedure TfrmOptionsTabs.Init;
|
||||
begin
|
||||
ParseLineToList(rsOptTabsPosition, cmbTabsPosition.Items);
|
||||
ParseLineToList(rsTabsActionOnDoubleClickChoices, cbTabsActionOnDoubleClick.Items);
|
||||
// ParseLineToList(rsTabsActionOnDoubleClickChoices, cbTabsActionOnDoubleClick.Items);
|
||||
FPageControl := TPageControl.Create(Self);
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ type
|
|||
TExternalToolsOptions = array[TExternalTool] of TExternalToolOptions;
|
||||
TResultingFramePositionAfterCompare = (rfpacActiveOnLeft, rfpacLeftOnLeft);
|
||||
|
||||
TDCFont = (dcfMain, dcfViewer, dcfEditor, dcfLog, dcfViewerBook, dcfConsole, dcfFileSearchResults, dcfPathEdit);
|
||||
TDCFont = (dcfMain, dcfViewer, dcfEditor, dcfLog, dcfViewerBook, dcfConsole, dcfFileSearchResults, dcfPathEdit, dcfFunctionButtons);
|
||||
TDCFontOptions = record
|
||||
Name: String;
|
||||
Size: Integer;
|
||||
|
|
@ -117,7 +117,7 @@ type
|
|||
|
||||
const
|
||||
{ Default hotkey list version number }
|
||||
hkVersion = 23;
|
||||
hkVersion = 24;
|
||||
|
||||
// Previously existing names if reused must check for ConfigVersion >= X.
|
||||
// History:
|
||||
|
|
@ -162,7 +162,8 @@ const
|
|||
MAX_FONT_SIZE_PATHEDIT=20;
|
||||
MIN_FONT_SIZE_PATHEDIT=8;
|
||||
|
||||
|
||||
MAX_FONT_SIZE_FUNCTION_BUTTONS=20;
|
||||
MIN_FONT_SIZE_FUNCTION_BUTTONS=8;
|
||||
|
||||
var
|
||||
{ For localization }
|
||||
|
|
@ -906,6 +907,37 @@ begin
|
|||
AddIfNotExists(['F2'],[],'cm_SaveDescription');
|
||||
end;
|
||||
|
||||
|
||||
HMForm := HotMan.Forms.FindOrCreate('Editor');
|
||||
with HMForm.Hotkeys do
|
||||
begin
|
||||
AddIfNotExists(['F7'],[],'cm_EditFind');
|
||||
AddIfNotExists(['Ctrl+F'],[],'cm_EditFind');
|
||||
AddIfNotExists(['F2'],[],'cm_FileSave');
|
||||
AddIfNotExists(['F3'],[],'cm_EditFindNext');
|
||||
AddIfNotExists(['Ctrl+N'],[],'cm_FileNew');
|
||||
AddIfNotExists(['Ctrl+S'],[],'cm_FileSave');
|
||||
AddIfNotExists(['Esc'],[],'cm_FileExit');
|
||||
end;
|
||||
|
||||
|
||||
HMForm := HotMan.Forms.FindOrCreate('Find Files');
|
||||
with HMForm.Hotkeys do
|
||||
begin
|
||||
AddIfNotExists(['F7'],[],'cm_IntelliFocus'); // F7
|
||||
// AddIfNotExists(['Ctrl+F'],[],'cm_Start');
|
||||
AddIfNotExists(['Esc'],[],'cm_CancelClose');
|
||||
// AddIfNotExists(['Esc'],[],'cm_Close');
|
||||
AddIfNotExists(['Ctrl+N'],[],'cm_NewSearch');
|
||||
AddIfNotExists(['Ctrl+L'],[],'cm_LastSearch');
|
||||
|
||||
AddIfNotExists(['Alt+1'],[],'cm_PageStandard');
|
||||
AddIfNotExists(['Alt+2'],[],'cm_PageAdvanced');
|
||||
AddIfNotExists(['Alt+3'],[],'cm_PagePlugins');
|
||||
AddIfNotExists(['Alt+4'],[],'cm_PageLoadSave');
|
||||
AddIfNotExists(['Alt+5'],[],'cm_PageResults');
|
||||
end;
|
||||
|
||||
if not mbFileExists(gpCfgDir + gNameSCFile) then
|
||||
gNameSCFile := 'shortcuts.scf';
|
||||
HotMan.Save(gpCfgDir + gNameSCFile);
|
||||
|
|
@ -1212,11 +1244,16 @@ begin
|
|||
gFonts[dcfFileSearchResults].Size := 14;
|
||||
gFonts[dcfFileSearchResults].Style := [];
|
||||
gFonts[dcfFileSearchResults].Quality := fqDefault;
|
||||
|
||||
gFonts[dcfPathEdit].Name := 'default';
|
||||
gFonts[dcfPathEdit].Size := 8;
|
||||
gFonts[dcfPathEdit].Style := [];
|
||||
gFonts[dcfPathEdit].Quality := fqDefault;
|
||||
|
||||
gFonts[dcfFunctionButtons].Name := 'default';
|
||||
gFonts[dcfFunctionButtons].Size := 8;
|
||||
gFonts[dcfFunctionButtons].Style := [];
|
||||
gFonts[dcfFunctionButtons].Quality := fqDefault;
|
||||
|
||||
gFonts[dcfLog].Name := MonoSpaceFont;
|
||||
gFonts[dcfLog].Size := 12;
|
||||
|
|
@ -1913,6 +1950,7 @@ begin
|
|||
|
||||
gFonts[dcfFileSearchResults].Name:=gIni.ReadString('SearchResults', 'Font.Name', MonoSpaceFont);
|
||||
gFonts[dcfPathEdit].Name:=gIni.ReadString('PathEdit', 'Font.Name', MonoSpaceFont);
|
||||
gFonts[dcfFunctionButtons].Name:=gIni.ReadString('FunctionButtons', 'Font.Name', MonoSpaceFont);
|
||||
|
||||
gFonts[dcfMain].Size:=gIni.ReadInteger('Configuration', 'Font.Size', 10);
|
||||
gFonts[dcfEditor].Size:=gIni.ReadInteger('Editor', 'Font.Size', 14);
|
||||
|
|
@ -1920,6 +1958,7 @@ begin
|
|||
|
||||
gFonts[dcfFileSearchResults].Size:=gIni.ReadInteger('SearchResults', 'Font.Size', 12);
|
||||
gFonts[dcfPathEdit].Size:=gIni.ReadInteger('PathEdit', 'Font.Size', 8);
|
||||
gFonts[dcfFunctionButtons].Size:=gIni.ReadInteger('FunctionButtons', 'Font.Name', 8);
|
||||
|
||||
gFonts[dcfMain].Style := TFontStyles(gIni.ReadInteger('Configuration', 'Font.Style', 1));
|
||||
gFonts[dcfEditor].Style := TFontStyles(gIni.ReadInteger('Editor', 'Font.Style', 0));
|
||||
|
|
@ -2214,6 +2253,7 @@ begin
|
|||
|
||||
GetDCFont(gConfig.FindNode(Root, 'Fonts/SearchResults'), gFonts[dcfFileSearchResults]);
|
||||
GetDCFont(gConfig.FindNode(Root, 'Fonts/PathEdit'), gFonts[dcfPathEdit]);
|
||||
GetDCFont(gConfig.FindNode(Root, 'Fonts/FunctionButtons'), gFonts[dcfFunctionButtons]);
|
||||
|
||||
GetDCFont(gConfig.FindNode(Root, 'Fonts/Log'), gFonts[dcfLog]);
|
||||
GetDCFont(gConfig.FindNode(Root, 'Fonts/ViewerBook'), gFonts[dcfViewerBook]);
|
||||
|
|
@ -2732,6 +2772,7 @@ begin
|
|||
SetDCFont(gConfig.FindNode(Root, 'Fonts/Viewer', True), gFonts[dcfViewer]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/SearchResults',True), gFonts[dcfFileSearchResults]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/PathEdit',True), gFonts[dcfPathEdit]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/FunctionButtons',True), gFonts[dcfFunctionButtons]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/Log', True), gFonts[dcfLog]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/ViewerBook', True), gFonts[dcfViewerBook]);
|
||||
SetDCFont(gConfig.FindNode(Root, 'Fonts/Console', True), gFonts[dcfConsole]);
|
||||
|
|
|
|||
|
|
@ -643,6 +643,8 @@ resourcestring
|
|||
rsOptHotkeysEditHotkey = 'Edit hotkey for %s';
|
||||
rsHotkeyCategoryMain = 'Main';
|
||||
rsHotkeyCategoryViewer = 'Viewer';
|
||||
rsHotkeyCategoryEditor = 'Editor';
|
||||
rsHotkeyCategoryFindFiles = 'Find files';
|
||||
rsHotkeyCategoryDiffer = 'Differ';
|
||||
rsHotkeyCategoryCopyMoveDialog = 'Copy/Move Dialog';
|
||||
rsHotkeyCategoryEditCommentDialog = 'Edit Comment Dialog';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue