mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 11:38:04 +02:00
IDE: Create new MenuItems for bookmarks. A MenuItem cannot be used for many parent menus. Issue #39540.
This commit is contained in:
parent
4b4b6acc20
commit
4ac1f026c2
@ -74,6 +74,7 @@ type
|
||||
function GetImageList: TCustomImageList; virtual;
|
||||
function HasBitmap: Boolean;
|
||||
procedure CreateMenuItem; virtual; // only create and set properties, does not add to Section.MenuItem
|
||||
procedure CreateNewMenuItem;
|
||||
function GetPath: string;
|
||||
function GetRoot: TIDEMenuItem;
|
||||
function VisibleActive: boolean; virtual;
|
||||
@ -791,6 +792,12 @@ begin
|
||||
MenuItem:=MenuItemClass.Create(nil);
|
||||
end;
|
||||
|
||||
procedure TIDEMenuItem.CreateNewMenuItem;
|
||||
begin
|
||||
FMenuItem.Free;
|
||||
MenuItem:=MenuItemClass.Create(nil);
|
||||
end;
|
||||
|
||||
function TIDEMenuItem.GetPath: string;
|
||||
var
|
||||
Item: TIDEMenuItem;
|
||||
|
@ -311,7 +311,6 @@ begin
|
||||
FPosition := -1;
|
||||
end;
|
||||
|
||||
|
||||
function TIDEToolButtonsEnumerator.GetCurrent: TIDEToolButton;
|
||||
begin
|
||||
Result := FList[FPosition];
|
||||
|
@ -1877,16 +1877,16 @@ end;
|
||||
|
||||
procedure TToolButton_GotoBookmarks.RefreshMenu;
|
||||
var
|
||||
i: TIDEMenuCommand;
|
||||
cmd: TIDEMenuCommand;
|
||||
begin
|
||||
for i in SrcEditMenuGotoBookmark do
|
||||
if i <> nil then begin
|
||||
i.CreateMenuItem;
|
||||
DropdownMenu.Items.Add(i.MenuItem);
|
||||
for cmd in SrcEditMenuGotoBookmark do
|
||||
if cmd <> nil then begin
|
||||
cmd.CreateNewMenuItem;
|
||||
DropdownMenu.Items.Add(cmd.MenuItem);
|
||||
end;
|
||||
DropdownMenu.Items.AddSeparator;
|
||||
SrcEditMenuPrevBookmark.CreateMenuItem;
|
||||
SrcEditMenuNextBookmark.CreateMenuItem;
|
||||
SrcEditMenuPrevBookmark.CreateNewMenuItem;
|
||||
SrcEditMenuNextBookmark.CreateNewMenuItem;
|
||||
DropdownMenu.Items.Add([
|
||||
SrcEditMenuPrevBookmark.MenuItem,
|
||||
SrcEditMenuNextBookmark.MenuItem]);
|
||||
@ -1907,19 +1907,19 @@ end;
|
||||
|
||||
procedure TToolButton_ToggleBookmarks.RefreshMenu;
|
||||
var
|
||||
i: TIDEMenuCommand;
|
||||
cmd: TIDEMenuCommand;
|
||||
begin
|
||||
for i in SrcEditMenuToggleBookmark do
|
||||
if i <> nil then begin
|
||||
i.CreateMenuItem;
|
||||
DropdownMenu.Items.Add(i.MenuItem);
|
||||
for cmd in SrcEditMenuToggleBookmark do
|
||||
if cmd <> nil then begin
|
||||
cmd.CreateNewMenuItem;
|
||||
DropdownMenu.Items.Add(cmd.MenuItem);
|
||||
end;
|
||||
DropdownMenu.Items.AddSeparator;
|
||||
SrcEditMenuSetFreeBookmark.CreateMenuItem;
|
||||
SrcEditMenuSetFreeBookmark.CreateNewMenuItem;
|
||||
DropdownMenu.Items.Add(SrcEditMenuSetFreeBookmark.MenuItem);
|
||||
DropdownMenu.Items.AddSeparator;
|
||||
SrcEditMenuClearFileBookmark.CreateMenuItem;
|
||||
SrcEditMenuClearAllBookmark.CreateMenuItem;
|
||||
SrcEditMenuClearFileBookmark.CreateNewMenuItem;
|
||||
SrcEditMenuClearAllBookmark.CreateNewMenuItem;
|
||||
DropdownMenu.Items.Add([
|
||||
SrcEditMenuClearFileBookmark.MenuItem,
|
||||
SrcEditMenuClearAllBookmark.MenuItem]);
|
||||
|
Loading…
Reference in New Issue
Block a user