try ICEEditableShortcut in main form

This commit is contained in:
Basile Burg 2015-02-21 06:19:27 +01:00
parent 764bdb27a3
commit f651dd9cdd
1 changed files with 36 additions and 2 deletions

View File

@ -17,9 +17,8 @@ uses
type
// TODO-cfeature: options
// TODO-cwidget: options editor
TCEMainForm = class(TForm, ICEMultiDocObserver, ICESessionOptionsObserver)
TCEMainForm = class(TForm, ICEMultiDocObserver, ICESessionOptionsObserver, ICEEditableShortCut)
actFileCompAndRun: TAction;
actFileSaveAll: TAction;
actFileClose: TAction;
@ -180,6 +179,7 @@ type
fDoc: TCESynMemo;
fMultidoc: ICEMultiDocHandler;
fScCollectCount: Integer;
fUpdateCount: NativeInt;
fProject: TCEProject;
fProjMru: TMruFileList;
@ -215,6 +215,11 @@ type
procedure docFocused(aDoc: TCESynMemo);
procedure docChanged(aDoc: TCESynMemo);
// ICEEditableShortcut
function scedWantFirst: boolean;
function scedWantNext(out category, identifier: string; out aShortcut: TShortcut): boolean;
procedure scedSendItem(const category, identifier: string; aShortcut: TShortcut);
// ICESessionOptionsObserver
procedure sesoptBeforeSave;
procedure sesoptDeclareProperties(aFiler: TFiler);
@ -900,6 +905,35 @@ begin
end;
{$ENDREGION}
{$REGION ICEEditableShortCut}
function TCEMainForm.scedWantFirst: boolean;
begin
fScCollectCount := 0;
result := true;
end;
function TCEMainForm.scedWantNext(out category, identifier: string; out aShortcut: TShortcut): boolean;
var
act: TCustomAction;
begin
result := false;
if fScCollectCount > actions.ActionCount -1 then exit;
//
act := TCustomAction(Actions.Actions[fScCollectCount]);
category := act.Category;
identifier := act.Caption;
aShortcut := act.ShortCut;
//
fScCollectCount += 1;
result := true;
end;
procedure TCEMainForm.scedSendItem(const category, identifier: string; aShortcut: TShortcut);
begin
end;
{$ENDREGION}
{$REGION file ------------------------------------------------------------------}
procedure TCEMainForm.actFileHtmlExportExecute(Sender: TObject);
var