mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-24 19:59:37 +02:00
carbon: menu disabling counter is added for included modal calls. (modal window shows another modal window)
git-svn-id: trunk@23871 -
This commit is contained in:
parent
96172c3bcd
commit
7c12e786fa
@ -68,6 +68,7 @@ type
|
||||
FTimerMap: TMap; // the map contains all installed timers
|
||||
FCurrentCursor: HCURSOR;
|
||||
FMainMenu: HMENU; // Main menu attached to menu bar
|
||||
FMenuDisableCount: Integer; // The modal menu counter
|
||||
FCaptureWidget: HWND; // Captured widget (TCarbonWidget descendant)
|
||||
FFocusedWidget: HWND; // Forced Focus widgetset (TCarbonWidget descendant)
|
||||
FOpenEventHandlerUPP: AEEventHandlerUPP;
|
||||
|
@ -553,11 +553,19 @@ begin
|
||||
{$IFDEF VerboseLCLIntf}
|
||||
DebugLn('TCarbonWidgetSet.SetMainMenuEnabled AEnabled: ' + DbgS(AEnabled));
|
||||
{$ENDIF}
|
||||
|
||||
|
||||
if AEnabled then
|
||||
dec(FMenuDisableCount)
|
||||
else
|
||||
inc(FMenuDisableCount);
|
||||
|
||||
if FMainMenu <> 0 then
|
||||
begin
|
||||
if csDesigning in TCarbonMenu(FMainMenu).LCLMenuItem.ComponentState then Exit;
|
||||
TCarbonMenu(FMainMenu).SetEnable(AEnabled);
|
||||
|
||||
if (AEnabled and (FMenuDisableCount=0)) or
|
||||
((not AEnabled) and (FMenuDisableCount<>0)) then
|
||||
TCarbonMenu(FMainMenu).SetEnable(AEnabled);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user