mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-24 20:48:24 +02:00
LCL-Cocoa: Update a changed main menu correctly. Issue #30809, patch from Zoë Peterson.
git-svn-id: trunk@54635 -
This commit is contained in:
parent
ae6948b6b3
commit
1ea9fd9ddd
@ -2250,6 +2250,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCocoaWidgetSet.SetMenu(AWindowHandle: HWND; AMenuHandle: HMENU): Boolean;
|
||||||
|
var
|
||||||
|
lWin: NSWindow;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
lWin := GetNSObjectWindow(NSObject(AWindowHandle));
|
||||||
|
if (lWin <> nil) and lWin.isKindOfClass(TCocoaWindow) and
|
||||||
|
(TCocoaWindow(lWin).LCLForm.Menu.Handle = AMenuHandle) then
|
||||||
|
begin
|
||||||
|
if lWin.isKeyWindow or lWin.isMainWindow then
|
||||||
|
SetMainMenu(AMenuHandle, TCocoaWindow(lWin).LCLForm.Menu);
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------- FONT AND TEXT --------------------------------}
|
{------------------------------- FONT AND TEXT --------------------------------}
|
||||||
|
|
||||||
function TCocoaWidgetSet.SetTextColor(DC: HDC; Color: TColorRef): TColorRef;
|
function TCocoaWidgetSet.SetTextColor(DC: HDC; Color: TColorRef): TColorRef;
|
||||||
|
@ -169,6 +169,7 @@ function SetCursor(ACursor: HCURSOR): HCURSOR; override;
|
|||||||
function SetCursorPos(X, Y: Integer): Boolean; override;
|
function SetCursorPos(X, Y: Integer): Boolean; override;
|
||||||
function SetFocus(Handle: HWND): HWND; override;
|
function SetFocus(Handle: HWND): HWND; override;
|
||||||
function SetForegroundWindow(HWnd: HWND): boolean; override;
|
function SetForegroundWindow(HWnd: HWND): boolean; override;
|
||||||
|
function SetMenu(AWindowHandle: HWND; AMenuHandle: HMENU): Boolean; override;
|
||||||
function SetProp(Handle: hwnd; Str: PChar; Data: Pointer) : Boolean; override;
|
function SetProp(Handle: hwnd; Str: PChar; Data: Pointer) : Boolean; override;
|
||||||
function SetROP2(DC: HDC; Mode: Integer): Integer; override;
|
function SetROP2(DC: HDC; Mode: Integer): Integer; override;
|
||||||
function SetScrollInfo(Handle : HWND; SBStyle : Integer; ScrollInfo: TScrollInfo; bRedraw : Boolean): Integer; override;
|
function SetScrollInfo(Handle : HWND; SBStyle : Integer; ScrollInfo: TScrollInfo; bRedraw : Boolean): Integer; override;
|
||||||
|
Loading…
Reference in New Issue
Block a user