IDE: Refactoring. Reuse code for global functions GetCommandAndButton and GetCommandOnly.

git-svn-id: trunk@64064 -
This commit is contained in:
juha 2020-10-24 11:19:33 +00:00
parent 572b9293a5
commit b41c59a13e
2 changed files with 215 additions and 234 deletions

View File

@ -2873,28 +2873,12 @@ end;
procedure TMainIDE.LoadMenuShortCuts; procedure TMainIDE.LoadMenuShortCuts;
function GetCmdAndBtn(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
begin
Result:=IDECommandList.FindIDECommand(ACommand);
if Result<>nil then
ToolButton := RegisterIDEButtonCommand(Result)
else
ToolButton := nil;
end;
function GetCommand(ACommand: word): TIDECommand;
var
ToolButton: TIDEButtonCommand;
begin
Result:=GetCmdAndBtn(ACommand, ToolButton);
end;
function GetCommand(ACommand: word; const OnExecute: TNotifyEvent; function GetCommand(ACommand: word; const OnExecute: TNotifyEvent;
ToolButtonClass: TIDEToolButtonClass = nil): TIDECommand; ToolButtonClass: TIDEToolButtonClass = nil): TIDECommand;
var var
ToolButton: TIDEButtonCommand; ToolButton: TIDEButtonCommand;
begin begin
Result:=GetCmdAndBtn(ACommand, ToolButton); Result:=GetCommandAndButton(ACommand, ToolButton);
if OnExecute<>nil then begin if OnExecute<>nil then begin
if Result.OnExecute<>nil then if Result.OnExecute<>nil then
debugln(['WARNING: GetCommand ',ACommand,' OnExecute set twice. Different=',OnExecute<>Result.OnExecute]); debugln(['WARNING: GetCommand ',ACommand,' OnExecute set twice. Different=',OnExecute<>Result.OnExecute]);
@ -2915,172 +2899,172 @@ begin
// file menu // file menu
itmFileNewUnit.Command:=GetCommand(ecNewUnit, nil, TNewUnitToolButton); itmFileNewUnit.Command:=GetCommand(ecNewUnit, nil, TNewUnitToolButton);
itmFileNewForm.Command:=GetCommand(ecNewForm, nil, TNewFormToolButton); itmFileNewForm.Command:=GetCommand(ecNewForm, nil, TNewFormToolButton);
itmFileNewOther.Command:=GetCommand(ecNew); itmFileNewOther.Command:=GetCommandOnly(ecNew);
itmFileOpen.Command:=GetCommand(ecOpen, nil, TOpenFileToolButton); itmFileOpen.Command:=GetCommand(ecOpen, nil, TOpenFileToolButton);
itmFileOpenUnit.Command:=GetCommand(ecOpenUnit); itmFileOpenUnit.Command:=GetCommandOnly(ecOpenUnit);
GetCommand_ButtonDrop(ecOpenRecent, itmFileRecentOpen); GetCommand_ButtonDrop(ecOpenRecent, itmFileRecentOpen);
itmFileRevert.Command:=GetCommand(ecRevert); itmFileRevert.Command:=GetCommandOnly(ecRevert);
itmFileSave.Command:=GetCommand(ecSave); itmFileSave.Command:=GetCommandOnly(ecSave);
itmFileSaveAs.Command:=GetCommand(ecSaveAs); itmFileSaveAs.Command:=GetCommandOnly(ecSaveAs);
itmFileSaveAll.Command:=GetCommand(ecSaveAll); itmFileSaveAll.Command:=GetCommandOnly(ecSaveAll);
itmFileClose.Command:=GetCommand(ecClose); itmFileClose.Command:=GetCommandOnly(ecClose);
itmFileCloseAll.Command:=GetCommand(ecCloseAll); itmFileCloseAll.Command:=GetCommandOnly(ecCloseAll);
itmFileCleanDirectory.Command:=GetCommand(ecCleanDirectory); itmFileCleanDirectory.Command:=GetCommandOnly(ecCleanDirectory);
itmFileQuit.Command:=GetCommand(ecQuit); itmFileQuit.Command:=GetCommandOnly(ecQuit);
// edit menu // edit menu
itmEditUndo.Command:=GetCommand(ecUndo); itmEditUndo.Command:=GetCommandOnly(ecUndo);
itmEditRedo.Command:=GetCommand(ecRedo); itmEditRedo.Command:=GetCommandOnly(ecRedo);
itmEditCut.Command:=GetCommand(ecCut); itmEditCut.Command:=GetCommandOnly(ecCut);
itmEditCopy.Command:=GetCommand(ecCopy); itmEditCopy.Command:=GetCommandOnly(ecCopy);
itmEditPaste.Command:=GetCommand(ecPaste); itmEditPaste.Command:=GetCommandOnly(ecPaste);
itmEditMultiPaste.Command:=GetCommand(ecMultiPaste); itmEditMultiPaste.Command:=GetCommandOnly(ecMultiPaste);
itmEditSelectAll.Command:=GetCommand(ecSelectAll); itmEditSelectAll.Command:=GetCommandOnly(ecSelectAll);
itmEditSelectToBrace.Command:=GetCommand(ecSelectToBrace); itmEditSelectToBrace.Command:=GetCommandOnly(ecSelectToBrace);
itmEditSelectCodeBlock.Command:=GetCommand(ecSelectCodeBlock); itmEditSelectCodeBlock.Command:=GetCommandOnly(ecSelectCodeBlock);
itmEditSelectWord.Command:=GetCommand(ecSelectWord); itmEditSelectWord.Command:=GetCommandOnly(ecSelectWord);
itmEditSelectLine.Command:=GetCommand(ecSelectLine); itmEditSelectLine.Command:=GetCommandOnly(ecSelectLine);
itmEditSelectParagraph.Command:=GetCommand(ecSelectParagraph); itmEditSelectParagraph.Command:=GetCommandOnly(ecSelectParagraph);
itmEditIndentBlock.Command:=GetCommand(ecBlockIndent); itmEditIndentBlock.Command:=GetCommandOnly(ecBlockIndent);
itmEditUnindentBlock.Command:=GetCommand(ecBlockUnindent); itmEditUnindentBlock.Command:=GetCommandOnly(ecBlockUnindent);
itmEditUpperCaseBlock.Command:=GetCommand(ecSelectionUpperCase); itmEditUpperCaseBlock.Command:=GetCommandOnly(ecSelectionUpperCase);
itmEditLowerCaseBlock.Command:=GetCommand(ecSelectionLowerCase); itmEditLowerCaseBlock.Command:=GetCommandOnly(ecSelectionLowerCase);
itmEditSwapCaseBlock.Command:=GetCommand(ecSelectionSwapCase); itmEditSwapCaseBlock.Command:=GetCommandOnly(ecSelectionSwapCase);
itmEditSortBlock.Command:=GetCommand(ecSelectionSort); itmEditSortBlock.Command:=GetCommandOnly(ecSelectionSort);
itmEditTabsToSpacesBlock.Command:=GetCommand(ecSelectionTabs2Spaces); itmEditTabsToSpacesBlock.Command:=GetCommandOnly(ecSelectionTabs2Spaces);
itmEditSelectionBreakLines.Command:=GetCommand(ecSelectionBreakLines); itmEditSelectionBreakLines.Command:=GetCommandOnly(ecSelectionBreakLines);
itmEditInsertCharacter.Command:=GetCommand(ecInsertCharacter); itmEditInsertCharacter.Command:=GetCommandOnly(ecInsertCharacter);
// search menu // search menu
itmSearchFind.Command:=GetCommand(ecFind); itmSearchFind.Command:=GetCommandOnly(ecFind);
itmSearchFindNext.Command:=GetCommand(ecFindNext); itmSearchFindNext.Command:=GetCommandOnly(ecFindNext);
itmSearchFindPrevious.Command:=GetCommand(ecFindPrevious); itmSearchFindPrevious.Command:=GetCommandOnly(ecFindPrevious);
itmSearchFindInFiles.Command:=GetCommand(ecFindInFiles); itmSearchFindInFiles.Command:=GetCommandOnly(ecFindInFiles);
itmSearchFindIdentifierRefs.Command:=GetCommand(ecFindIdentifierRefs); itmSearchFindIdentifierRefs.Command:=GetCommandOnly(ecFindIdentifierRefs);
itmSearchReplace.Command:=GetCommand(ecReplace); itmSearchReplace.Command:=GetCommandOnly(ecReplace);
itmIncrementalFind.Command:=GetCommand(ecIncrementalFind); itmIncrementalFind.Command:=GetCommandOnly(ecIncrementalFind);
itmGotoLine.Command:=GetCommand(ecGotoLineNumber); itmGotoLine.Command:=GetCommandOnly(ecGotoLineNumber);
itmJumpBack.Command:=GetCommand(ecJumpBack); itmJumpBack.Command:=GetCommandOnly(ecJumpBack);
itmJumpForward.Command:=GetCommand(ecJumpForward); itmJumpForward.Command:=GetCommandOnly(ecJumpForward);
itmAddJumpPoint.Command:=GetCommand(ecAddJumpPoint); itmAddJumpPoint.Command:=GetCommandOnly(ecAddJumpPoint);
itmJumpToNextError.Command:=GetCommand(ecJumpToNextError); itmJumpToNextError.Command:=GetCommandOnly(ecJumpToNextError);
itmJumpToPrevError.Command:=GetCommand(ecJumpToPrevError); itmJumpToPrevError.Command:=GetCommandOnly(ecJumpToPrevError);
itmSetFreeBookmark.Command:=GetCommand(ecSetFreeBookmark); itmSetFreeBookmark.Command:=GetCommandOnly(ecSetFreeBookmark);
itmJumpToNextBookmark.Command:=GetCommand(ecNextBookmark); itmJumpToNextBookmark.Command:=GetCommandOnly(ecNextBookmark);
itmJumpToPrevBookmark.Command:=GetCommand(ecPrevBookmark); itmJumpToPrevBookmark.Command:=GetCommandOnly(ecPrevBookmark);
GetCommand_ButtonDrop(ecJumpToSection, itmJumpToSection); GetCommand_ButtonDrop(ecJumpToSection, itmJumpToSection);
itmJumpToInterface.Command:=GetCommand_DropDown(ecJumpToInterface, itmJumpToSection); itmJumpToInterface.Command:=GetCommand_DropDown(ecJumpToInterface, itmJumpToSection);
itmJumpToInterfaceUses.Command:=GetCommand_DropDown(ecJumpToInterfaceUses, itmJumpToSection); itmJumpToInterfaceUses.Command:=GetCommand_DropDown(ecJumpToInterfaceUses, itmJumpToSection);
itmJumpToImplementation.Command:=GetCommand_DropDown(ecJumpToImplementation, itmJumpToSection); itmJumpToImplementation.Command:=GetCommand_DropDown(ecJumpToImplementation, itmJumpToSection);
itmJumpToImplementationUses.Command:=GetCommand_DropDown(ecJumpToImplementationUses, itmJumpToSection); itmJumpToImplementationUses.Command:=GetCommand_DropDown(ecJumpToImplementationUses, itmJumpToSection);
itmJumpToInitialization.Command:=GetCommand_DropDown(ecJumpToInitialization, itmJumpToSection); itmJumpToInitialization.Command:=GetCommand_DropDown(ecJumpToInitialization, itmJumpToSection);
GetCmdAndBtn(ecJumpToProcedureHeader, xBtnItem); GetCommandAndButton(ecJumpToProcedureHeader, xBtnItem);
xBtnItem.Caption := lisMenuJumpToProcedureHeader; xBtnItem.Caption := lisMenuJumpToProcedureHeader;
xBtnItem.OnClick := @SourceEditorManager.JumpToProcedureHeaderClicked; xBtnItem.OnClick := @SourceEditorManager.JumpToProcedureHeaderClicked;
xBtnItem.ImageIndex := IDEImages.LoadImage('menu_jumpto_procedureheader'); xBtnItem.ImageIndex := IDEImages.LoadImage('menu_jumpto_procedureheader');
GetCmdAndBtn(ecJumpToProcedureBegin, xBtnItem); GetCommandAndButton(ecJumpToProcedureBegin, xBtnItem);
xBtnItem.Caption := lisMenuJumpToProcedureBegin; xBtnItem.Caption := lisMenuJumpToProcedureBegin;
xBtnItem.ImageIndex := IDEImages.LoadImage('menu_jumpto_procedurebegin'); xBtnItem.ImageIndex := IDEImages.LoadImage('menu_jumpto_procedurebegin');
xBtnItem.OnClick := @SourceEditorManager.JumpToProcedureBeginClicked; xBtnItem.OnClick := @SourceEditorManager.JumpToProcedureBeginClicked;
itmFindBlockOtherEnd.Command:=GetCommand(ecFindBlockOtherEnd); itmFindBlockOtherEnd.Command:=GetCommandOnly(ecFindBlockOtherEnd);
itmFindBlockStart.Command:=GetCommand(ecFindBlockStart); itmFindBlockStart.Command:=GetCommandOnly(ecFindBlockStart);
itmFindDeclaration.Command:=GetCommand(ecFindDeclaration); itmFindDeclaration.Command:=GetCommandOnly(ecFindDeclaration);
itmOpenFileAtCursor.Command:=GetCommand(ecOpenFileAtCursor); itmOpenFileAtCursor.Command:=GetCommandOnly(ecOpenFileAtCursor);
itmGotoIncludeDirective.Command:=GetCommand(ecGotoIncludeDirective); itmGotoIncludeDirective.Command:=GetCommandOnly(ecGotoIncludeDirective);
itmSearchProcedureList.Command:=GetCommand(ecProcedureList); itmSearchProcedureList.Command:=GetCommandOnly(ecProcedureList);
// view menu // view menu
itmViewToggleFormUnit.Command:=GetCommand(ecToggleFormUnit); itmViewToggleFormUnit.Command:=GetCommandOnly(ecToggleFormUnit);
itmViewInspector.Command:=GetCommand(ecToggleObjectInsp); itmViewInspector.Command:=GetCommandOnly(ecToggleObjectInsp);
itmViewSourceEditor.Command:=GetCommand(ecToggleSourceEditor); itmViewSourceEditor.Command:=GetCommandOnly(ecToggleSourceEditor);
itmViewCodeExplorer.Command:=GetCommand(ecToggleCodeExpl); itmViewCodeExplorer.Command:=GetCommandOnly(ecToggleCodeExpl);
itmViewFPDocEditor.Command:=GetCommand(ecToggleFPDocEditor); itmViewFPDocEditor.Command:=GetCommandOnly(ecToggleFPDocEditor);
itmViewCodeBrowser.Command:=GetCommand(ecToggleCodeBrowser); itmViewCodeBrowser.Command:=GetCommandOnly(ecToggleCodeBrowser);
itmViewRestrictionBrowser.Command:=GetCommand(ecToggleRestrictionBrowser); itmViewRestrictionBrowser.Command:=GetCommandOnly(ecToggleRestrictionBrowser);
itmViewComponents.Command:=GetCommand(ecViewComponents); itmViewComponents.Command:=GetCommandOnly(ecViewComponents);
itmMacroListView.Command:=GetCommand(ecViewMacroList); itmMacroListView.Command:=GetCommandOnly(ecViewMacroList);
itmJumpHistory.Command:=GetCommand(ecViewJumpHistory); itmJumpHistory.Command:=GetCommandOnly(ecViewJumpHistory);
itmViewMessage.Command:=GetCommand(ecToggleMessages); itmViewMessage.Command:=GetCommandOnly(ecToggleMessages);
itmViewSearchResults.Command:=GetCommand(ecToggleSearchResults); itmViewSearchResults.Command:=GetCommandOnly(ecToggleSearchResults);
itmViewAnchorEditor.Command:=GetCommand(ecViewAnchorEditor); itmViewAnchorEditor.Command:=GetCommandOnly(ecViewAnchorEditor);
itmViewTabOrder.Command:=GetCommand(ecViewTabOrder); itmViewTabOrder.Command:=GetCommandOnly(ecViewTabOrder);
//itmPkgPackageLinks.Command:=GetCommand(ec?); //itmPkgPackageLinks.Command:=GetCommandOnly(ec?);
// source menu // source menu
itmSourceCommentBlock.Command:=GetCommand(ecSelectionComment); itmSourceCommentBlock.Command:=GetCommandOnly(ecSelectionComment);
itmSourceUncommentBlock.Command:=GetCommand(ecSelectionUncomment); itmSourceUncommentBlock.Command:=GetCommandOnly(ecSelectionUncomment);
itmSourceToggleComment.Command:=GetCommand(ecToggleComment); itmSourceToggleComment.Command:=GetCommandOnly(ecToggleComment);
itmSourceEncloseBlock.Command:=GetCommand(ecSelectionEnclose); itmSourceEncloseBlock.Command:=GetCommandOnly(ecSelectionEnclose);
itmSourceEncloseInIFDEF.Command:=GetCommand(ecSelectionEncloseIFDEF); itmSourceEncloseInIFDEF.Command:=GetCommandOnly(ecSelectionEncloseIFDEF);
itmSourceCompleteCodeInteractive.Command:=GetCommand(ecCompleteCodeInteractive); itmSourceCompleteCodeInteractive.Command:=GetCommandOnly(ecCompleteCodeInteractive);
itmSourceUseUnit.Command:=GetCommand(ecUseUnit); itmSourceUseUnit.Command:=GetCommandOnly(ecUseUnit);
itmSourceSyntaxCheck.Command:=GetCommand(ecSyntaxCheck); itmSourceSyntaxCheck.Command:=GetCommandOnly(ecSyntaxCheck);
itmSourceGuessUnclosedBlock.Command:=GetCommand(ecGuessUnclosedBlock); itmSourceGuessUnclosedBlock.Command:=GetCommandOnly(ecGuessUnclosedBlock);
{$IFDEF GuessMisplacedIfdef} {$IFDEF GuessMisplacedIfdef}
itmSourceGuessMisplacedIFDEF.Command:=GetCommand(ecGuessMisplacedIFDEF); itmSourceGuessMisplacedIFDEF.Command:=GetCommandOnly(ecGuessMisplacedIFDEF);
{$ENDIF} {$ENDIF}
itmSourceInsertCVSAuthor.Command:=GetCommand(ecInsertCVSAuthor); itmSourceInsertCVSAuthor.Command:=GetCommandOnly(ecInsertCVSAuthor);
itmSourceInsertCVSDate.Command:=GetCommand(ecInsertCVSDate); itmSourceInsertCVSDate.Command:=GetCommandOnly(ecInsertCVSDate);
itmSourceInsertCVSHeader.Command:=GetCommand(ecInsertCVSHeader); itmSourceInsertCVSHeader.Command:=GetCommandOnly(ecInsertCVSHeader);
itmSourceInsertCVSID.Command:=GetCommand(ecInsertCVSID); itmSourceInsertCVSID.Command:=GetCommandOnly(ecInsertCVSID);
itmSourceInsertCVSLog.Command:=GetCommand(ecInsertCVSLog); itmSourceInsertCVSLog.Command:=GetCommandOnly(ecInsertCVSLog);
itmSourceInsertCVSName.Command:=GetCommand(ecInsertCVSName); itmSourceInsertCVSName.Command:=GetCommandOnly(ecInsertCVSName);
itmSourceInsertCVSRevision.Command:=GetCommand(ecInsertCVSRevision); itmSourceInsertCVSRevision.Command:=GetCommandOnly(ecInsertCVSRevision);
itmSourceInsertCVSSource.Command:=GetCommand(ecInsertCVSSource); itmSourceInsertCVSSource.Command:=GetCommandOnly(ecInsertCVSSource);
itmSourceInsertGPLNotice.Command:=GetCommand(ecInsertGPLNotice); itmSourceInsertGPLNotice.Command:=GetCommandOnly(ecInsertGPLNotice);
itmSourceInsertGPLNoticeTranslated.Command:=GetCommand(ecInsertGPLNoticeTranslated); itmSourceInsertGPLNoticeTranslated.Command:=GetCommandOnly(ecInsertGPLNoticeTranslated);
itmSourceInsertLGPLNotice.Command:=GetCommand(ecInsertLGPLNotice); itmSourceInsertLGPLNotice.Command:=GetCommandOnly(ecInsertLGPLNotice);
itmSourceInsertLGPLNoticeTranslated.Command:=GetCommand(ecInsertLGPLNoticeTranslated); itmSourceInsertLGPLNoticeTranslated.Command:=GetCommandOnly(ecInsertLGPLNoticeTranslated);
itmSourceInsertModifiedLGPLNotice.Command:=GetCommand(ecInsertModifiedLGPLNotice); itmSourceInsertModifiedLGPLNotice.Command:=GetCommandOnly(ecInsertModifiedLGPLNotice);
itmSourceInsertModifiedLGPLNoticeTranslated.Command:=GetCommand(ecInsertModifiedLGPLNoticeTranslated); itmSourceInsertModifiedLGPLNoticeTranslated.Command:=GetCommandOnly(ecInsertModifiedLGPLNoticeTranslated);
itmSourceInsertMITNotice.Command:=GetCommand(ecInsertMITNotice); itmSourceInsertMITNotice.Command:=GetCommandOnly(ecInsertMITNotice);
itmSourceInsertMITNoticeTranslated.Command:=GetCommand(ecInsertMITNoticeTranslated); itmSourceInsertMITNoticeTranslated.Command:=GetCommandOnly(ecInsertMITNoticeTranslated);
itmSourceInsertUsername.Command:=GetCommand(ecInsertUserName); itmSourceInsertUsername.Command:=GetCommandOnly(ecInsertUserName);
itmSourceInsertDateTime.Command:=GetCommand(ecInsertDateTime); itmSourceInsertDateTime.Command:=GetCommandOnly(ecInsertDateTime);
itmSourceInsertChangeLogEntry.Command:=GetCommand(ecInsertChangeLogEntry); itmSourceInsertChangeLogEntry.Command:=GetCommandOnly(ecInsertChangeLogEntry);
itmSourceInsertGUID.Command:=GetCommand(ecInsertGUID); itmSourceInsertGUID.Command:=GetCommandOnly(ecInsertGUID);
itmSourceInsertFilename.Command:=GetCommand(ecInsertFilename); itmSourceInsertFilename.Command:=GetCommandOnly(ecInsertFilename);
itmSourceUnitInfo.Command:=GetCommand(ecViewUnitInfo); itmSourceUnitInfo.Command:=GetCommandOnly(ecViewUnitInfo);
itmSourceUnitDependencies.Command:=GetCommand(ecViewUnitDependencies); itmSourceUnitDependencies.Command:=GetCommandOnly(ecViewUnitDependencies);
// refactor menu // refactor menu
itmRefactorRenameIdentifier.Command:=GetCommand(ecRenameIdentifier); itmRefactorRenameIdentifier.Command:=GetCommandOnly(ecRenameIdentifier);
itmRefactorExtractProc.Command:=GetCommand(ecExtractProc); itmRefactorExtractProc.Command:=GetCommandOnly(ecExtractProc);
itmRefactorInvertAssignment.Command:=GetCommand(ecInvertAssignment); itmRefactorInvertAssignment.Command:=GetCommandOnly(ecInvertAssignment);
itmRefactorShowAbstractMethods.Command:=GetCommand(ecShowAbstractMethods); itmRefactorShowAbstractMethods.Command:=GetCommandOnly(ecShowAbstractMethods);
itmRefactorShowEmptyMethods.Command:=GetCommand(ecRemoveEmptyMethods); itmRefactorShowEmptyMethods.Command:=GetCommandOnly(ecRemoveEmptyMethods);
itmRefactorShowUnusedUnits.Command:=GetCommand(ecRemoveUnusedUnits); itmRefactorShowUnusedUnits.Command:=GetCommandOnly(ecRemoveUnusedUnits);
{$IFDEF EnableFindOverloads} {$IFDEF EnableFindOverloads}
itmRefactorFindOverloads.Command:=GetCommand(ecFindOverloads); itmRefactorFindOverloads.Command:=GetCommandOnly(ecFindOverloads);
{$ENDIF} {$ENDIF}
itmRefactorMakeResourceString.Command:=GetCommand(ecMakeResourceString); itmRefactorMakeResourceString.Command:=GetCommandOnly(ecMakeResourceString);
// project menu // project menu
itmProjectNew.Command:=GetCommand(ecNewProject); itmProjectNew.Command:=GetCommandOnly(ecNewProject);
itmProjectNewFromFile.Command:=GetCommand(ecNewProjectFromFile); itmProjectNewFromFile.Command:=GetCommandOnly(ecNewProjectFromFile);
itmProjectOpen.Command:=GetCommand_DropDown(ecOpenProject, itmProjectRecentOpen); itmProjectOpen.Command:=GetCommand_DropDown(ecOpenProject, itmProjectRecentOpen);
GetCommand_ButtonDrop(ecOpenRecentProject, itmProjectRecentOpen); GetCommand_ButtonDrop(ecOpenRecentProject, itmProjectRecentOpen);
itmProjectClose.Command:=GetCommand(ecCloseProject); itmProjectClose.Command:=GetCommandOnly(ecCloseProject);
itmProjectSave.Command:=GetCommand(ecSaveProject); itmProjectSave.Command:=GetCommandOnly(ecSaveProject);
itmProjectSaveAs.Command:=GetCommand(ecSaveProjectAs); itmProjectSaveAs.Command:=GetCommandOnly(ecSaveProjectAs);
itmProjectResaveFormsWithI18n.Command:=GetCommand(ecProjectResaveFormsWithI18n); itmProjectResaveFormsWithI18n.Command:=GetCommandOnly(ecProjectResaveFormsWithI18n);
itmProjectPublish.Command:=GetCommand(ecPublishProject); itmProjectPublish.Command:=GetCommandOnly(ecPublishProject);
itmProjectInspector.Command:=GetCommand(ecProjectInspector); itmProjectInspector.Command:=GetCommandOnly(ecProjectInspector);
itmProjectOptions.Command:=GetCommand(ecProjectOptions); itmProjectOptions.Command:=GetCommandOnly(ecProjectOptions);
itmProjectAddTo.Command:=GetCommand(ecAddCurUnitToProj); itmProjectAddTo.Command:=GetCommandOnly(ecAddCurUnitToProj);
itmProjectRemoveFrom.Command:=GetCommand(ecRemoveFromProj); itmProjectRemoveFrom.Command:=GetCommandOnly(ecRemoveFromProj);
itmProjectViewUnits.Command:=GetCommand(ecViewProjectUnits); itmProjectViewUnits.Command:=GetCommandOnly(ecViewProjectUnits);
itmProjectViewForms.Command:=GetCommand(ecViewProjectForms); itmProjectViewForms.Command:=GetCommandOnly(ecViewProjectForms);
itmProjectViewSource.Command:=GetCommand(ecViewProjectSource); itmProjectViewSource.Command:=GetCommandOnly(ecViewProjectSource);
GetCmdAndBtn(ecProjectChangeBuildMode, xBtnItem); GetCommandAndButton(ecProjectChangeBuildMode, xBtnItem);
xBtnItem.Caption := lisChangeBuildMode; xBtnItem.Caption := lisChangeBuildMode;
xBtnItem.ToolButtonClass:=TSetBuildModeToolButton; xBtnItem.ToolButtonClass:=TSetBuildModeToolButton;
xBtnItem.ImageIndex := IDEImages.LoadImage('menu_compiler_options'); xBtnItem.ImageIndex := IDEImages.LoadImage('menu_compiler_options');
@ -3105,52 +3089,52 @@ begin
itmRunMenuStop.Command:=GetCommand(ecStopProgram, @mnuStopProjectClicked); itmRunMenuStop.Command:=GetCommand(ecStopProgram, @mnuStopProjectClicked);
itmRunMenuAttach.Command:=GetCommand(ecAttach, @mnuAttachDebuggerClicked); itmRunMenuAttach.Command:=GetCommand(ecAttach, @mnuAttachDebuggerClicked);
itmRunMenuDetach.Command:=GetCommand(ecDetach, @mnuDetachDebuggerClicked); itmRunMenuDetach.Command:=GetCommand(ecDetach, @mnuDetachDebuggerClicked);
itmRunMenuResetDebugger.Command:=GetCommand(ecResetDebugger); itmRunMenuResetDebugger.Command:=GetCommandOnly(ecResetDebugger);
itmRunMenuRunParameters.Command:=GetCommand(ecRunParameters, @mnuRunParametersClicked); itmRunMenuRunParameters.Command:=GetCommand(ecRunParameters, @mnuRunParametersClicked);
itmRunMenuBuildFile.Command:=GetCommand(ecBuildFile, @mnuBuildFileClicked); itmRunMenuBuildFile.Command:=GetCommand(ecBuildFile, @mnuBuildFileClicked);
itmRunMenuRunFile.Command:=GetCommand(ecRunFile, @mnuRunFileClicked); itmRunMenuRunFile.Command:=GetCommand(ecRunFile, @mnuRunFileClicked);
itmRunMenuConfigBuildFile.Command:=GetCommand(ecConfigBuildFile, @mnuConfigBuildFileClicked); itmRunMenuConfigBuildFile.Command:=GetCommand(ecConfigBuildFile, @mnuConfigBuildFileClicked);
// package menu // package menu
itmPkgNewPackage.Command:=GetCommand(ecNewPackage); itmPkgNewPackage.Command:=GetCommandOnly(ecNewPackage);
itmPkgOpenLoadedPackage.Command:=GetCommand(ecOpenPackage); itmPkgOpenLoadedPackage.Command:=GetCommandOnly(ecOpenPackage);
itmPkgOpenPackageFile.Command:=GetCommand_DropDown(ecOpenPackageFile, itmPkgOpenRecent); itmPkgOpenPackageFile.Command:=GetCommand_DropDown(ecOpenPackageFile, itmPkgOpenRecent);
itmPkgOpenPackageOfCurUnit.Command:=GetCommand(ecOpenPackageOfCurUnit); itmPkgOpenPackageOfCurUnit.Command:=GetCommandOnly(ecOpenPackageOfCurUnit);
GetCommand_ButtonDrop(ecOpenRecentPackage, itmPkgOpenRecent); GetCommand_ButtonDrop(ecOpenRecentPackage, itmPkgOpenRecent);
itmPkgAddCurFileToPkg.Command:=GetCommand(ecAddCurFileToPkg); itmPkgAddCurFileToPkg.Command:=GetCommandOnly(ecAddCurFileToPkg);
itmPkgAddNewComponentToPkg.Command:=GetCommand(ecNewPkgComponent); itmPkgAddNewComponentToPkg.Command:=GetCommandOnly(ecNewPkgComponent);
itmPkgPkgGraph.Command:=GetCommand(ecPackageGraph); itmPkgPkgGraph.Command:=GetCommandOnly(ecPackageGraph);
itmPkgPackageLinks.Command:=GetCommand(ecPackageLinks); itmPkgPackageLinks.Command:=GetCommandOnly(ecPackageLinks);
itmPkgEditInstallPkgs.Command:=GetCommand(ecEditInstallPkgs); itmPkgEditInstallPkgs.Command:=GetCommandOnly(ecEditInstallPkgs);
// tools menu // tools menu
itmEnvGeneralOptions.Command:=GetCommand(ecEnvironmentOptions); itmEnvGeneralOptions.Command:=GetCommandOnly(ecEnvironmentOptions);
itmToolRescanFPCSrcDir.Command:=GetCommand(ecRescanFPCSrcDir); itmToolRescanFPCSrcDir.Command:=GetCommandOnly(ecRescanFPCSrcDir);
itmEnvCodeTemplates.Command:=GetCommand(ecEditCodeTemplates); itmEnvCodeTemplates.Command:=GetCommandOnly(ecEditCodeTemplates);
itmEnvCodeToolsDefinesEditor.Command:=GetCommand(ecCodeToolsDefinesEd); itmEnvCodeToolsDefinesEditor.Command:=GetCommandOnly(ecCodeToolsDefinesEd);
itmToolConfigure.Command:=GetCommand(ecExtToolSettings); itmToolConfigure.Command:=GetCommandOnly(ecExtToolSettings);
itmToolManageDesktops.Command:=GetCommand(ecManageDesktops, nil, TShowDesktopsToolButton); itmToolManageDesktops.Command:=GetCommand(ecManageDesktops, nil, TShowDesktopsToolButton);
itmToolManageExamples.Command:=GetCommand(ecManageExamples); itmToolManageExamples.Command:=GetCommandOnly(ecManageExamples);
itmToolDiff.Command:=GetCommand(ecDiff); itmToolDiff.Command:=GetCommandOnly(ecDiff);
itmToolConvertDFMtoLFM.Command:=GetCommand(ecConvertDFM2LFM); itmToolConvertDFMtoLFM.Command:=GetCommandOnly(ecConvertDFM2LFM);
itmToolCheckLFM.Command:=GetCommand(ecCheckLFM); itmToolCheckLFM.Command:=GetCommandOnly(ecCheckLFM);
itmToolConvertDelphiUnit.Command:=GetCommand(ecConvertDelphiUnit); itmToolConvertDelphiUnit.Command:=GetCommandOnly(ecConvertDelphiUnit);
itmToolConvertDelphiProject.Command:=GetCommand(ecConvertDelphiProject); itmToolConvertDelphiProject.Command:=GetCommandOnly(ecConvertDelphiProject);
itmToolConvertDelphiPackage.Command:=GetCommand(ecConvertDelphiPackage); itmToolConvertDelphiPackage.Command:=GetCommandOnly(ecConvertDelphiPackage);
itmToolConvertEncoding.Command:=GetCommand(ecConvertEncoding); itmToolConvertEncoding.Command:=GetCommandOnly(ecConvertEncoding);
itmToolBuildLazarus.Command:=GetCommand(ecBuildLazarus); itmToolBuildLazarus.Command:=GetCommandOnly(ecBuildLazarus);
itmToolConfigureBuildLazarus.Command:=GetCommand(ecConfigBuildLazarus); itmToolConfigureBuildLazarus.Command:=GetCommandOnly(ecConfigBuildLazarus);
// window menu // window menu
itmWindowManager.Command:=GetCommand(ecManageSourceEditors); itmWindowManager.Command:=GetCommandOnly(ecManageSourceEditors);
// help menu // help menu
itmHelpAboutLazarus.Command:=GetCommand(ecAboutLazarus); itmHelpAboutLazarus.Command:=GetCommandOnly(ecAboutLazarus);
itmHelpOnlineHelp.Command:=GetCommand(ecOnlineHelp); itmHelpOnlineHelp.Command:=GetCommandOnly(ecOnlineHelp);
itmHelpReportingBug.Command:=GetCommand(ecReportingBug); itmHelpReportingBug.Command:=GetCommandOnly(ecReportingBug);
end; end;
SourceEditorManager.SetupShortCuts; SourceEditorManager.SetupShortCuts;

View File

@ -1429,17 +1429,16 @@ var
{$ENDIF} {$ENDIF}
function GetCommandAndButton(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
function GetCommandOnly(ACommand: word): TIDECommand;
procedure RegisterStandardSourceTabMenuItems; procedure RegisterStandardSourceTabMenuItems;
procedure RegisterStandardSourceEditorMenuItems; procedure RegisterStandardSourceEditorMenuItems;
function dbgSourceNoteBook(snb: TSourceNotebook): string; function dbgSourceNoteBook(snb: TSourceNotebook): string;
var
Highlighters: array[TLazSyntaxHighlighter] of TSynCustomHighlighter;
function CompareSrcEditIntfWithFilename(SrcEdit1, SrcEdit2: Pointer): integer; function CompareSrcEditIntfWithFilename(SrcEdit1, SrcEdit2: Pointer): integer;
function CompareFilenameWithSrcEditIntf(FilenameStr, SrcEdit: Pointer): integer; function CompareFilenameWithSrcEditIntf(FilenameStr, SrcEdit: Pointer): integer;
var var
Highlighters: array[TLazSyntaxHighlighter] of TSynCustomHighlighter;
EnglishGPLNotice: string; EnglishGPLNotice: string;
EnglishLGPLNotice: string; EnglishLGPLNotice: string;
EnglishModifiedLGPLNotice: string; EnglishModifiedLGPLNotice: string;
@ -1490,6 +1489,20 @@ begin
Result := '['+ Result + ']'; Result := '['+ Result + ']';
end; end;
function GetCommandAndButton(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
begin
Result:=IDECommandList.FindIDECommand(ACommand);
if Result<>nil then
ToolButton := RegisterIDEButtonCommand(Result)
else
ToolButton := nil;
end;
function GetCommandOnly(ACommand: word): TIDECommand;
begin
Result:=IDECommandList.FindIDECommand(ACommand);
end;
function SourceEditorManager: TSourceEditorManager; function SourceEditorManager: TSourceEditorManager;
begin begin
Result := TSourceEditorManager(SourceEditorManagerIntf); Result := TSourceEditorManager(SourceEditorManagerIntf);
@ -10759,27 +10772,11 @@ end;
procedure TSourceEditorManager.SetupShortCuts; procedure TSourceEditorManager.SetupShortCuts;
function GetCmdAndBtn(ACommand: word; out ToolButton: TIDEButtonCommand): TIDECommand;
begin
Result:=IDECommandList.FindIDECommand(ACommand);
if Result<>nil then
ToolButton := RegisterIDEButtonCommand(Result)
else
ToolButton := nil;
end;
function GetCommand(ACommand: word): TIDECommand;
var
ToolButton: TIDEButtonCommand;
begin
Result:=GetCmdAndBtn(ACommand, ToolButton);
end;
function GetCommand(ACommand: word; ToolButtonClass: TIDEToolButtonClass): TIDECommand; function GetCommand(ACommand: word; ToolButtonClass: TIDEToolButtonClass): TIDECommand;
var var
ToolButton: TIDEButtonCommand; ToolButton: TIDEButtonCommand;
begin begin
Result:=GetCmdAndBtn(ACommand, ToolButton); Result:=GetCommandAndButton(ACommand, ToolButton);
if ToolButton<>nil then if ToolButton<>nil then
ToolButton.ToolButtonClass := ToolButtonClass; ToolButton.ToolButtonClass := ToolButtonClass;
end; end;
@ -10792,44 +10789,44 @@ var
i: Integer; i: Integer;
begin begin
{%region *** first static section *** } {%region *** first static section *** }
SrcEditMenuFindDeclaration.Command := GetCommand(ecFindDeclaration); SrcEditMenuFindDeclaration.Command := GetCommandOnly(ecFindDeclaration);
{%region *** Submenu: Find Section *** } {%region *** Submenu: Find Section *** }
SrcEditMenuProcedureJump.Command := GetCommand(ecFindProcedureDefinition); SrcEditMenuProcedureJump.Command := GetCommandOnly(ecFindProcedureDefinition);
SrcEditMenuProcedureJump.OnRequestCaptionHint := @SrcEditMenuProcedureJumpGetCaption; SrcEditMenuProcedureJump.OnRequestCaptionHint := @SrcEditMenuProcedureJumpGetCaption;
SrcEditMenuFindNextWordOccurrence.Command := GetCommand(ecFindNextWordOccurrence); SrcEditMenuFindNextWordOccurrence.Command := GetCommandOnly(ecFindNextWordOccurrence);
SrcEditMenuFindPrevWordOccurrence.Command := GetCommand(ecFindPrevWordOccurrence); SrcEditMenuFindPrevWordOccurrence.Command := GetCommandOnly(ecFindPrevWordOccurrence);
SrcEditMenuFindInFiles.Command := GetCommand(ecFindInFiles); SrcEditMenuFindInFiles.Command := GetCommandOnly(ecFindInFiles);
SrcEditMenuFindIdentifierReferences.Command:=GetCommand(ecFindIdentifierRefs); SrcEditMenuFindIdentifierReferences.Command:=GetCommandOnly(ecFindIdentifierRefs);
SrcEditMenuFindUsedUnitReferences.Command:=GetCommand(ecFindUsedUnitRefs); SrcEditMenuFindUsedUnitReferences.Command:=GetCommandOnly(ecFindUsedUnitRefs);
{%endregion} {%endregion}
{%endregion} {%endregion}
{%region *** Pages section ***} {%region *** Pages section ***}
SrcEditMenuClosePage.Command := GetCommand(ecClose); SrcEditMenuClosePage.Command := GetCommandOnly(ecClose);
SrcEditMenuCloseOtherPages.OnClick := @SourceEditorManager.CloseOtherPagesClicked; SrcEditMenuCloseOtherPages.OnClick := @SourceEditorManager.CloseOtherPagesClicked;
SrcEditMenuCloseOtherPagesToRight.OnClick := @SourceEditorManager.CloseRightPagesClicked; SrcEditMenuCloseOtherPagesToRight.OnClick := @SourceEditorManager.CloseRightPagesClicked;
{$IFnDEF SingleSrcWindow} {$IFnDEF SingleSrcWindow}
SrcEditMenuEditorLock.Command := GetCommand(ecLockEditor); SrcEditMenuEditorLock.Command := GetCommandOnly(ecLockEditor);
SrcEditMenuMoveToNewWindow.SyncProperties := False; SrcEditMenuMoveToNewWindow.SyncProperties := False;
SrcEditMenuMoveToNewWindow.Command := GetCommand(ecMoveEditorNewWindow); SrcEditMenuMoveToNewWindow.Command := GetCommandOnly(ecMoveEditorNewWindow);
SrcEditMenuMoveToOtherWindowNew.SyncProperties := False; SrcEditMenuMoveToOtherWindowNew.SyncProperties := False;
SrcEditMenuMoveToOtherWindowNew.Command := GetCommand(ecMoveEditorNewWindow); SrcEditMenuMoveToOtherWindowNew.Command := GetCommandOnly(ecMoveEditorNewWindow);
SrcEditMenuCopyToNewWindow.SyncProperties := False; SrcEditMenuCopyToNewWindow.SyncProperties := False;
SrcEditMenuCopyToNewWindow.Command := GetCommand(ecCopyEditorNewWindow); SrcEditMenuCopyToNewWindow.Command := GetCommandOnly(ecCopyEditorNewWindow);
SrcEditMenuCopyToOtherWindowNew.SyncProperties := False; SrcEditMenuCopyToOtherWindowNew.SyncProperties := False;
SrcEditMenuCopyToOtherWindowNew.Command := GetCommand(ecCopyEditorNewWindow); SrcEditMenuCopyToOtherWindowNew.Command := GetCommandOnly(ecCopyEditorNewWindow);
{$ENDIF} {$ENDIF}
{%endregion} {%endregion}
{%region * Move Page (left/right) *} {%region * Move Page (left/right) *}
SrcEditMenuMoveEditorLeft.Command := GetCommand(ecMoveEditorLeft); SrcEditMenuMoveEditorLeft.Command := GetCommandOnly(ecMoveEditorLeft);
SrcEditMenuMoveEditorRight.Command := GetCommand(ecMoveEditorRight); SrcEditMenuMoveEditorRight.Command := GetCommandOnly(ecMoveEditorRight);
SrcEditMenuMoveEditorFirst.Command := GetCommand(ecMoveEditorLeftmost); SrcEditMenuMoveEditorFirst.Command := GetCommandOnly(ecMoveEditorLeftmost);
SrcEditMenuMoveEditorLast.Command := GetCommand(ecMoveEditorRightmost); SrcEditMenuMoveEditorLast.Command := GetCommandOnly(ecMoveEditorRightmost);
{%endregion} {%endregion}
SrcEditMenuOpenFileAtCursor.Command := GetCommand(ecOpenFileAtCursor); SrcEditMenuOpenFileAtCursor.Command := GetCommandOnly(ecOpenFileAtCursor);
{%region * sub menu Flags section *} {%region * sub menu Flags section *}
SrcEditMenuReadOnly.OnClick := @ReadOnlyClicked; SrcEditMenuReadOnly.OnClick := @ReadOnlyClicked;
@ -10839,44 +10836,44 @@ begin
{%endregion} {%endregion}
{%region *** Clipboard section ***} {%region *** Clipboard section ***}
SrcEditMenuCut.Command:=GetCommand(ecCut); SrcEditMenuCut.Command:=GetCommandOnly(ecCut);
SrcEditMenuCopy.Command:=GetCommand(ecCopy); SrcEditMenuCopy.Command:=GetCommandOnly(ecCopy);
SrcEditMenuPaste.Command:=GetCommand(ecPaste); SrcEditMenuPaste.Command:=GetCommandOnly(ecPaste);
SrcEditMenuMultiPaste.Command:=GetCommand(ecMultiPaste); SrcEditMenuMultiPaste.Command:=GetCommandOnly(ecMultiPaste);
SrcEditMenuCopyFilename.OnClick:=@CopyFilenameClicked; SrcEditMenuCopyFilename.OnClick:=@CopyFilenameClicked;
SrcEditMenuSelectAll.Command:=GetCommand(ecSelectAll); SrcEditMenuSelectAll.Command:=GetCommandOnly(ecSelectAll);
{%endregion} {%endregion}
SrcEditMenuNextBookmark.Command:=GetCommand(ecNextBookmark); SrcEditMenuNextBookmark.Command:=GetCommandOnly(ecNextBookmark);
SrcEditMenuPrevBookmark.Command:=GetCommand(ecPrevBookmark); SrcEditMenuPrevBookmark.Command:=GetCommandOnly(ecPrevBookmark);
SrcEditMenuSetFreeBookmark.Command:=GetCommand(ecSetFreeBookmark); SrcEditMenuSetFreeBookmark.Command:=GetCommandOnly(ecSetFreeBookmark);
SrcEditMenuClearFileBookmark.Command:=GetCommand(ecClearBookmarkForFile); SrcEditMenuClearFileBookmark.Command:=GetCommandOnly(ecClearBookmarkForFile);
SrcEditMenuClearAllBookmark.Command:=GetCommand(ecClearAllBookmark); SrcEditMenuClearAllBookmark.Command:=GetCommandOnly(ecClearAllBookmark);
for i in TBookmarkNumRange do for i in TBookmarkNumRange do
SrcEditMenuGotoBookmark[i].Command := GetCommand(ecGotoMarker0 + i); SrcEditMenuGotoBookmark[i].Command := GetCommandOnly(ecGotoMarker0 + i);
GetCommand_ButtonDrop(ecGotoBookmarks ,SrcEditSubMenuGotoBookmarks); // [ ] GetCommand_ButtonDrop(ecGotoBookmarks ,SrcEditSubMenuGotoBookmarks); // [ ]
for i in TBookmarkNumRange do for i in TBookmarkNumRange do
SrcEditMenuToggleBookmark[i].Command := GetCommand(ecToggleMarker0 + i); SrcEditMenuToggleBookmark[i].Command := GetCommandOnly(ecToggleMarker0 + i);
GetCommand_ButtonDrop(ecToggleBookmarks ,SrcEditSubMenuToggleBookmarks); // [ ] GetCommand_ButtonDrop(ecToggleBookmarks ,SrcEditSubMenuToggleBookmarks); // [ ]
{%region *** Source Section ***} {%region *** Source Section ***}
SrcEditMenuEncloseSelection.Command:=GetCommand(ecSelectionEnclose); SrcEditMenuEncloseSelection.Command:=GetCommandOnly(ecSelectionEnclose);
SrcEditMenuEncloseInIFDEF.Command:=GetCommand(ecSelectionEncloseIFDEF); SrcEditMenuEncloseInIFDEF.Command:=GetCommandOnly(ecSelectionEncloseIFDEF);
SrcEditMenuCompleteCode.Command:=GetCommand(ecCompleteCode); SrcEditMenuCompleteCode.Command:=GetCommandOnly(ecCompleteCode);
SrcEditMenuUseUnit.Command:=GetCommand(ecUseUnit); SrcEditMenuUseUnit.Command:=GetCommandOnly(ecUseUnit);
{%endregion} {%endregion}
{%region *** Refactoring Section ***} {%region *** Refactoring Section ***}
SrcEditMenuRenameIdentifier.Command:=GetCommand(ecRenameIdentifier); SrcEditMenuRenameIdentifier.Command:=GetCommandOnly(ecRenameIdentifier);
SrcEditMenuExtractProc.Command:=GetCommand(ecExtractProc); SrcEditMenuExtractProc.Command:=GetCommandOnly(ecExtractProc);
SrcEditMenuInvertAssignment.Command:=GetCommand(ecInvertAssignment); SrcEditMenuInvertAssignment.Command:=GetCommandOnly(ecInvertAssignment);
SrcEditMenuShowAbstractMethods.Command:=GetCommand(ecShowAbstractMethods); SrcEditMenuShowAbstractMethods.Command:=GetCommandOnly(ecShowAbstractMethods);
SrcEditMenuShowEmptyMethods.Command:=GetCommand(ecRemoveEmptyMethods); SrcEditMenuShowEmptyMethods.Command:=GetCommandOnly(ecRemoveEmptyMethods);
SrcEditMenuShowUnusedUnits.Command:=GetCommand(ecRemoveUnusedUnits); SrcEditMenuShowUnusedUnits.Command:=GetCommandOnly(ecRemoveUnusedUnits);
SrcEditMenuFindOverloads.Command:=GetCommand(ecFindOverloads); SrcEditMenuFindOverloads.Command:=GetCommandOnly(ecFindOverloads);
SrcEditMenuMakeResourceString.Command:=GetCommand(ecMakeResourceString); SrcEditMenuMakeResourceString.Command:=GetCommandOnly(ecMakeResourceString);
{%endregion} {%endregion}
SrcEditMenuEditorProperties.OnClick:=@EditorPropertiesClicked; SrcEditMenuEditorProperties.OnClick:=@EditorPropertiesClicked;