Cocoa: fix the right click issue #41676

This commit is contained in:
rich2014 2025-05-25 22:35:31 +08:00
parent b23e7b9764
commit 4e66385e73

View File

@ -207,6 +207,9 @@ type
procedure setCaptionEditor( captionEditor: TCocoaTextField ); message 'setCaptionEditor:';
procedure setCaptionFont( captionFont: NSFont ); message 'setCaptionFont:';
procedure setCaptionAlignment( alignment: NSTextAlignment ); message 'setCaptionAlignment:';
procedure rightMouseDown(event: NSEvent); override;
procedure rightMouseUp(event: NSEvent); override;
end;
implementation
@ -273,6 +276,18 @@ begin
_captionEditor.setAlignment( _captionAlignment );
end;
procedure TCocoaListView.rightMouseDown(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited;
end;
procedure TCocoaListView.rightMouseUp(event: NSEvent);
begin
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
inherited;
end;
procedure TCocoaListView.setViewStyle(viewStyle: TViewStyle);
begin
if Assigned(_backendControl) and (_viewStyle=viewStyle) then