diff --git a/ide/keymapping.pp b/ide/keymapping.pp index 22c1a92572..6d5fc8c035 100644 --- a/ide/keymapping.pp +++ b/ide/keymapping.pp @@ -2020,7 +2020,7 @@ begin ecSelectionComment : Result:= lisMenuCommentSelection; ecSelectionUncomment : Result:= lisMenuUncommentSelection; ecToggleComment : Result:= lisMenuToggleComment; - ecSelectionConditional : Result:= lisMenuConditionalSelection; + ecSelectionConditional : Result:= lisMenuEncloseInIFDEF; ecSelectionSort : Result:= lisMenuSortSelection; ecSelectionBreakLines : Result:= lisMenuBeakLinesInSelection; ecSelectToBrace : Result:= lisMenuSelectToBrace; @@ -2503,7 +2503,7 @@ begin AddDefault(C, 'Delete whole text', srkmecClearAll, ecClearAll); AddDefault(C, 'Break line and move cursor', srkmecLineBreak, ecLineBreak); AddDefault(C, 'Break line, leave cursor', srkmecInsertLine, ecInsertLine); - AddDefault(C, 'Insert $IFDEF', lisKMInsertIFDEF, ecSelectionConditional); + AddDefault(C, 'Enclose in $IFDEF', lisEncloseInIFDEF, ecSelectionConditional); AddDefault(C, 'Insert from Character Map', lisMenuInsertCharacter, ecInsertCharacter); AddDefault(C, 'Insert GPL notice', srkmecInsertGPLNotice, ecInsertGPLNotice); AddDefault(C, 'Insert LGPL notice', srkmecInsertLGPLNotice, ecInsertLGPLNotice); diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index b9576dae07..491b40c0e9 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -199,12 +199,13 @@ resourcestring lisMenuLowerCaseSelection = 'Lowercase selection'; lisMenuSwapCaseSelection = 'Swap case in selection'; lisMenuTabsToSpacesSelection = 'Tabs to spaces in selection'; + lisKMEncloseSelection = 'Enclose selection'; lisMenuEncloseSelection = 'Enclose selection ...'; + lisEncloseInIFDEF = 'Enclose in $IFDEF'; + lisMenuEncloseInIFDEF = 'Enclose in $IFDEF...'; lisMenuCommentSelection = 'Comment selection'; lisMenuUncommentSelection = 'Uncomment selection'; lisMenuToggleComment = 'Toggle comment'; - lisKMInsertIFDEF = 'Insert $IFDEF'; - lisMenuConditionalSelection = 'Insert $IFDEF...'; lisMenuSortSelection = 'Sort selection ...'; lisMenuBeakLinesInSelection = 'Break Lines in selection'; lisKMSelectWordLeft = 'Select word left'; @@ -2546,7 +2547,6 @@ resourcestring // edit menu srkmecSelectionTabs2Spaces = 'Convert tabs to spaces in selection'; - lisKMEncloseSelection = 'Enclose selection'; srkmecInsertCharacter = 'Insert from Charactermap'; srkmecInsertGPLNotice = 'Insert GPL notice'; srkmecInsertLGPLNotice = 'Insert LGPL notice'; diff --git a/ide/main.pp b/ide/main.pp index ca920799a2..f4c075c659 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -239,7 +239,7 @@ type procedure mnuSourceUncommentBlockClicked(Sender: TObject); procedure mnuSourceToggleCommentClicked(Sender: TObject); procedure mnuSourceEncloseBlockClicked(Sender: TObject); - procedure mnuSourceConditionalBlockClicked(Sender: TObject); + procedure mnuSourceEncloseInIFDEFClicked(Sender: TObject); procedure mnuSourceSyntaxCheckClicked(Sender: TObject); procedure mnuSourceGuessUnclosedBlockClicked(Sender: TObject); @@ -2451,7 +2451,7 @@ begin itmSourceUncommentBlock.OnClick:=@mnuSourceUncommentBlockClicked; itmSourceToggleComment.OnClick:=@mnuSourceToggleCommentClicked; itmSourceEncloseBlock.OnClick:=@mnuSourceEncloseBlockClicked; - itmSourceConditionalBlock.OnClick:=@mnuSourceConditionalBlockClicked; + itmSourceEncloseInIFDEF.OnClick:=@mnuSourceEncloseInIFDEFClicked; // CodeTool Checks itmSourceSyntaxCheck.OnClick := @mnuSourceSyntaxCheckClicked; itmSourceGuessUnclosedBlock.OnClick := @mnuSourceGuessUnclosedBlockClicked; @@ -3786,7 +3786,7 @@ begin itmSourceCommentBlock.Enabled:=SelEditable; itmSourceUncommentBlock.Enabled:=SelEditable; itmSourceEncloseBlock.Enabled:=SelEditable; - itmSourceConditionalBlock.Enabled:=SelEditable; + itmSourceEncloseInIFDEF.Enabled:=SelEditable; //itmSourceInsertions: TIDEMenuSection; //itmSourceInsertCVSKeyWord: TIDEMenuSection; itmSourceInsertCVSAuthor.Enabled:=Editable; @@ -17589,7 +17589,7 @@ begin DoSourceEditorCommand(ecToggleComment); end; -procedure TMainIDE.mnuSourceConditionalBlockClicked(Sender: TObject); +procedure TMainIDE.mnuSourceEncloseInIFDEFClicked(Sender: TObject); begin DoSourceEditorCommand(ecSelectionConditional); end; diff --git a/ide/mainbar.pas b/ide/mainbar.pas index 8778c57c11..bf3915849f 100644 --- a/ide/mainbar.pas +++ b/ide/mainbar.pas @@ -204,7 +204,7 @@ type itmSourceUncommentBlock: TIDEMenuCommand; itmSourceToggleComment: TIDEMenuCommand; itmSourceEncloseBlock: TIDEMenuCommand; - itmSourceConditionalBlock: TIDEMenuCommand; + itmSourceEncloseInIFDEF: TIDEMenuCommand; //itmSourceCodeToolChecks: TIDEMenuSection; itmSourceSyntaxCheck: TIDEMenuCommand; itmSourceGuessUnclosedBlock: TIDEMenuCommand; diff --git a/ide/mainbase.pas b/ide/mainbase.pas index e1cc259b8b..f7413a5523 100644 --- a/ide/mainbase.pas +++ b/ide/mainbase.pas @@ -555,7 +555,7 @@ begin CreateMenuItem(ParentMI,itmSourceUncommentBlock,'itmSourceUncommentBlock',lisMenuUncommentSelection, 'menu_uncomment'); CreateMenuItem(ParentMI,itmSourceToggleComment,'itmSourceToggleComment',lisMenuToggleComment, 'menu_comment'); CreateMenuItem(ParentMI,itmSourceEncloseBlock,'itmSourceEncloseBlock',lisMenuEncloseSelection); - CreateMenuItem(ParentMI,itmSourceConditionalBlock,'itmSourceConditionalBlock',lisMenuConditionalSelection); + CreateMenuItem(ParentMI,itmSourceEncloseInIFDEF,'itmSourceEncloseInIFDEF',lisMenuEncloseInIFDEF); CreateMenuSeparatorSection(mnuSource,itmSourceCodeToolChecks,'itmSourceCodeToolChecks'); ParentMI:=itmSourceCodeToolChecks; @@ -894,7 +894,7 @@ begin itmSourceUncommentBlock.Command:=GetCommand(ecSelectionUncomment); itmSourceToggleComment.Command:=GetCommand(ecToggleComment); itmSourceEncloseBlock.Command:=GetCommand(ecSelectionEnclose); - itmSourceConditionalBlock.Command:=GetCommand(ecSelectionConditional); + itmSourceEncloseInIFDEF.Command:=GetCommand(ecSelectionConditional); itmSourceSyntaxCheck.Command:=GetCommand(ecSyntaxCheck); itmSourceGuessUnclosedBlock.Command:=GetCommand(ecGuessUnclosedBlock); diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 00fe2835bd..e6ebe461d3 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -1153,6 +1153,7 @@ var // refactoring SrcEditMenuCompleteCode: TIDEMenuCommand; SrcEditMenuEncloseSelection: TIDEMenuCommand; + SrcEditMenuEncloseInIFDEF: TIDEMenuCommand; SrcEditMenuRenameIdentifier: TIDEMenuCommand; SrcEditMenuExtractProc: TIDEMenuCommand; SrcEditMenuInvertAssignment: TIDEMenuCommand; @@ -1450,7 +1451,9 @@ begin 'Source',uemSource); AParent:=SrcEditSubMenuSource; SrcEditMenuEncloseSelection := RegisterIDEMenuCommand - (AParent, 'EncloseSelection',lisKMEncloseSelection); + (AParent, 'EncloseSelection',lisMenuEncloseSelection); + SrcEditMenuEncloseInIFDEF := RegisterIDEMenuCommand + (AParent,'itmSourceEncloseInIFDEF',lisMenuEncloseInIFDEF); {%endregion} {%region *** Refactoring Section ***} @@ -5324,6 +5327,7 @@ begin SelAvailAndWritable:=SelAvail and (not ASrcEdit.ReadOnly); // enable menu items SrcEditMenuEncloseSelection.Enabled := SelAvailAndWritable; + SrcEditMenuEncloseInIFDEF.Enabled := SelAvailAndWritable; SrcEditMenuExtractProc.Enabled := SelAvailAndWritable; SrcEditMenuInvertAssignment.Enabled := SelAvailAndWritable; CurWordAtCursor:=ASrcEdit.GetWordAtCurrentCaret; @@ -8517,6 +8521,7 @@ begin {%region *** Refactoring Section ***} SrcEditMenuCompleteCode.Command:=GetCommand(ecCompleteCode); SrcEditMenuEncloseSelection.OnClick:=@EncloseSelectionMenuItemClick; + SrcEditMenuEncloseInIFDEF.Command:=GetCommand(ecSelectionConditional); SrcEditMenuRenameIdentifier.Command:=GetCommand(ecRenameIdentifier); SrcEditMenuFindIdentifierReferences.Command:=GetCommand(ecFindIdentifierRefs); SrcEditMenuExtractProc.Command:=GetCommand(ecExtractProc);