mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-05 13:38:08 +02:00
Packager: Support Sender as TIDEMenuItem in function GetPackageOfEditorItem. Affects ToDo list with packages etc.
This commit is contained in:
parent
697a7c6612
commit
083741b251
@ -90,7 +90,8 @@ type
|
||||
public
|
||||
property Bitmap: TBitmap read GetBitmap write SetBitmap;
|
||||
property Section: TIDEMenuSection read FSection write SetSection;
|
||||
property MenuItem: TMenuItem read FMenuItem write SetMenuItem; // Note: root section MenuItem = TMenu.Items, setting a non root does not add to Section.MenuItem
|
||||
// Note: root section MenuItem=TMenu.Items, setting a non root does not add to Section.MenuItem
|
||||
property MenuItem: TMenuItem read FMenuItem write SetMenuItem;
|
||||
property MenuItemClass: TMenuItemClass read FMenuItemClass write FMenuItemClass;
|
||||
property SectionIndex: Integer read FSectionIndex;
|
||||
property Tag: Integer read FTag write FTag;
|
||||
|
@ -5385,8 +5385,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TPkgManager.ApplyDependency(CurDependency: TPkgDependency
|
||||
): TModalResult;
|
||||
function TPkgManager.ApplyDependency(CurDependency: TPkgDependency): TModalResult;
|
||||
// apply
|
||||
var
|
||||
OldPkg: TLazPackage;
|
||||
@ -5416,10 +5415,11 @@ end;
|
||||
function TPkgManager.GetPackageOfEditorItem(Sender: TObject): TIDEPackage;
|
||||
begin
|
||||
Result:=nil;
|
||||
if Sender is TIDEMenuItem then
|
||||
Sender:=TIDEMenuItem(Sender).MenuItem;
|
||||
while (Sender is TMenuItem) and (TMenuItem(Sender).Parent<>nil) do
|
||||
Sender:=TMenuItem(Sender).Parent;
|
||||
if (Sender is TMenuItem) and (TMenuItem(Sender).Menu<>nil)
|
||||
then
|
||||
if (Sender is TMenuItem) and (TMenuItem(Sender).Menu<>nil) then
|
||||
Sender:=TMenuItem(Sender).Menu;
|
||||
if (Sender is TComponent) and (TComponent(Sender).Owner is TCustomForm) then
|
||||
Sender:=TCustomForm(TComponent(Sender).Owner);
|
||||
|
Loading…
Reference in New Issue
Block a user