mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-29 08:17:20 +01:00
cocoa: mouse events for combobox variations
git-svn-id: trunk@58567 -
This commit is contained in:
parent
d4617b1af9
commit
883ad89f33
@ -209,6 +209,19 @@ type
|
|||||||
//
|
//
|
||||||
function lclIsHandle: Boolean; override;
|
function lclIsHandle: Boolean; override;
|
||||||
procedure setStringValue(avalue: NSString); override;
|
procedure setStringValue(avalue: NSString); override;
|
||||||
|
// mouse
|
||||||
|
function acceptsFirstMouse(event: NSEvent): Boolean; override;
|
||||||
|
procedure mouseDown(event: NSEvent); override;
|
||||||
|
procedure mouseUp(event: NSEvent); override;
|
||||||
|
procedure rightMouseDown(event: NSEvent); override;
|
||||||
|
procedure rightMouseUp(event: NSEvent); override;
|
||||||
|
procedure rightMouseDragged(event: NSEvent); override;
|
||||||
|
procedure otherMouseDown(event: NSEvent); override;
|
||||||
|
procedure otherMouseUp(event: NSEvent); override;
|
||||||
|
procedure otherMouseDragged(event: NSEvent); override;
|
||||||
|
procedure mouseDragged(event: NSEvent); override;
|
||||||
|
procedure mouseMoved(event: NSEvent); override;
|
||||||
|
procedure scrollWheel(event: NSEvent); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaReadOnlyComboBox }
|
{ TCocoaReadOnlyComboBox }
|
||||||
@ -230,6 +243,19 @@ type
|
|||||||
function lclIsHandle: Boolean; override;
|
function lclIsHandle: Boolean; override;
|
||||||
procedure comboboxAction(sender: id); message 'comboboxAction:';
|
procedure comboboxAction(sender: id); message 'comboboxAction:';
|
||||||
function stringValue: NSString; override;
|
function stringValue: NSString; override;
|
||||||
|
// mouse
|
||||||
|
function acceptsFirstMouse(event: NSEvent): Boolean; override;
|
||||||
|
procedure mouseDown(event: NSEvent); override;
|
||||||
|
procedure mouseUp(event: NSEvent); override;
|
||||||
|
procedure rightMouseDown(event: NSEvent); override;
|
||||||
|
procedure rightMouseUp(event: NSEvent); override;
|
||||||
|
procedure rightMouseDragged(event: NSEvent); override;
|
||||||
|
procedure otherMouseDown(event: NSEvent); override;
|
||||||
|
procedure otherMouseUp(event: NSEvent); override;
|
||||||
|
procedure otherMouseDragged(event: NSEvent); override;
|
||||||
|
procedure mouseDragged(event: NSEvent); override;
|
||||||
|
procedure mouseMoved(event: NSEvent); override;
|
||||||
|
procedure scrollWheel(event: NSEvent); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TCocoaSpinEdit }
|
{ TCocoaSpinEdit }
|
||||||
@ -1045,6 +1071,81 @@ begin
|
|||||||
callback.ComboBoxSelectionIsChanging;
|
callback.ComboBoxSelectionIsChanging;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCocoaComboBox.acceptsFirstMouse(event: NSEvent): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.mouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
begin
|
||||||
|
inherited mouseDown(event);
|
||||||
|
|
||||||
|
callback.MouseUpDownEvent(event, true);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.mouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited mouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.rightMouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseDown(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.rightMouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.rightMouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.otherMouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited otherMouseDown(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.otherMouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited otherMouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.otherMouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited otherMouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.mouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited mouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.mouseMoved(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited mouseMoved(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaComboBox.scrollWheel(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.scrollWheel(event) then
|
||||||
|
inherited scrollWheel(event);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCocoaReadOnlyComboBox }
|
{ TCocoaReadOnlyComboBox }
|
||||||
|
|
||||||
function TCocoaReadOnlyComboBox.acceptsFirstResponder: Boolean;
|
function TCocoaReadOnlyComboBox.acceptsFirstResponder: Boolean;
|
||||||
@ -1115,6 +1216,81 @@ begin
|
|||||||
Result:=inherited stringValue;
|
Result:=inherited stringValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCocoaReadOnlyComboBox.acceptsFirstMouse(event: NSEvent): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.mouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
begin
|
||||||
|
inherited mouseDown(event);
|
||||||
|
|
||||||
|
callback.MouseUpDownEvent(event, true);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.mouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited mouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.rightMouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseDown(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.rightMouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.rightMouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited rightMouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.otherMouseDown(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited otherMouseDown(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.otherMouseUp(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseUpDownEvent(event) then
|
||||||
|
inherited otherMouseUp(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.otherMouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited otherMouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.mouseDragged(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited mouseDragged(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.mouseMoved(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.MouseMove(event) then
|
||||||
|
inherited mouseMoved(event);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCocoaReadOnlyComboBox.scrollWheel(event: NSEvent);
|
||||||
|
begin
|
||||||
|
if not Assigned(callback) or not callback.scrollWheel(event) then
|
||||||
|
inherited scrollWheel(event);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TCocoaSpinEdit }
|
{ TCocoaSpinEdit }
|
||||||
|
|
||||||
{$IFDEF COCOA_SPINEDIT_INSIDE_CONTAINER}
|
{$IFDEF COCOA_SPINEDIT_INSIDE_CONTAINER}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user