mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 23:40:22 +02:00
IDE: Rename menu item "Insert IFDEF" to "Enclose in IFDEF" and add to editor popup menu, too.
git-svn-id: trunk@29866 -
This commit is contained in:
parent
a06b201599
commit
3a842efb11
@ -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);
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
@ -204,7 +204,7 @@ type
|
||||
itmSourceUncommentBlock: TIDEMenuCommand;
|
||||
itmSourceToggleComment: TIDEMenuCommand;
|
||||
itmSourceEncloseBlock: TIDEMenuCommand;
|
||||
itmSourceConditionalBlock: TIDEMenuCommand;
|
||||
itmSourceEncloseInIFDEF: TIDEMenuCommand;
|
||||
//itmSourceCodeToolChecks: TIDEMenuSection;
|
||||
itmSourceSyntaxCheck: TIDEMenuCommand;
|
||||
itmSourceGuessUnclosedBlock: TIDEMenuCommand;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user