mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 13:08:15 +02:00
win32: fix setting TMenuItem.Visible := True in the top menu bar. Issue #39458
This commit is contained in:
parent
c5c2329f62
commit
89cd2a1045
@ -1496,6 +1496,8 @@ begin
|
||||
if AValue then
|
||||
begin
|
||||
FVisible := AValue;
|
||||
if MergedParent<>nil then
|
||||
MergedParent.InvalidateMergedItems;
|
||||
if (not (csLoading in ComponentState)) and (Parent<>nil)
|
||||
and Parent.HandleAllocated then
|
||||
HandleNeeded;
|
||||
@ -1509,9 +1511,9 @@ begin
|
||||
DestroyHandle;
|
||||
end;
|
||||
FVisible := AValue;
|
||||
if MergedParent<>nil then
|
||||
MergedParent.InvalidateMergedItems;
|
||||
end;
|
||||
if MergedParent<>nil then
|
||||
MergedParent.InvalidateMergedItems;
|
||||
end;
|
||||
|
||||
procedure TMenuItem.UpdateImage(forced: Boolean);
|
||||
|
@ -1472,10 +1472,7 @@ begin
|
||||
|
||||
ItemIndex := AMenuItem.MergedParent.VisibleIndexOf(AMenuItem);
|
||||
if ItemIndex<0 then
|
||||
begin
|
||||
DebugLn(['Invisible menu item: ', AMenuItem.Name, ' (', AMenuItem.Caption, ')']);
|
||||
Exit;
|
||||
end;
|
||||
RaiseGDBException('Invisible menu item: '+AMenuItem.Name+' ('+AMenuItem.Caption+')');
|
||||
// MDI forms with a maximized MDI child insert a menu at the first index for
|
||||
// the MDI child's window menu, so we need to take that into account
|
||||
if Assigned(Application.MainForm) and
|
||||
|
Loading…
Reference in New Issue
Block a user