cocoa: check the processing event flag returned from callback object on MouseDown for CocoaListBox and CocoaTextView. (revert of previous patches in #30297 and #30131)

git-svn-id: trunk@57085 -
This commit is contained in:
dmitry 2018-01-14 06:54:15 +00:00
parent 7b2be45ba9
commit 48ff0f78f8

View File

@ -2563,14 +2563,17 @@ end;
procedure TCocoaTextView.mouseDown(event: NSEvent); procedure TCocoaTextView.mouseDown(event: NSEvent);
begin begin
inherited mouseDown(event); if Assigned(callback) then
if callback <> nil then
begin begin
callback.MouseUpDownEvent(event); if not callback.MouseUpDownEvent(event) then
inherited mouseDown(event);
// Cocoa doesn't call mouseUp for NSTextView, so we have to emulate it here :( // Cocoa doesn't call mouseUp for NSTextView, so we have to emulate it here :(
// See bug 29000 // See bug 29000
if Assigned(callback) then
callback.MouseUpDownEvent(event, True); callback.MouseUpDownEvent(event, True);
end; end else
inherited mouseDown(event);
end; end;
procedure TCocoaTextView.mouseUp(event: NSEvent); procedure TCocoaTextView.mouseUp(event: NSEvent);
@ -3518,8 +3521,7 @@ end;
procedure TCocoaListBox.mouseDown(event: NSEvent); procedure TCocoaListBox.mouseDown(event: NSEvent);
begin begin
if Assigned(callback) then callback.MouseUpDownEvent(event); if Assigned(callback) and not callback.MouseUpDownEvent(event) then
// Always call inherited, otherwise clicking stops working, see bug 30297
inherited mouseDown(event); inherited mouseDown(event);
end; end;