mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 01:48:03 +02:00
IDE: change order of Source Editor popup sections + other fixes.
git-svn-id: trunk@35738 -
This commit is contained in:
parent
80faea06cf
commit
bf285bb78e
@ -1148,6 +1148,11 @@ const
|
||||
SourceEditorMenuRootName = 'SourceEditor';
|
||||
|
||||
var
|
||||
// Clipboard
|
||||
SrcEditMenuCut: TIDEMenuCommand;
|
||||
SrcEditMenuCopy: TIDEMenuCommand;
|
||||
SrcEditMenuPaste: TIDEMenuCommand;
|
||||
SrcEditMenuCopyFilename: TIDEMenuCommand;
|
||||
SrcEditMenuFindDeclaration: TIDEMenuCommand;
|
||||
// finding / jumping
|
||||
SrcEditMenuProcedureJump: TIDEMenuCommand;
|
||||
@ -1159,10 +1164,6 @@ var
|
||||
SrcEditMenuOpenFileAtCursor: TIDEMenuCommand;
|
||||
SrcEditMenuClosePage: TIDEMenuCommand;
|
||||
SrcEditMenuCloseOtherPages: TIDEMenuCommand;
|
||||
SrcEditMenuCut: TIDEMenuCommand;
|
||||
SrcEditMenuCopy: TIDEMenuCommand;
|
||||
SrcEditMenuPaste: TIDEMenuCommand;
|
||||
SrcEditMenuCopyFilename: TIDEMenuCommand;
|
||||
// bookmarks
|
||||
SrcEditMenuNextBookmark: TIDEMenuCommand;
|
||||
SrcEditMenuPrevBookmark: TIDEMenuCommand;
|
||||
@ -1346,10 +1347,20 @@ begin
|
||||
AParent:=SourceEditorMenuRoot;
|
||||
|
||||
// register the first dynamic section for often used context sensitive stuff
|
||||
SrcEditMenuSectionFirstDynamic:=RegisterIDEMenuSection(AParent, 'First dynamic section');
|
||||
SrcEditMenuSectionFirstDynamic:=RegisterIDEMenuSection(SourceEditorMenuRoot, 'First dynamic section');
|
||||
|
||||
{%region *** Clipboard section ***}
|
||||
SrcEditMenuSectionClipboard:=RegisterIDEMenuSection(SourceEditorMenuRoot, 'Clipboard');
|
||||
AParent:=SrcEditMenuSectionClipboard;
|
||||
|
||||
SrcEditMenuCut:=RegisterIDEMenuCommand(AParent,'Cut',lisCut, nil, nil, nil, 'laz_cut');
|
||||
SrcEditMenuCopy:=RegisterIDEMenuCommand(AParent,'Copy',lisCopy, nil, nil, nil, 'laz_copy');
|
||||
SrcEditMenuPaste:=RegisterIDEMenuCommand(AParent,'Paste',lisPaste, nil, nil, nil, 'laz_paste');
|
||||
SrcEditMenuCopyFilename:=RegisterIDEMenuCommand(AParent,'Copy filename', uemCopyFilename);
|
||||
{%endregion}
|
||||
|
||||
{%region *** first static section *** }
|
||||
SrcEditMenuSectionFirstStatic:=RegisterIDEMenuSection(AParent, 'First static section');
|
||||
SrcEditMenuSectionFirstStatic:=RegisterIDEMenuSection(SourceEditorMenuRoot, 'First static section');
|
||||
AParent:=SrcEditMenuSectionFirstStatic;
|
||||
|
||||
SrcEditMenuFindDeclaration := RegisterIDEMenuCommand
|
||||
@ -1403,16 +1414,6 @@ begin
|
||||
{%endregion}
|
||||
{%endregion}
|
||||
|
||||
{%region *** Clipboard section ***}
|
||||
SrcEditMenuSectionClipboard:=RegisterIDEMenuSection(SourceEditorMenuRoot, 'Clipboard');
|
||||
AParent:=SrcEditMenuSectionClipboard;
|
||||
|
||||
SrcEditMenuCut:=RegisterIDEMenuCommand(AParent,'Cut',lisCut, nil, nil, nil, 'laz_cut');
|
||||
SrcEditMenuCopy:=RegisterIDEMenuCommand(AParent,'Copy',lisCopy, nil, nil, nil, 'laz_copy');
|
||||
SrcEditMenuPaste:=RegisterIDEMenuCommand(AParent,'Paste',lisPaste, nil, nil, nil, 'laz_paste');
|
||||
SrcEditMenuCopyFilename:=RegisterIDEMenuCommand(AParent,'Copy filename', uemCopyFilename);
|
||||
{%endregion}
|
||||
|
||||
{%region *** Goto Marks section ***}
|
||||
SrcEditMenuSectionMarks:=RegisterIDEMenuSection(SourceEditorMenuRoot, 'Marks section');
|
||||
// register the Goto Bookmarks Submenu
|
||||
@ -5367,19 +5368,20 @@ var
|
||||
NBAvail: Boolean;
|
||||
PageCtrl: TPageControl;
|
||||
PopM: TPopupMenu;
|
||||
PageI: integer;
|
||||
begin
|
||||
PopM:=TPopupMenu(Sender);
|
||||
SourceTabMenuRoot.MenuItem:=PopM.Items;
|
||||
SourceTabMenuRoot.BeginUpdate;
|
||||
try
|
||||
RemoveUserDefinedMenuItems;
|
||||
RemoveContextMenuItems;
|
||||
|
||||
// Get the tab that was clicked
|
||||
Assert(PopM.PopupComponent is TPageControl, 'PopupComponent is not TPageControl');
|
||||
PageCtrl:=TPageControl(PopM.PopupComponent);
|
||||
PageIndex:=PageCtrl.TabIndexAtClientPos(PageCtrl.ScreenToClient(PopM.PopupPoint));
|
||||
//DebugLn(['TSourceNotebook.TabPopUpMenuPopup: Popup PageIndex=', PageIndex]);
|
||||
PageI:=PageCtrl.TabIndexAtClientPos(PageCtrl.ScreenToClient(PopM.PopupPoint));
|
||||
if (PageI>=0) and (PageI<PageCtrl.PageCount) then
|
||||
PageIndex:=PageI
|
||||
else
|
||||
DebugLn(['TSourceNotebook.TabPopUpMenuPopup: Popup PageIndex=', PageI]);
|
||||
ASrcEdit:=Editors[PageIndex];
|
||||
|
||||
// editor layout
|
||||
@ -5447,17 +5449,24 @@ var
|
||||
Marks: PSourceMark;
|
||||
i, MarkCount: integer;
|
||||
EditorPopupPoint, EditorCaret: TPoint;
|
||||
SelAvail, SelAvailAndWritable: Boolean;
|
||||
SelAvail, SelAvailAndWritable, AtIdentifier: Boolean;
|
||||
CurWordAtCursor: String;
|
||||
AtIdentifier: Boolean;
|
||||
begin
|
||||
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
||||
SourceEditorMenuRoot.BeginUpdate;
|
||||
try
|
||||
RemoveUserDefinedMenuItems;
|
||||
RemoveContextMenuItems;
|
||||
|
||||
ASrcEdit:=FindSourceEditorWithEditorComponent(TPopupMenu(Sender).PopupComponent);
|
||||
Assert(Assigned(ASrcEdit), 'TSourceNotebook.SrcPopUpMenuPopup: ASrcEdit=nil');
|
||||
EditorComp:=ASrcEdit.EditorComponent;
|
||||
|
||||
// Clipboard section:
|
||||
SrcEditMenuCut.Enabled := ASrcEdit.SelectionAvailable and not ASrcEdit.ReadOnly;
|
||||
SrcEditMenuCopy.Enabled := ASrcEdit.SelectionAvailable;
|
||||
SrcEditMenuPaste.Enabled := not ASrcEdit.ReadOnly;
|
||||
|
||||
// Files section: Readonly, ShowLineNumbers
|
||||
SrcEditMenuReadOnly.Checked:=ASrcEdit.ReadOnly;
|
||||
SrcEditMenuShowLineNumbers.Checked := ASrcEdit.EditorComponent.Gutter.LineNumberPart.Visible;
|
||||
@ -5510,11 +5519,6 @@ begin
|
||||
true,@OnPopupMenuOpenFile);
|
||||
end;
|
||||
|
||||
// Clipboard
|
||||
SrcEditMenuCut.Enabled := ASrcEdit.SelectionAvailable and not ASrcEdit.ReadOnly;
|
||||
SrcEditMenuCopy.Enabled := ASrcEdit.SelectionAvailable;
|
||||
SrcEditMenuPaste.Enabled := not ASrcEdit.ReadOnly;
|
||||
|
||||
// bookmarks
|
||||
for BookMarkID:=0 to 9 do begin
|
||||
MarkDesc:=' '+IntToStr(BookMarkID);
|
||||
|
@ -390,10 +390,10 @@ var
|
||||
// Source Editor: First dynamic section for often used context sensitive stuff
|
||||
// The items are cleared automatically after each popup.
|
||||
SrcEditMenuSectionFirstDynamic: TIDEMenuSection;
|
||||
SrcEditMenuSectionClipboard: TIDEMenuSection;
|
||||
SrcEditMenuSectionFirstStatic: TIDEMenuSection;
|
||||
SrcEditSubMenuFind: TIDEMenuSection;
|
||||
SrcEditMenuSectionFiles: TIDEMenuSection;
|
||||
SrcEditMenuSectionClipboard: TIDEMenuSection;
|
||||
SrcEditMenuSectionMarks: TIDEMenuSection;
|
||||
SrcEditSubMenuGotoBookmarks: TIDEMenuSection;
|
||||
SrcEditSubMenuToggleBookmarks: TIDEMenuSection;
|
||||
|
Loading…
Reference in New Issue
Block a user