LCL Carbon: finally find solution for #0011287: Mac OS X : Double Click when Showing forms does not work correctly... - postpone down message to start of mouse tracking

git-svn-id: trunk@16581 -
This commit is contained in:
tombo 2008-09-13 12:43:18 +00:00
parent 22aa8a9284
commit 56b2d3f9c3
3 changed files with 31 additions and 7 deletions

View File

@ -336,6 +336,10 @@ var PrevKeyModifiers: UInt32 = 0;
// Stores mouse up message to be fired on control hit after value is updated
var SavedMouseUpMsg: TLMMouse;
// Stores multi click mouse down message to be fired after handling standard event
var PostponedDownMsg: TLMMouse;
var PostponedDown: Boolean;
// Stores last mouse pos to call mouse move only when it really has changed
var LastMousePos: TPoint;

View File

@ -165,6 +165,13 @@ begin
nil, SizeOf(ActionUPP), nil, @OldActionUPP), SName, SGetEvent,
SControlAction) then Exit;
if PostponedDown then
begin
PostponedDown := False;
NotifyApplicationUserInput(PostponedDownMsg.Msg);
DeliverMessage(AWidget.LCLObject, PostponedDownMsg);
end;
MouseButton := GetCarbonMouseButton(AEvent);
ActionUPP := NewControlActionUPP(@CarbonCommon_TrackProgress);

View File

@ -62,6 +62,7 @@ var
// or the rootcontrol if none found
Widget: TCarbonWidget; // the widget specific to the mouse event
// or the window's widgetinfo if none found
Postpone: Boolean;
const
SName = 'CarbonWindow_MouseProc';
@ -153,6 +154,8 @@ const
Msg^.Keys := GetCarbonMsgKeyState;
CarbonWidgetSet.SetCaptureWidget(HWND(Widget));
if ClickCount > 1 then Postpone := True;
end;
procedure HandleMouseUpEvent(var AMsg);
@ -244,6 +247,7 @@ var
ViewPart: HIViewPartCode;
begin
Result := EventNotHandledErr;
Postpone := False;
// check window part code
Part := inContent;
@ -284,15 +288,24 @@ begin
Exit(EventNotHandledErr);
end;
// Msg is set in the Appropriate HandleMousexxx procedure
NotifyApplicationUserInput(Msg.Message.Msg);
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
if Postpone then
begin
Result := EventNotHandledErr;
PostponedDown := True;
PostponedDownMsg := TLMMouse(Msg.Message);
Result := CallNextEventHandler(ANextHandler, AEvent);
end
else // the LCL does not want the event propagated
Result := noErr;
else
begin
// Msg is set in the Appropriate HandleMousexxx procedure
NotifyApplicationUserInput(Msg.Message.Msg);
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
begin
Result := EventNotHandledErr;
end
else // the LCL does not want the event propagated
Result := noErr;
end;
// interactive design
if (Widget is TCarbonDesignWindow) and (GetCarbonMouseButton(AEvent) = 1) and
(EventKind = kEventMouseDown) then