mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-27 00:03:48 +02:00
carbon: use ssDouble, ssTriple and ssQuad in MouseUp handlers
git-svn-id: trunk@51575 -
This commit is contained in:
parent
14cd12d46f
commit
9ff17efea7
lcl/interfaces/carbon
@ -273,7 +273,12 @@ begin
|
||||
Msg.XPos := P.X;
|
||||
Msg.YPos := P.Y;
|
||||
Msg.Keys := GetCarbonMsgKeyState;
|
||||
|
||||
case GetCarbonMouseClickCount(AEvent) of
|
||||
2: Msg.Keys := msg.Keys or MK_DOUBLECLICK;
|
||||
3: Msg.Keys := msg.Keys or MK_TRIPLECLICK;
|
||||
4: Msg.Keys := msg.Keys or MK_QUADCLICK;
|
||||
end;
|
||||
|
||||
LastMousePos := P;
|
||||
|
||||
if (AWidget is TCarbonControl) and
|
||||
|
@ -80,21 +80,6 @@ const
|
||||
//
|
||||
// helper functions used commonly
|
||||
//
|
||||
function GetClickCount: Integer;
|
||||
var
|
||||
ClickCount: UInt32;
|
||||
begin
|
||||
Result := 1;
|
||||
|
||||
if OSError(
|
||||
GetEventParameter(AEvent, kEventParamClickCount, typeUInt32, nil,
|
||||
SizeOf(ClickCount), nil, @ClickCount),
|
||||
SName, SGetEvent, 'kEventParamClickCount') then Exit;
|
||||
|
||||
Result := Integer(ClickCount);
|
||||
{debugln('GetClickCount ClickCount=',dbgs(ClickCount));}
|
||||
end;
|
||||
|
||||
function GetMousePoint: TPoint;
|
||||
var
|
||||
MousePoint: HIPoint;
|
||||
@ -167,7 +152,7 @@ const
|
||||
{$ENDIF}
|
||||
Msg := @AMsg;
|
||||
|
||||
ClickCount := GetClickCount;
|
||||
ClickCount := GetCarbonMouseClickCount(AEvent);
|
||||
MouseButton := GetCarbonMouseButton(AEvent);
|
||||
MousePoint := GetMousePoint;
|
||||
|
||||
|
@ -66,6 +66,7 @@ function VirtualKeyCodeToMac(AKey: Word): Word;
|
||||
function GetBorderWindowAttrs(const ABorderStyle: TFormBorderStyle;
|
||||
const ABorderIcons: TBorderIcons): WindowAttributes;
|
||||
|
||||
function GetCarbonMouseClickCount(AEvent: EventRef): Integer;
|
||||
function GetCarbonMouseButton(AEvent: EventRef): Integer;
|
||||
function GetCarbonMsgKeyState: PtrInt;
|
||||
function GetCarbonShiftState: TShiftState;
|
||||
@ -377,6 +378,27 @@ begin
|
||||
kWindowCollapseBoxAttribute or kWindowFullZoomAttribute);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: GetCarbonMouseClickCount
|
||||
Returns: The click count of mouse
|
||||
------------------------------------------------------------------------------}
|
||||
function GetCarbonMouseClickCount(AEvent: EventRef): Integer;
|
||||
var
|
||||
ClickCount: UInt32;
|
||||
const
|
||||
SName = 'CarbonWindow_MouseProc';
|
||||
begin
|
||||
Result := 1;
|
||||
|
||||
if OSError(
|
||||
GetEventParameter(AEvent, kEventParamClickCount, typeUInt32, nil,
|
||||
SizeOf(ClickCount), nil, @ClickCount),
|
||||
SName, SGetEvent, 'kEventParamClickCount') then Exit;
|
||||
|
||||
Result := Integer(ClickCount);
|
||||
{debugln('GetClickCount ClickCount=',dbgs(ClickCount));}
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Name: GetCarbonMouseButton
|
||||
Returns: The event state of mouse
|
||||
|
Loading…
Reference in New Issue
Block a user