mirror of https://gitlab.com/basile.b/dexed.git
isolated proj & doc MRU classes, item insertion by observation
This commit is contained in:
parent
e7611457b6
commit
557d1b77f5
|
@ -132,7 +132,7 @@
|
||||||
<PackageName Value="LCL"/>
|
<PackageName Value="LCL"/>
|
||||||
</Item6>
|
</Item6>
|
||||||
</RequiredPackages>
|
</RequiredPackages>
|
||||||
<Units Count="37">
|
<Units Count="38">
|
||||||
<Unit0>
|
<Unit0>
|
||||||
<Filename Value="coedit.lpr"/>
|
<Filename Value="coedit.lpr"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
@ -147,6 +147,7 @@
|
||||||
<Unit2>
|
<Unit2>
|
||||||
<Filename Value="..\src\ce_common.pas"/>
|
<Filename Value="..\src\ce_common.pas"/>
|
||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_common"/>
|
||||||
</Unit2>
|
</Unit2>
|
||||||
<Unit3>
|
<Unit3>
|
||||||
<Filename Value="..\src\ce_d2syn.pas"/>
|
<Filename Value="..\src\ce_d2syn.pas"/>
|
||||||
|
@ -339,7 +340,6 @@
|
||||||
<ComponentName Value="CEShortcutEditor"/>
|
<ComponentName Value="CEShortcutEditor"/>
|
||||||
<HasResources Value="True"/>
|
<HasResources Value="True"/>
|
||||||
<ResourceBaseClass Value="Frame"/>
|
<ResourceBaseClass Value="Frame"/>
|
||||||
<UnitName Value="ce_shortcutseditor"/>
|
|
||||||
</Unit35>
|
</Unit35>
|
||||||
<Unit36>
|
<Unit36>
|
||||||
<Filename Value="..\src\ce_symlist.pas"/>
|
<Filename Value="..\src\ce_symlist.pas"/>
|
||||||
|
@ -349,6 +349,11 @@
|
||||||
<ResourceBaseClass Value="Form"/>
|
<ResourceBaseClass Value="Form"/>
|
||||||
<UnitName Value="ce_symlist"/>
|
<UnitName Value="ce_symlist"/>
|
||||||
</Unit36>
|
</Unit36>
|
||||||
|
<Unit37>
|
||||||
|
<Filename Value="..\src\ce_mru.pas"/>
|
||||||
|
<IsPartOfProject Value="True"/>
|
||||||
|
<UnitName Value="ce_mru"/>
|
||||||
|
</Unit37>
|
||||||
</Units>
|
</Units>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
||||||
|
|
|
@ -9,7 +9,7 @@ uses
|
||||||
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer,
|
Interfaces, Forms, lazcontrols, runtimetypeinfocontrols, ce_observer,
|
||||||
ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options,
|
ce_libman, ce_tools, ce_dcd, ce_main, ce_writableComponent, ce_options,
|
||||||
ce_symstring, ce_staticmacro, ce_inspectors, LResources, ce_editoroptions,
|
ce_symstring, ce_staticmacro, ce_inspectors, LResources, ce_editoroptions,
|
||||||
ce_dockoptions, ce_shortcutseditor;
|
ce_dockoptions, ce_shortcutseditor, ce_mru;
|
||||||
|
|
||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
|
|
|
@ -42,38 +42,6 @@ type
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
(**
|
|
||||||
* MRU list for strings
|
|
||||||
*)
|
|
||||||
TMRUList = class(TStringList)
|
|
||||||
private
|
|
||||||
fMaxCount: Integer;
|
|
||||||
fObj: TObject;
|
|
||||||
protected
|
|
||||||
fChecking: boolean;
|
|
||||||
procedure clearOutOfRange;
|
|
||||||
procedure setMaxCount(aValue: Integer);
|
|
||||||
function checkItem(const S: string): boolean; virtual;
|
|
||||||
procedure Put(Index: Integer; const S: string); override;
|
|
||||||
procedure InsertItem(Index: Integer; const S: string); override;
|
|
||||||
published
|
|
||||||
property maxCount: Integer read fMaxCount write setMaxCount;
|
|
||||||
public
|
|
||||||
constructor Create;
|
|
||||||
procedure Insert(Index: Integer; const S: string); override;
|
|
||||||
property objectTag: TObject read fObj write fObj;
|
|
||||||
end;
|
|
||||||
|
|
||||||
(**
|
|
||||||
* MRU list for filenames
|
|
||||||
*)
|
|
||||||
TMRUFileList = class(TMRUList)
|
|
||||||
protected
|
|
||||||
function checkItem(const S: string): boolean; override;
|
|
||||||
public
|
|
||||||
procedure assign(src: TPersistent); override;
|
|
||||||
end;
|
|
||||||
|
|
||||||
(**
|
(**
|
||||||
* TProcess with assign() 'overriden'.
|
* TProcess with assign() 'overriden'.
|
||||||
*)
|
*)
|
||||||
|
@ -318,81 +286,6 @@ begin
|
||||||
WriteListEnd;
|
WriteListEnd;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TMRUList.Create;
|
|
||||||
begin
|
|
||||||
fMaxCount := 10;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUList.clearOutOfRange;
|
|
||||||
begin
|
|
||||||
while Count > fMaxCount do
|
|
||||||
delete(Count-1);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUList.setMaxCount(aValue: Integer);
|
|
||||||
begin
|
|
||||||
if aValue < 0 then
|
|
||||||
aValue := 0;
|
|
||||||
if fMaxCount = aValue then
|
|
||||||
exit;
|
|
||||||
fMaxCount := aValue;
|
|
||||||
clearOutOfRange;
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMRUList.checkItem(const S: string): boolean;
|
|
||||||
var
|
|
||||||
i: NativeInt;
|
|
||||||
begin
|
|
||||||
i := indexOf(S);
|
|
||||||
if i = -1 then
|
|
||||||
exit(true);
|
|
||||||
if i = 0 then
|
|
||||||
exit(false);
|
|
||||||
if Count < 2 then
|
|
||||||
exit(false);
|
|
||||||
exchange(i, i-1);
|
|
||||||
exit( false);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUList.Put(Index: Integer; const S: string);
|
|
||||||
begin
|
|
||||||
if not (checkItem(S)) then
|
|
||||||
exit;
|
|
||||||
inherited;
|
|
||||||
clearOutOfRange;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUList.InsertItem(Index: Integer; const S: string);
|
|
||||||
begin
|
|
||||||
if not (checkItem(S)) then
|
|
||||||
exit;
|
|
||||||
inherited;
|
|
||||||
clearOutOfRange;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUList.Insert(Index: Integer; const S: string);
|
|
||||||
begin
|
|
||||||
if not (checkItem(S)) then
|
|
||||||
exit;
|
|
||||||
inherited;
|
|
||||||
clearOutOfRange;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TMRUFileList.assign(src: TPersistent);
|
|
||||||
var
|
|
||||||
i: Integer;
|
|
||||||
begin
|
|
||||||
inherited;
|
|
||||||
for i := Count-1 downto 0 do
|
|
||||||
if not fileExists(Strings[i]) then
|
|
||||||
Delete(i);
|
|
||||||
end;
|
|
||||||
|
|
||||||
function TMRUFileList.checkItem(const S: string): boolean;
|
|
||||||
begin
|
|
||||||
exit( inherited checkItem(S) and fileExists(S));
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure saveCompToTxtFile(const aComp: TComponent; const aFilename: string);
|
procedure saveCompToTxtFile(const aComp: TComponent; const aFilename: string);
|
||||||
var
|
var
|
||||||
str1, str2: TMemoryStream;
|
str1, str2: TMemoryStream;
|
||||||
|
@ -951,7 +844,6 @@ end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
RegisterClasses([TMRUList, TMRUFileList]);
|
|
||||||
dExtList := TStringList.Create;
|
dExtList := TStringList.Create;
|
||||||
dExtList.AddStrings(['.d', '.D', '.di', '.DI', '.Di', '.dI']);
|
dExtList.AddStrings(['.d', '.D', '.di', '.DI', '.Di', '.dI']);
|
||||||
finalization
|
finalization
|
||||||
|
|
|
@ -12,7 +12,7 @@ uses
|
||||||
ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf,
|
ce_widget, ce_messages, ce_interfaces, ce_editor, ce_projinspect, ce_projconf,
|
||||||
ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer,
|
ce_search, ce_miniexplorer, ce_libman, ce_libmaneditor, ce_todolist, ce_observer,
|
||||||
ce_toolseditor, ce_procinput, ce_optionseditor,{$IFDEF WIN32} ce_cdbcmd,{$ENDIF}
|
ce_toolseditor, ce_procinput, ce_optionseditor,{$IFDEF WIN32} ce_cdbcmd,{$ENDIF}
|
||||||
ce_symlist;
|
ce_symlist, ce_mru;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -187,8 +187,8 @@ type
|
||||||
fScCollectCount: Integer;
|
fScCollectCount: Integer;
|
||||||
fUpdateCount: NativeInt;
|
fUpdateCount: NativeInt;
|
||||||
fProject: TCEProject;
|
fProject: TCEProject;
|
||||||
fProjMru: TMruFileList;
|
fProjMru: TCEMRUProjectList;
|
||||||
fFileMru: TMruFileList;
|
fFileMru: TCEMRUDocumentList;
|
||||||
fWidgList: TCEWidgetList;
|
fWidgList: TCEWidgetList;
|
||||||
fMesgWidg: TCEMessagesWidget;
|
fMesgWidg: TCEMessagesWidget;
|
||||||
fEditWidg: TCEEditorWidget;
|
fEditWidg: TCEEditorWidget;
|
||||||
|
@ -398,8 +398,8 @@ end;
|
||||||
|
|
||||||
procedure TCEMainForm.InitMRUs;
|
procedure TCEMainForm.InitMRUs;
|
||||||
begin
|
begin
|
||||||
fProjMru := TMruFileList.Create;
|
fProjMru := TCEMRUProjectList.Create;
|
||||||
fFileMru := TMruFileList.Create;
|
fFileMru := TCEMRUDocumentList.Create;
|
||||||
fProjMru.objectTag := mnuItemMruProj;
|
fProjMru.objectTag := mnuItemMruProj;
|
||||||
fFileMru.objectTag := mnuItemMruFile;
|
fFileMru.objectTag := mnuItemMruFile;
|
||||||
fProjMru.OnChange := @mruChange;
|
fProjMru.OnChange := @mruChange;
|
||||||
|
@ -828,14 +828,14 @@ end;
|
||||||
|
|
||||||
procedure TCEMainForm.mruChange(Sender: TObject);
|
procedure TCEMainForm.mruChange(Sender: TObject);
|
||||||
var
|
var
|
||||||
srcLst: TMruFileList;
|
srcLst: TCEMruFileList;
|
||||||
trgMnu: TMenuItem;
|
trgMnu: TMenuItem;
|
||||||
itm: TMenuItem;
|
itm: TMenuItem;
|
||||||
fname: string;
|
fname: string;
|
||||||
clickTrg: TNotifyEvent;
|
clickTrg: TNotifyEvent;
|
||||||
i: NativeInt;
|
i: NativeInt;
|
||||||
begin
|
begin
|
||||||
srcLst := TMruFileList(Sender);
|
srcLst := TCEMruFileList(Sender);
|
||||||
if srcLst = nil then exit;
|
if srcLst = nil then exit;
|
||||||
trgMnu := TMenuItem(srcLst.objectTag);
|
trgMnu := TMenuItem(srcLst.objectTag);
|
||||||
if trgMnu = nil then exit;
|
if trgMnu = nil then exit;
|
||||||
|
@ -874,9 +874,9 @@ end;
|
||||||
|
|
||||||
procedure TCEMainForm.mruClearClick(Sender: TObject);
|
procedure TCEMainForm.mruClearClick(Sender: TObject);
|
||||||
var
|
var
|
||||||
srcLst: TMruFileList;
|
srcLst: TCEMruFileList;
|
||||||
begin
|
begin
|
||||||
srcLst := TMruFileList(TmenuItem(Sender).Tag);
|
srcLst := TCEMruFileList(TmenuItem(Sender).Tag);
|
||||||
if srcLst = nil then exit;
|
if srcLst = nil then exit;
|
||||||
//
|
//
|
||||||
srcLst.Clear;
|
srcLst.Clear;
|
||||||
|
@ -1020,7 +1020,6 @@ end;
|
||||||
procedure TCEMainForm.openFile(const aFilename: string);
|
procedure TCEMainForm.openFile(const aFilename: string);
|
||||||
begin
|
begin
|
||||||
fMultidoc.openDocument(aFilename);
|
fMultidoc.openDocument(aFilename);
|
||||||
fFileMru.Insert(0, aFilename);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.saveFile(aDocument: TCESynMemo);
|
procedure TCEMainForm.saveFile(aDocument: TCESynMemo);
|
||||||
|
@ -1093,7 +1092,6 @@ begin
|
||||||
Filter := DdiagFilter;
|
Filter := DdiagFilter;
|
||||||
if execute then
|
if execute then
|
||||||
fDoc.saveToFile(filename);
|
fDoc.saveToFile(filename);
|
||||||
fFileMru.Insert(0, filename);
|
|
||||||
finally
|
finally
|
||||||
free;
|
free;
|
||||||
end;
|
end;
|
||||||
|
@ -1610,7 +1608,6 @@ procedure TCEMainForm.saveProjAs(const aFilename: string);
|
||||||
begin
|
begin
|
||||||
fProject.fileName := aFilename;
|
fProject.fileName := aFilename;
|
||||||
fProject.saveToFile(fProject.fileName);
|
fProject.saveToFile(fProject.fileName);
|
||||||
fProjMru.Insert(0,fProject.fileName);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.openProj(const aFilename: string);
|
procedure TCEMainForm.openProj(const aFilename: string);
|
||||||
|
@ -1618,7 +1615,6 @@ begin
|
||||||
closeProj;
|
closeProj;
|
||||||
newProj;
|
newProj;
|
||||||
fProject.loadFromFile(aFilename);
|
fProject.loadFromFile(aFilename);
|
||||||
fProjMru.Insert(0,aFilename);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCEMainForm.mruProjItemClick(Sender: TObject);
|
procedure TCEMainForm.mruProjItemClick(Sender: TObject);
|
||||||
|
|
|
@ -0,0 +1,205 @@
|
||||||
|
unit ce_mru;
|
||||||
|
|
||||||
|
{$I ce_defines.inc}
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
Classes, SysUtils, ce_interfaces, ce_observer,
|
||||||
|
ce_project, ce_synmemo;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
(**
|
||||||
|
* 'Most Recently Used' list for strings.
|
||||||
|
*)
|
||||||
|
TCEMruList = class(TStringList)
|
||||||
|
private
|
||||||
|
fMaxCount: Integer;
|
||||||
|
fObj: TObject;
|
||||||
|
protected
|
||||||
|
fChecking: boolean;
|
||||||
|
procedure clearOutOfRange;
|
||||||
|
procedure setMaxCount(aValue: Integer);
|
||||||
|
function checkItem(const S: string): boolean; virtual;
|
||||||
|
procedure Put(Index: Integer; const S: string); override;
|
||||||
|
procedure InsertItem(Index: Integer; const S: string); override;
|
||||||
|
published
|
||||||
|
property maxCount: Integer read fMaxCount write setMaxCount;
|
||||||
|
public
|
||||||
|
constructor Create; virtual;
|
||||||
|
procedure Insert(Index: Integer; const S: string); override;
|
||||||
|
property objectTag: TObject read fObj write fObj;
|
||||||
|
end;
|
||||||
|
|
||||||
|
(**
|
||||||
|
* MRU list for filenames.
|
||||||
|
*)
|
||||||
|
TCEMRUFileList = class(TCEMruList)
|
||||||
|
protected
|
||||||
|
function checkItem(const S: string): boolean; override;
|
||||||
|
public
|
||||||
|
procedure assign(src: TPersistent); override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
(**
|
||||||
|
* MRU list for D/text files.
|
||||||
|
* Insertion is automatic (ICEMultiDocObserver).
|
||||||
|
*)
|
||||||
|
TCEMRUDocumentList = class(TCEMRUFileList, ICEMultiDocObserver)
|
||||||
|
private
|
||||||
|
procedure docNew(aDoc: TCESynMemo);
|
||||||
|
procedure docFocused(aDoc: TCESynMemo);
|
||||||
|
procedure docChanged(aDoc: TCESynMemo);
|
||||||
|
procedure docClosing(aDoc: TCESynMemo);
|
||||||
|
public
|
||||||
|
constructor create; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
(**
|
||||||
|
* MRU list for the ceodit projects.
|
||||||
|
* Insertion is automatic (ICEProjectObserver).
|
||||||
|
*)
|
||||||
|
TCEMRUProjectList = class(TCEMRUFileList, ICEProjectObserver)
|
||||||
|
private
|
||||||
|
procedure projNew(aProject: TCEProject);
|
||||||
|
procedure projChanged(aProject: TCEProject);
|
||||||
|
procedure projClosing(aProject: TCEProject);
|
||||||
|
procedure projFocused(aProject: TCEProject);
|
||||||
|
procedure projCompiling(aProject: TCEProject);
|
||||||
|
public
|
||||||
|
constructor create; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
constructor TCEMruList.Create;
|
||||||
|
begin
|
||||||
|
fMaxCount := 10;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMruList.clearOutOfRange;
|
||||||
|
begin
|
||||||
|
while Count > fMaxCount do
|
||||||
|
delete(Count-1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMruList.setMaxCount(aValue: Integer);
|
||||||
|
begin
|
||||||
|
if aValue < 0 then
|
||||||
|
aValue := 0;
|
||||||
|
if fMaxCount = aValue then
|
||||||
|
exit;
|
||||||
|
fMaxCount := aValue;
|
||||||
|
clearOutOfRange;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEMruList.checkItem(const S: string): boolean;
|
||||||
|
var
|
||||||
|
i: NativeInt;
|
||||||
|
begin
|
||||||
|
i := indexOf(S);
|
||||||
|
if i = -1 then
|
||||||
|
exit(true);
|
||||||
|
if i = 0 then
|
||||||
|
exit(false);
|
||||||
|
if Count < 2 then
|
||||||
|
exit(false);
|
||||||
|
exchange(i, i-1);
|
||||||
|
exit( false);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMruList.Put(Index: Integer; const S: string);
|
||||||
|
begin
|
||||||
|
if not (checkItem(S)) then
|
||||||
|
exit;
|
||||||
|
inherited;
|
||||||
|
clearOutOfRange;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMruList.InsertItem(Index: Integer; const S: string);
|
||||||
|
begin
|
||||||
|
if not (checkItem(S)) then
|
||||||
|
exit;
|
||||||
|
inherited;
|
||||||
|
clearOutOfRange;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMruList.Insert(Index: Integer; const S: string);
|
||||||
|
begin
|
||||||
|
if not (checkItem(S)) then
|
||||||
|
exit;
|
||||||
|
inherited;
|
||||||
|
clearOutOfRange;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUFileList.assign(src: TPersistent);
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
for i := Count-1 downto 0 do
|
||||||
|
if not fileExists(Strings[i]) then
|
||||||
|
Delete(i);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TCEMRUFileList.checkItem(const S: string): boolean;
|
||||||
|
begin
|
||||||
|
exit( inherited checkItem(S) and fileExists(S));
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TCEMRUDocumentList.create;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
EntitiesConnector.addObserver(self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUDocumentList.docNew(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUDocumentList.docFocused(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUDocumentList.docChanged(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUDocumentList.docClosing(aDoc: TCESynMemo);
|
||||||
|
begin
|
||||||
|
if FileExists(aDoc.fileName) and (aDoc.fileName <> aDoc.tempFilename) then
|
||||||
|
Insert(0, aDoc.fileName);
|
||||||
|
end;
|
||||||
|
|
||||||
|
constructor TCEMRUProjectList.create;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
EntitiesConnector.addObserver(self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projNew(aProject: TCEProject);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projFocused(aProject: TCEProject);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projChanged(aProject: TCEProject);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projCompiling(aProject: TCEProject);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCEMRUProjectList.projClosing(aProject: TCEProject);
|
||||||
|
begin
|
||||||
|
if FileExists(aProject.fileName) then
|
||||||
|
Insert(0, aProject.fileName);
|
||||||
|
end;
|
||||||
|
|
||||||
|
initialization
|
||||||
|
RegisterClasses([TCEMRUList, TCEMRUFileList, TCEMRUProjectList, TCEMRUDocumentList]);
|
||||||
|
end.
|
|
@ -6,7 +6,8 @@ interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||||
Menus, StdCtrls, ce_widget, process, ce_common, ce_interfaces, ce_observer;
|
Menus, StdCtrls, ce_widget, process, ce_common, ce_interfaces, ce_observer,
|
||||||
|
ce_mru;
|
||||||
|
|
||||||
type
|
type
|
||||||
TCEProcInputWidget = class(TCEWidget, ICEProcInputHandler)
|
TCEProcInputWidget = class(TCEWidget, ICEProcInputHandler)
|
||||||
|
@ -17,7 +18,7 @@ type
|
||||||
procedure txtInpKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
procedure txtInpKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||||
private
|
private
|
||||||
fMruPos: Integer;
|
fMruPos: Integer;
|
||||||
fMru: TMRUList;
|
fMru: TCEMRUList;
|
||||||
fProc: TProcess;
|
fProc: TProcess;
|
||||||
procedure sendInput;
|
procedure sendInput;
|
||||||
//
|
//
|
||||||
|
@ -44,7 +45,7 @@ uses
|
||||||
constructor TCEProcInputWidget.create(aOwner: TComponent);
|
constructor TCEProcInputWidget.create(aOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
fMru := TMRUList.Create;
|
fMru := TCEMRUList.Create;
|
||||||
fMru.maxCount := 25;
|
fMru.maxCount := 25;
|
||||||
EntitiesConnector.addSingleService(self);
|
EntitiesConnector.addSingleService(self);
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -6,8 +6,8 @@ interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
|
||||||
Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes, ce_common,
|
Menus, StdCtrls, actnList, Buttons, SynEdit, SynEditSearch, SynEditTypes,
|
||||||
ce_widget, ce_synmemo, ce_interfaces, ce_observer, SynEditHighlighter;
|
ce_common, ce_mru, ce_widget, ce_synmemo, ce_interfaces, ce_observer;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ type
|
||||||
fReplaceWth: string;
|
fReplaceWth: string;
|
||||||
fActFindNext, fActReplaceNext: TAction;
|
fActFindNext, fActReplaceNext: TAction;
|
||||||
fActReplaceAll: TAction;
|
fActReplaceAll: TAction;
|
||||||
fSearchMru, fReplaceMru: TMruList;
|
fSearchMru, fReplaceMru: TCEMruList;
|
||||||
fCancelAll: boolean;
|
fCancelAll: boolean;
|
||||||
fHasSearched: boolean;
|
fHasSearched: boolean;
|
||||||
fHasRestarted: boolean;
|
fHasRestarted: boolean;
|
||||||
|
@ -92,8 +92,8 @@ begin
|
||||||
btnReplace.Action := fActReplaceNext;
|
btnReplace.Action := fActReplaceNext;
|
||||||
btnReplaceAll.Action := fActReplaceAll;
|
btnReplaceAll.Action := fActReplaceAll;
|
||||||
//
|
//
|
||||||
fSearchMru := TMruList.Create;
|
fSearchMru := TCEMruList.Create;
|
||||||
fReplaceMru:= TMruList.Create;
|
fReplaceMru:= TCEMruList.Create;
|
||||||
//
|
//
|
||||||
EntitiesConnector.addObserver(self);
|
EntitiesConnector.addObserver(self);
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue