mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 03:59:10 +02:00
added check files on disk when activating main ide bar
git-svn-id: trunk@7705 -
This commit is contained in:
parent
848e445e9b
commit
fa8807c13c
@ -2065,7 +2065,7 @@ begin
|
|||||||
ASynEdit.MaxUndo:=fUndoLimit;
|
ASynEdit.MaxUndo:=fUndoLimit;
|
||||||
GetSynEditSelectedColor(ASynEdit);
|
GetSynEditSelectedColor(ASynEdit);
|
||||||
|
|
||||||
KeyMap.AssignTo(ASynEdit.KeyStrokes,[caSourceEditor]);
|
KeyMap.AssignTo(ASynEdit.KeyStrokes,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}[caSourceEditor]{$ENDIF});
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TEditorOptions.SetSynEditSettings(ASynEdit:TSynEdit);
|
procedure TEditorOptions.SetSynEditSettings(ASynEdit:TSynEdit);
|
||||||
|
@ -333,7 +333,7 @@ type
|
|||||||
function LoadFromXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
function LoadFromXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
||||||
function SaveToXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
function SaveToXMLConfig(XMLConfig:TXMLConfig; const Prefix: String):boolean;
|
||||||
procedure AssignTo(ASynEditKeyStrokes:TSynEditKeyStrokes;
|
procedure AssignTo(ASynEditKeyStrokes:TSynEditKeyStrokes;
|
||||||
{$IFDEF UseIDEScopes}IDEWindow: TCustomForm
|
{$IFDEF UseIDEScopes}IDEWindowClass: TCustomFormClass
|
||||||
{$ELSE}Areas: TCommandAreas{$ENDIF});
|
{$ELSE}Areas: TCommandAreas{$ENDIF});
|
||||||
procedure Assign(List: TKeyCommandRelationList);
|
procedure Assign(List: TKeyCommandRelationList);
|
||||||
procedure LoadScheme(const SchemeName: string);
|
procedure LoadScheme(const SchemeName: string);
|
||||||
@ -2083,7 +2083,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
if (j=KeyIndex) then continue;
|
if (j=KeyIndex) then continue;
|
||||||
{$IFDEF UseIDEScopes}
|
{$IFDEF UseIDEScopes}
|
||||||
{$WARN TODO: TKeyMappingEditForm.ResolveConflicts}
|
{$WARNING TODO: TKeyMappingEditForm.ResolveConflicts}
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
if (Category.Areas*Areas=[]) then continue;
|
if (Category.Areas*Areas=[]) then continue;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -2199,11 +2199,12 @@ var
|
|||||||
C: TKeyCommandCategory;
|
C: TKeyCommandCategory;
|
||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
|
|
||||||
// create default keymapping
|
// create default keymapping
|
||||||
|
|
||||||
// moving
|
// moving
|
||||||
C:=Categories[AddCategory('CursorMoving',srkmCatCursorMoving,caSrcEdit)];
|
C:=Categories[AddCategory('CursorMoving',srkmCatCursorMoving,
|
||||||
|
{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Move cursor word left',ecWordLeft);
|
AddDefault(C,'Move cursor word left',ecWordLeft);
|
||||||
AddDefault(C,'Move cursor word right',ecWordRight);
|
AddDefault(C,'Move cursor word right',ecWordRight);
|
||||||
AddDefault(C,'Move cursor to line start',ecLineStart);
|
AddDefault(C,'Move cursor to line start',ecLineStart);
|
||||||
@ -2222,7 +2223,7 @@ begin
|
|||||||
AddDefault(C,'Scroll right one char',ecScrollRight);
|
AddDefault(C,'Scroll right one char',ecScrollRight);
|
||||||
|
|
||||||
// selection
|
// selection
|
||||||
C:=Categories[AddCategory('Selection',srkmCatSelection,caSrcEdit)];
|
C:=Categories[AddCategory('Selection',srkmCatSelection,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Copy selection to clipboard',ecCopy);
|
AddDefault(C,'Copy selection to clipboard',ecCopy);
|
||||||
AddDefault(C,'Cut selection to clipboard',ecCut);
|
AddDefault(C,'Cut selection to clipboard',ecCut);
|
||||||
AddDefault(C,'Paste clipboard to current position',ecPaste);
|
AddDefault(C,'Paste clipboard to current position',ecPaste);
|
||||||
@ -2256,7 +2257,7 @@ begin
|
|||||||
AddDefault(C,'Select paragraph',ecSelectParagraph);
|
AddDefault(C,'Select paragraph',ecSelectParagraph);
|
||||||
|
|
||||||
// editing - without menu items in the IDE bar
|
// editing - without menu items in the IDE bar
|
||||||
C:=Categories[AddCategory('text editing commands',srkmCatEditing,caSrcEditOnly)];
|
C:=Categories[AddCategory('text editing commands',srkmCatEditing,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Delete last char',ecDeleteLastChar);
|
AddDefault(C,'Delete last char',ecDeleteLastChar);
|
||||||
AddDefault(C,'Delete char at cursor',ecDeleteChar);
|
AddDefault(C,'Delete char at cursor',ecDeleteChar);
|
||||||
AddDefault(C,'Delete to end of word',ecDeleteWord);
|
AddDefault(C,'Delete to end of word',ecDeleteWord);
|
||||||
@ -2267,7 +2268,6 @@ begin
|
|||||||
AddDefault(C,'Delete whole text',ecClearAll);
|
AddDefault(C,'Delete whole text',ecClearAll);
|
||||||
AddDefault(C,'Break line and move cursor',ecLineBreak);
|
AddDefault(C,'Break line and move cursor',ecLineBreak);
|
||||||
AddDefault(C,'Break line, leave cursor',ecInsertLine);
|
AddDefault(C,'Break line, leave cursor',ecInsertLine);
|
||||||
// TODO: these commands do have a menu item
|
|
||||||
AddDefault(C,'Insert from Character Map',ecInsertCharacter);
|
AddDefault(C,'Insert from Character Map',ecInsertCharacter);
|
||||||
AddDefault(C,'Insert GPL notice',ecInsertGPLNotice);
|
AddDefault(C,'Insert GPL notice',ecInsertGPLNotice);
|
||||||
AddDefault(C,'Insert LGPL notice',ecInsertLGPLNotice);
|
AddDefault(C,'Insert LGPL notice',ecInsertLGPLNotice);
|
||||||
@ -2284,12 +2284,12 @@ begin
|
|||||||
AddDefault(C,'Insert CVS keyword Source',ecInsertCVSSource);
|
AddDefault(C,'Insert CVS keyword Source',ecInsertCVSSource);
|
||||||
|
|
||||||
// command commands
|
// command commands
|
||||||
C:=Categories[AddCategory('CommandCommands',srkmCatCmdCmd,caAll)];
|
C:=Categories[AddCategory('CommandCommands',srkmCatCmdCmd,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'Undo',ecUndo);
|
AddDefault(C,'Undo',ecUndo);
|
||||||
AddDefault(C,'Redo',ecRedo);
|
AddDefault(C,'Redo',ecRedo);
|
||||||
|
|
||||||
// search & replace
|
// search & replace
|
||||||
C:=Categories[AddCategory('SearchReplace',srkmCatSearchReplace,caAll)];
|
C:=Categories[AddCategory('SearchReplace',srkmCatSearchReplace,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Go to matching bracket',ecMatchBracket);
|
AddDefault(C,'Go to matching bracket',ecMatchBracket);
|
||||||
AddDefault(C,'Find text',ecFind);
|
AddDefault(C,'Find text',ecFind);
|
||||||
AddDefault(C,'Find next',ecFindNext);
|
AddDefault(C,'Find next',ecFindNext);
|
||||||
@ -2307,7 +2307,7 @@ begin
|
|||||||
AddDefault(C,'Open file at cursor',ecOpenFileAtCursor);
|
AddDefault(C,'Open file at cursor',ecOpenFileAtCursor);
|
||||||
|
|
||||||
// marker - without menu items in the IDE bar
|
// marker - without menu items in the IDE bar
|
||||||
C:=Categories[AddCategory('Marker',srkmCatMarker,caSrcEditOnly)];
|
C:=Categories[AddCategory('Marker',srkmCatMarker,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Set free Bookmark',ecSetFreeBookmark);
|
AddDefault(C,'Set free Bookmark',ecSetFreeBookmark);
|
||||||
AddDefault(C,'Previous Bookmark',ecPrevBookmark);
|
AddDefault(C,'Previous Bookmark',ecPrevBookmark);
|
||||||
AddDefault(C,'Next Bookmark',ecNextBookmark);
|
AddDefault(C,'Next Bookmark',ecNextBookmark);
|
||||||
@ -2333,7 +2333,7 @@ begin
|
|||||||
AddDefault(C,'Set marker 9',ecSetMarker9);
|
AddDefault(C,'Set marker 9',ecSetMarker9);
|
||||||
|
|
||||||
// codetools
|
// codetools
|
||||||
C:=Categories[AddCategory('CodeTools',srkmCatCodeTools,caSrcEdit)];
|
C:=Categories[AddCategory('CodeTools',srkmCatCodeTools,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Code template completion',ecAutoCompletion);
|
AddDefault(C,'Code template completion',ecAutoCompletion);
|
||||||
AddDefault(C,'Word completion',ecWordCompletion);
|
AddDefault(C,'Word completion',ecWordCompletion);
|
||||||
AddDefault(C,'Complete code',ecCompleteCode);
|
AddDefault(C,'Complete code',ecCompleteCode);
|
||||||
@ -2354,7 +2354,7 @@ begin
|
|||||||
AddDefault(C,'Goto include directive',ecGotoIncludeDirective);
|
AddDefault(C,'Goto include directive',ecGotoIncludeDirective);
|
||||||
|
|
||||||
// source notebook - without menu items in the IDE bar
|
// source notebook - without menu items in the IDE bar
|
||||||
C:=Categories[AddCategory('SourceNotebook',srkmCatSrcNoteBook,caSrcEditOnly)];
|
C:=Categories[AddCategory('SourceNotebook',srkmCatSrcNoteBook,{$IFDEF UseIDEScopes}IDECmdScopeSrcEdit{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'Go to next editor',ecNextEditor);
|
AddDefault(C,'Go to next editor',ecNextEditor);
|
||||||
AddDefault(C,'Go to prior editor',ecPrevEditor);
|
AddDefault(C,'Go to prior editor',ecPrevEditor);
|
||||||
AddDefault(C,'Add break point',ecAddBreakPoint);
|
AddDefault(C,'Add break point',ecAddBreakPoint);
|
||||||
@ -2373,7 +2373,7 @@ begin
|
|||||||
AddDefault(C,'Go to source editor 10',ecGotoEditor0);
|
AddDefault(C,'Go to source editor 10',ecGotoEditor0);
|
||||||
|
|
||||||
// file menu
|
// file menu
|
||||||
C:=Categories[AddCategory('FileMenu',srkmCatFileMenu,caAll)];
|
C:=Categories[AddCategory('FileMenu',srkmCatFileMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caSrcEdit{$ENDIF})];
|
||||||
AddDefault(C,'New',ecNew);
|
AddDefault(C,'New',ecNew);
|
||||||
AddDefault(C,'NewUnit',ecNewUnit);
|
AddDefault(C,'NewUnit',ecNewUnit);
|
||||||
AddDefault(C,'NewForm',ecNewForm);
|
AddDefault(C,'NewForm',ecNewForm);
|
||||||
@ -2389,7 +2389,7 @@ begin
|
|||||||
AddDefault(C,'Quit',ecQuit);
|
AddDefault(C,'Quit',ecQuit);
|
||||||
|
|
||||||
// view menu
|
// view menu
|
||||||
C:=Categories[AddCategory('ViewMenu',srkmCatViewMenu,caAll)];
|
C:=Categories[AddCategory('ViewMenu',srkmCatViewMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'Toggle view Object Inspector',ecToggleObjectInsp);
|
AddDefault(C,'Toggle view Object Inspector',ecToggleObjectInsp);
|
||||||
AddDefault(C,'Toggle view Source Editor',ecToggleSourceEditor);
|
AddDefault(C,'Toggle view Source Editor',ecToggleSourceEditor);
|
||||||
AddDefault(C,'Toggle view Code Explorer',ecToggleCodeExpl);
|
AddDefault(C,'Toggle view Code Explorer',ecToggleCodeExpl);
|
||||||
@ -2409,7 +2409,7 @@ begin
|
|||||||
AddDefault(C,'View Anchor Editor',ecViewAnchorEditor);
|
AddDefault(C,'View Anchor Editor',ecViewAnchorEditor);
|
||||||
|
|
||||||
// project menu
|
// project menu
|
||||||
C:=Categories[AddCategory('ProjectMenu',srkmCatProjectMenu,caAll)];
|
C:=Categories[AddCategory('ProjectMenu',srkmCatProjectMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'New project',ecNewProject);
|
AddDefault(C,'New project',ecNewProject);
|
||||||
AddDefault(C,'New project from file',ecNewProjectFromFile);
|
AddDefault(C,'New project from file',ecNewProjectFromFile);
|
||||||
AddDefault(C,'Open project',ecOpenProject);
|
AddDefault(C,'Open project',ecOpenProject);
|
||||||
@ -2424,7 +2424,7 @@ begin
|
|||||||
AddDefault(C,'View project options',ecProjectOptions);
|
AddDefault(C,'View project options',ecProjectOptions);
|
||||||
|
|
||||||
// run menu
|
// run menu
|
||||||
C:=Categories[AddCategory('RunMenu',srkmCatRunMenu,caAll)];
|
C:=Categories[AddCategory('RunMenu',srkmCatRunMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'Build project/program',ecBuild);
|
AddDefault(C,'Build project/program',ecBuild);
|
||||||
AddDefault(C,'Build all files of project/program',ecBuildAll);
|
AddDefault(C,'Build all files of project/program',ecBuildAll);
|
||||||
AddDefault(C,'Abort building',ecAbortBuild);
|
AddDefault(C,'Abort building',ecAbortBuild);
|
||||||
@ -2445,7 +2445,7 @@ begin
|
|||||||
AddDefault(C,'Add watch',ecAddWatch);
|
AddDefault(C,'Add watch',ecAddWatch);
|
||||||
|
|
||||||
// components menu
|
// components menu
|
||||||
C:=Categories[AddCategory('Components',srkmCatComponentsMenu,caAll)];
|
C:=Categories[AddCategory('Components',srkmCatComponentsMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'Open package',ecOpenPackage);
|
AddDefault(C,'Open package',ecOpenPackage);
|
||||||
AddDefault(C,'Open package file',ecOpenPackageFile);
|
AddDefault(C,'Open package file',ecOpenPackageFile);
|
||||||
AddDefault(C,'Open package of current unit',ecOpenPackageOfCurUnit);
|
AddDefault(C,'Open package of current unit',ecOpenPackageOfCurUnit);
|
||||||
@ -2455,7 +2455,7 @@ begin
|
|||||||
AddDefault(C,'Configure custom components',ecConfigCustomComps);
|
AddDefault(C,'Configure custom components',ecConfigCustomComps);
|
||||||
|
|
||||||
// tools menu
|
// tools menu
|
||||||
C:=Categories[AddCategory(KeyCategoryToolMenuName,srkmCatToolMenu,caAll)];
|
C:=Categories[AddCategory(KeyCategoryToolMenuName,srkmCatToolMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'External Tools settings',ecExtToolSettings);
|
AddDefault(C,'External Tools settings',ecExtToolSettings);
|
||||||
AddDefault(C,'Build Lazarus',ecBuildLazarus);
|
AddDefault(C,'Build Lazarus',ecBuildLazarus);
|
||||||
AddDefault(C,'Configure "Build Lazarus"',ecConfigBuildLazarus);
|
AddDefault(C,'Configure "Build Lazarus"',ecConfigBuildLazarus);
|
||||||
@ -2466,7 +2466,7 @@ begin
|
|||||||
AddDefault(C,'Convert Delphi project to Lazarus project',ecConvertDelphiProject);
|
AddDefault(C,'Convert Delphi project to Lazarus project',ecConvertDelphiProject);
|
||||||
|
|
||||||
// environment menu
|
// environment menu
|
||||||
C:=Categories[AddCategory('EnvironmentMenu',srkmCatEnvMenu,caAll)];
|
C:=Categories[AddCategory('EnvironmentMenu',srkmCatEnvMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'General environment options',ecEnvironmentOptions);
|
AddDefault(C,'General environment options',ecEnvironmentOptions);
|
||||||
AddDefault(C,'Editor options',ecEditorOptions);
|
AddDefault(C,'Editor options',ecEditorOptions);
|
||||||
AddDefault(C,'Edit Code Templates',ecEditCodeTemplates);
|
AddDefault(C,'Edit Code Templates',ecEditCodeTemplates);
|
||||||
@ -2475,26 +2475,25 @@ begin
|
|||||||
AddDefault(C,'Rescan FPC source directory',ecRescanFPCSrcDir);
|
AddDefault(C,'Rescan FPC source directory',ecRescanFPCSrcDir);
|
||||||
|
|
||||||
// help menu
|
// help menu
|
||||||
C:=Categories[AddCategory('HelpMenu',srkmCarHelpMenu,caAll)];
|
C:=Categories[AddCategory('HelpMenu',srkmCarHelpMenu,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
AddDefault(C,'About Lazarus',ecAboutLazarus);
|
AddDefault(C,'About Lazarus',ecAboutLazarus);
|
||||||
AddDefault(C,'Online Help',ecOnlineHelp);
|
AddDefault(C,'Online Help',ecOnlineHelp);
|
||||||
AddDefault(C,'Configure Help',ecConfigureHelp);
|
AddDefault(C,'Configure Help',ecConfigureHelp);
|
||||||
AddDefault(C,'Context sensitive help',ecContextHelp);
|
AddDefault(C,'Context sensitive help',ecContextHelp);
|
||||||
|
|
||||||
// designer - without menu items in the IDE bar (at least no direct)
|
// designer - without menu items in the IDE bar (at least no direct)
|
||||||
C:=Categories[AddCategory('Designer',lisKeyCatDesigner,caDesignOnly)];
|
C:=Categories[AddCategory('Designer',lisKeyCatDesigner,{$IFDEF UseIDEScopes}IDECmdScopeDesigner{$ELSE}caDesignOnly{$ENDIF})];
|
||||||
AddDefault(C,'Copy selected Components to clipboard',ecDesignerCopy);
|
AddDefault(C,'Copy selected Components to clipboard',ecDesignerCopy);
|
||||||
AddDefault(C,'Cut selected Components to clipboard' ,ecDesignerCut);
|
AddDefault(C,'Cut selected Components to clipboard' ,ecDesignerCut);
|
||||||
AddDefault(C,'Paste Components from clipboard' ,ecDesignerPaste);
|
AddDefault(C,'Paste Components from clipboard' ,ecDesignerPaste);
|
||||||
AddDefault(C,'Select parent component' ,ecDesignerSelectParent);
|
AddDefault(C,'Select parent component' ,ecDesignerSelectParent);
|
||||||
// MWE: todo: implement the next also as menu on ide bar ?
|
|
||||||
AddDefault(C,'Move component to front' ,ecDesignerMoveToFront);
|
AddDefault(C,'Move component to front' ,ecDesignerMoveToFront);
|
||||||
AddDefault(C,'Move component to back' ,ecDesignerMoveToBack);
|
AddDefault(C,'Move component to back' ,ecDesignerMoveToBack);
|
||||||
AddDefault(C,'Move component one forward' ,ecDesignerForwardOne);
|
AddDefault(C,'Move component one forward' ,ecDesignerForwardOne);
|
||||||
AddDefault(C,'Move component one back' ,ecDesignerBackOne);
|
AddDefault(C,'Move component one back' ,ecDesignerBackOne);
|
||||||
|
|
||||||
// custom keys (for experts, task groups, dynamic menu items, etc)
|
// custom keys (for experts, task groups, dynamic menu items, etc)
|
||||||
C:=Categories[AddCategory(KeyCategoryCustomName,lisKeyCatCustom,caAll)];
|
C:=Categories[AddCategory(KeyCategoryCustomName,lisKeyCatCustom,{$IFDEF UseIDEScopes}nil{$ELSE}caAll{$ENDIF})];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKeyCommandRelationList.Clear;
|
procedure TKeyCommandRelationList.Clear;
|
||||||
@ -2749,7 +2748,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TKeyCommandRelationList.FindByCommand(
|
function TKeyCommandRelationList.FindByCommand(
|
||||||
ACommand:word):TKeyCommandRelation;
|
ACommand: word):TKeyCommandRelation;
|
||||||
var a:integer;
|
var a:integer;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result:=nil;
|
||||||
@ -2761,8 +2760,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TKeyCommandRelationList.AssignTo(
|
procedure TKeyCommandRelationList.AssignTo(
|
||||||
ASynEditKeyStrokes:TSynEditKeyStrokes;
|
ASynEditKeyStrokes: TSynEditKeyStrokes;
|
||||||
{$IFDEF UseIDEScopes}IDEWindow: TCustomForm{$ELSE}Areas: TCommandAreas{$ENDIF}
|
{$IFDEF UseIDEScopes}IDEWindowClass: TCustomFormClass{$ELSE}Areas: TCommandAreas{$ENDIF}
|
||||||
);
|
);
|
||||||
var
|
var
|
||||||
a,b,MaxKeyCnt,KeyCnt:integer;
|
a,b,MaxKeyCnt,KeyCnt:integer;
|
||||||
@ -2772,7 +2771,13 @@ begin
|
|||||||
for a:=0 to FRelations.Count-1 do begin
|
for a:=0 to FRelations.Count-1 do begin
|
||||||
CurRelation:=Relations[a];
|
CurRelation:=Relations[a];
|
||||||
if (CurRelation.KeyA.Key1=VK_UNKNOWN)
|
if (CurRelation.KeyA.Key1=VK_UNKNOWN)
|
||||||
or ((CurRelation.Category.Areas*Areas)=[]) then
|
{$IFDEF UseIDEScopes}
|
||||||
|
or ((CurRelation.Category.Scope<>nil)
|
||||||
|
and (not CurRelation.Category.Scope.HasIDEWindow(IDEWindow)))
|
||||||
|
{$ELSE}
|
||||||
|
or ((CurRelation.Category.Areas*Areas)=[])
|
||||||
|
{$ENDIF}
|
||||||
|
then
|
||||||
MaxKeyCnt:=0
|
MaxKeyCnt:=0
|
||||||
else if CurRelation.KeyB.Key1=VK_UNKNOWN then
|
else if CurRelation.KeyB.Key1=VK_UNKNOWN then
|
||||||
MaxKeyCnt:=1
|
MaxKeyCnt:=1
|
||||||
@ -2836,7 +2841,8 @@ begin
|
|||||||
// copy categories
|
// copy categories
|
||||||
for i:=0 to List.CategoryCount-1 do begin
|
for i:=0 to List.CategoryCount-1 do begin
|
||||||
CurCategory:=List.Categories[i];
|
CurCategory:=List.Categories[i];
|
||||||
AddCategory(CurCategory.Name,CurCategory.Description,CurCategory.Areas);
|
AddCategory(CurCategory.Name,CurCategory.Description,
|
||||||
|
CurCategory.{$IFDEF UseIDEScopes}Scope{$ELSE}Areas{$ENDIF});
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// copy keys
|
// copy keys
|
||||||
|
@ -127,6 +127,7 @@ type
|
|||||||
//procedure FormShow(Sender: TObject);
|
//procedure FormShow(Sender: TObject);
|
||||||
procedure MainIDEFormClose(Sender: TObject; var CloseAction: TCloseAction);
|
procedure MainIDEFormClose(Sender: TObject; var CloseAction: TCloseAction);
|
||||||
procedure MainIDEFormCloseQuery(Sender: TObject; var CanClose: boolean);
|
procedure MainIDEFormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
|
procedure MainIDEFormActivate(Sender: TObject);
|
||||||
//procedure FormPaint(Sender: TObject);
|
//procedure FormPaint(Sender: TObject);
|
||||||
procedure OnApplicationUserInput(Sender: TObject; Msg: Cardinal);
|
procedure OnApplicationUserInput(Sender: TObject; Msg: Cardinal);
|
||||||
procedure OnApplicationIdle(Sender: TObject);
|
procedure OnApplicationIdle(Sender: TObject);
|
||||||
@ -1247,6 +1248,11 @@ begin
|
|||||||
CanClose:=(DoCloseProject <> mrAbort);
|
CanClose:=(DoCloseProject <> mrAbort);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TMainIDE.MainIDEFormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
DoCheckFilesOnDisk;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
type
|
type
|
||||||
TMoveFlags = set of (mfTop, mfLeft);
|
TMoveFlags = set of (mfTop, mfLeft);
|
||||||
@ -1549,6 +1555,8 @@ procedure TMainIDE.SetupIDEInterface;
|
|||||||
begin
|
begin
|
||||||
IDECommands.OnExecuteIDECommand:=@OnExecuteIDECommand;
|
IDECommands.OnExecuteIDECommand:=@OnExecuteIDECommand;
|
||||||
IDECommands.OnExecuteIDEShortCut:=@OnExecuteIDEShortCut;
|
IDECommands.OnExecuteIDEShortCut:=@OnExecuteIDEShortCut;
|
||||||
|
CreateStandardIDECommandScopes;
|
||||||
|
IDECmdScopeSrcEdit.AddWindowClass(TSourceNotebook);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMainIDE.SetupStartProject;
|
procedure TMainIDE.SetupStartProject;
|
||||||
@ -1966,6 +1974,7 @@ procedure TMainIDE.ConnectMainBarEvents;
|
|||||||
begin
|
begin
|
||||||
MainIDEBar.OnClose := @MainIDEFormClose;
|
MainIDEBar.OnClose := @MainIDEFormClose;
|
||||||
MainIDEBar.OnCloseQuery := @MainIDEFormCloseQuery;
|
MainIDEBar.OnCloseQuery := @MainIDEFormCloseQuery;
|
||||||
|
MainIDEBar.OnActivate := @MainIDEFormActivate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
@ -39,7 +39,7 @@ unit IDECommands;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, Forms, LCLType, Menus, TextTools;
|
Classes, SysUtils, LCLProc, Forms, LCLType, Menus, TextTools;
|
||||||
|
|
||||||
{$IFNDEF UseIDEScopes}
|
{$IFNDEF UseIDEScopes}
|
||||||
type
|
type
|
||||||
@ -84,10 +84,13 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure AddWindow(AWindow: TCustomForm);
|
procedure AddWindow(AWindow: TCustomForm);
|
||||||
procedure RemoveWindow(AWindow: TCustomForm);
|
procedure RemoveWindow(AWindow: TCustomForm);
|
||||||
|
procedure AddWindowClass(AWindowClass: TCustomFormClass);
|
||||||
|
procedure RemoveWindowClass(AWindowClass: TCustomFormClass);
|
||||||
function IDEWindowCount: integer;
|
function IDEWindowCount: integer;
|
||||||
function IDEWindowClassCount: integer;
|
function IDEWindowClassCount: integer;
|
||||||
function CategoryCount: integer;
|
function CategoryCount: integer;
|
||||||
function HasIDEWindow(AnWindow: TCustomForm): boolean;
|
function HasIDEWindow(AWindow: TCustomForm): boolean;
|
||||||
|
function HasIDEWindowClass(AWindowClass: TCustomFormClass): boolean;
|
||||||
public
|
public
|
||||||
property Name: string read FName;
|
property Name: string read FName;
|
||||||
property IDEWindows[Index: integer]: TCustomForm read GetIDEWindows;
|
property IDEWindows[Index: integer]: TCustomForm read GetIDEWindows;
|
||||||
@ -222,6 +225,7 @@ var
|
|||||||
IDECommandScopes: TIDECommandScopes = nil;
|
IDECommandScopes: TIDECommandScopes = nil;
|
||||||
var
|
var
|
||||||
IDECmdScopeSrcEdit: TIDECommandScope;
|
IDECmdScopeSrcEdit: TIDECommandScope;
|
||||||
|
IDECmdScopeSrcEditOnly: TIDECommandScope;
|
||||||
IDECmdScopeDesigner: TIDECommandScope;
|
IDECmdScopeDesigner: TIDECommandScope;
|
||||||
|
|
||||||
procedure CreateStandardIDECommandScopes;
|
procedure CreateStandardIDECommandScopes;
|
||||||
@ -495,6 +499,8 @@ end;
|
|||||||
|
|
||||||
procedure TIDECommandScope.AddWindow(AWindow: TCustomForm);
|
procedure TIDECommandScope.AddWindow(AWindow: TCustomForm);
|
||||||
begin
|
begin
|
||||||
|
if FIDEWindows.IndexOf(AWindow)>=0 then
|
||||||
|
RaiseGDBException('TIDECommandScope.AddWindow');
|
||||||
FIDEWindows.Add(AWindow);
|
FIDEWindows.Add(AWindow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -503,6 +509,18 @@ begin
|
|||||||
FIDEWindows.Remove(AWindow);
|
FIDEWindows.Remove(AWindow);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIDECommandScope.AddWindowClass(AWindowClass: TCustomFormClass);
|
||||||
|
begin
|
||||||
|
if FIDEWindowClasses.IndexOf(AWindowClass)>=0 then
|
||||||
|
RaiseGDBException('TIDECommandScope.AddWindowClass');
|
||||||
|
FIDEWindowClasses.Add(AWindowClass);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TIDECommandScope.RemoveWindowClass(AWindowClass: TCustomFormClass);
|
||||||
|
begin
|
||||||
|
FIDEWindowClasses.Remove(AWindowClass);
|
||||||
|
end;
|
||||||
|
|
||||||
function TIDECommandScope.IDEWindowCount: integer;
|
function TIDECommandScope.IDEWindowCount: integer;
|
||||||
begin
|
begin
|
||||||
Result:=FIDEWindows.Count;
|
Result:=FIDEWindows.Count;
|
||||||
@ -518,15 +536,27 @@ begin
|
|||||||
Result:=FCategories.Count;
|
Result:=FCategories.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIDECommandScope.HasIDEWindow(AnWindow: TCustomForm): boolean;
|
function TIDECommandScope.HasIDEWindow(AWindow: TCustomForm): boolean;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
for i:=0 to FIDEWindows.Count-1 do
|
for i:=0 to FIDEWindows.Count-1 do
|
||||||
if TCustomForm(FIDEWindows[i])=AnWindow then
|
if TCustomForm(FIDEWindows[i])=AWindow then
|
||||||
exit(true);
|
exit(true);
|
||||||
for i:=0 to FIDEWindowClasses.Count-1 do
|
for i:=0 to FIDEWindowClasses.Count-1 do
|
||||||
if AnWindow.InheritsFrom(TCustomFormClass(FIDEWindowClasses[i])) then
|
if AWindow.InheritsFrom(TCustomFormClass(FIDEWindowClasses[i])) then
|
||||||
|
exit(true);
|
||||||
|
Result:=(AWindow<>nil)
|
||||||
|
and HasIDEWindowClass(TCustomFormClass(AWindow.ClassType));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TIDECommandScope.HasIDEWindowClass(AWindowClass: TCustomFormClass
|
||||||
|
): boolean;
|
||||||
|
var
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
for i:=0 to FIDEWindowClasses.Count-1 do
|
||||||
|
if AWindowClass.InheritsFrom(TCustomFormClass(FIDEWindowClasses[i])) then
|
||||||
exit(true);
|
exit(true);
|
||||||
Result:=false;
|
Result:=false;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user