mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 17:29:31 +02:00
IDEIntf: fixed crash on TIDEMenuSection.Clear, bug #30574
git-svn-id: branches/fixes_1_6@52936 -
This commit is contained in:
parent
e8d8a7b44e
commit
ae9d3b9797
@ -129,6 +129,7 @@ type
|
|||||||
procedure SetChildrenAsSubMenu(const AValue: boolean); virtual;
|
procedure SetChildrenAsSubMenu(const AValue: boolean); virtual;
|
||||||
procedure SetVisible(const AValue: Boolean); override;
|
procedure SetVisible(const AValue: Boolean); override;
|
||||||
procedure SetSubMenuImages(const AValue: TCustomImageList); virtual;
|
procedure SetSubMenuImages(const AValue: TCustomImageList); virtual;
|
||||||
|
procedure SetMenuItem(const AValue: TMenuItem); override;
|
||||||
procedure ClearMenuItems; override;
|
procedure ClearMenuItems; override;
|
||||||
procedure FreeTopSeparator;
|
procedure FreeTopSeparator;
|
||||||
procedure FreeBottomSeparator;
|
procedure FreeBottomSeparator;
|
||||||
@ -972,6 +973,15 @@ begin
|
|||||||
MenuItem.SubMenuImages:=SubMenuImages;
|
MenuItem.SubMenuImages:=SubMenuImages;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TIDEMenuSection.SetMenuItem(const AValue: TMenuItem);
|
||||||
|
begin
|
||||||
|
inherited SetMenuItem(AValue);
|
||||||
|
if (Section=nil) and (MenuItem<>nil) then begin
|
||||||
|
// root section -> create menu items
|
||||||
|
UpdateContainer;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TIDEMenuSection.ClearMenuItems;
|
procedure TIDEMenuSection.ClearMenuItems;
|
||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
@ -1062,6 +1072,7 @@ var
|
|||||||
SubSection: TIDEMenuSection;
|
SubSection: TIDEMenuSection;
|
||||||
aVisible: Boolean;
|
aVisible: Boolean;
|
||||||
begin
|
begin
|
||||||
|
if imssClearing in aSection.FStates then exit;
|
||||||
aVisible:=aSection.RealVisible;
|
aVisible:=aSection.RealVisible;
|
||||||
for i:=0 to aSection.Count-1 do begin
|
for i:=0 to aSection.Count-1 do begin
|
||||||
Item:=aSection[i];
|
Item:=aSection[i];
|
||||||
|
@ -2754,8 +2754,6 @@ var
|
|||||||
VisibleCnt: Integer;
|
VisibleCnt: Integer;
|
||||||
begin
|
begin
|
||||||
MessagesMenuRoot.MenuItem:=MsgCtrlPopupMenu.Items;
|
MessagesMenuRoot.MenuItem:=MsgCtrlPopupMenu.Items;
|
||||||
MessagesMenuRoot.BeginUpdate;
|
|
||||||
try
|
|
||||||
HasText:=false;
|
HasText:=false;
|
||||||
HasFilename:=false;
|
HasFilename:=false;
|
||||||
MsgType:='';
|
MsgType:='';
|
||||||
@ -2891,9 +2889,6 @@ begin
|
|||||||
UpdateFilterItems;
|
UpdateFilterItems;
|
||||||
|
|
||||||
UpdateQuickFixes(Line);
|
UpdateQuickFixes(Line);
|
||||||
finally
|
|
||||||
MessagesMenuRoot.EndUpdate;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMessagesFrame.OnSelectFilterClick(Sender: TObject);
|
procedure TMessagesFrame.OnSelectFilterClick(Sender: TObject);
|
||||||
|
@ -6528,8 +6528,6 @@ var
|
|||||||
begin
|
begin
|
||||||
PopM:=TPopupMenu(Sender);
|
PopM:=TPopupMenu(Sender);
|
||||||
SourceTabMenuRoot.MenuItem:=PopM.Items;
|
SourceTabMenuRoot.MenuItem:=PopM.Items;
|
||||||
SourceTabMenuRoot.BeginUpdate;
|
|
||||||
try
|
|
||||||
// Get the tab that was clicked
|
// Get the tab that was clicked
|
||||||
if PopM.PopupComponent is TPageControl then begin
|
if PopM.PopupComponent is TPageControl then begin
|
||||||
PageCtrl:=TPageControl(PopM.PopupComponent);
|
PageCtrl:=TPageControl(PopM.PopupComponent);
|
||||||
@ -6629,9 +6627,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
finally
|
|
||||||
SourceTabMenuRoot.EndUpdate;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.SrcPopUpMenuPopup(Sender: TObject);
|
procedure TSourceNotebook.SrcPopUpMenuPopup(Sender: TObject);
|
||||||
@ -6666,8 +6661,6 @@ begin
|
|||||||
IDECommandList.ExecuteUpdateEvents;
|
IDECommandList.ExecuteUpdateEvents;
|
||||||
|
|
||||||
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
SourceEditorMenuRoot.MenuItem:=SrcPopupMenu.Items;
|
||||||
SourceEditorMenuRoot.BeginUpdate;
|
|
||||||
try
|
|
||||||
RemoveUserDefinedMenuItems;
|
RemoveUserDefinedMenuItems;
|
||||||
RemoveContextMenuItems;
|
RemoveContextMenuItems;
|
||||||
|
|
||||||
@ -6750,9 +6743,7 @@ begin
|
|||||||
if Assigned(Manager.OnPopupMenu) then
|
if Assigned(Manager.OnPopupMenu) then
|
||||||
Manager.OnPopupMenu(@AddContextPopupMenuItem);
|
Manager.OnPopupMenu(@AddContextPopupMenuItem);
|
||||||
SourceEditorMenuRoot.NotifySubSectionOnShow(Self);
|
SourceEditorMenuRoot.NotifySubSectionOnShow(Self);
|
||||||
finally
|
//SrcPopupMenu.Items.WriteDebugReport('TSourceNotebook.SrcPopUpMenuPopup() ');
|
||||||
SourceEditorMenuRoot.EndUpdate;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.DbgPopUpMenuPopup(Sender: TObject);
|
procedure TSourceNotebook.DbgPopUpMenuPopup(Sender: TObject);
|
||||||
@ -6809,8 +6800,6 @@ begin
|
|||||||
Images := IDEImages.Images_16;
|
Images := IDEImages.Images_16;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// assign the root TMenuItem to the registered menu root.
|
|
||||||
// This will automatically create all registered items
|
|
||||||
{$IFDEF VerboseMenuIntf}
|
{$IFDEF VerboseMenuIntf}
|
||||||
SrcPopupMenu.Items.WriteDebugReport('TSourceNotebook.BuildPopupMenu ');
|
SrcPopupMenu.Items.WriteDebugReport('TSourceNotebook.BuildPopupMenu ');
|
||||||
SourceTabMenuRoot.ConsistencyCheck;
|
SourceTabMenuRoot.ConsistencyCheck;
|
||||||
|
Loading…
Reference in New Issue
Block a user