diff --git a/components/ideintf/objectinspector.pp b/components/ideintf/objectinspector.pp index 0c984f4e8a..57af125530 100644 --- a/components/ideintf/objectinspector.pp +++ b/components/ideintf/objectinspector.pp @@ -291,7 +291,7 @@ type FTopY: integer; FDrawHorzGridLines: Boolean; FActiveRowBmp: TCustomBitmap; - FFirstClickTime: TDateTime; + FFirstClickTime: DWORD; FKeySearchText: string; // hint stuff @@ -1499,8 +1499,12 @@ begin if (Button=mbLeft) then begin if (Shift=[ssCtrl,ssLeft]) then DoCallEdit(oiqeShowValue) - else if (FFirstClickTime<>0) and (Now-FFirstClickTime<(1/86400*0.4)) then - ValueEditDblClick(Sender); + else if (FFirstClickTime<>0) and (GetTickCount <= FFirstClickTime + GetDoubleClickTime) + and (not ValueComboBox.DroppedDown) then + begin + FFirstClickTime:=0; + ToggleRow; + end; end; end; @@ -2016,7 +2020,7 @@ begin HideHint; if Button=mbLeft then begin - FFirstClickTime:=Now; + FFirstClickTime:=GetTickCount; if Cursor=crHSplit then begin FDragging:=true; end diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 4dbca96ecb..0570380fc7 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -1701,16 +1701,7 @@ begin WM_LBUTTONDOWN: begin if (MouseDownCount < 1) or (MouseDownCount > 4) then MouseDownCount := 1; - // if mouse-click, focus-change, mouse-click, cursor hasn't moved: - // simulate double click, assume focus change due to first mouse-click - if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window) - and (GetTickCount - MouseDownTime <= GetDoubleClickTime) - and CheckMouseMovement then - begin - inc(MouseDownCount); - PostMessage(Window, WM_LBUTTONDBLCLK, WParam, LParam); - end - else if (MouseDownWindow = Window) + if (MouseDownWindow = Window) and (GetTickCount - MouseDownTime <= GetDoubleClickTime) and CheckMouseMovement then inc(MouseDownCount) @@ -1719,8 +1710,6 @@ begin MouseDownTime := GetTickCount; MouseDownWindow := Window; - MouseDownFocusWindow := 0; - MouseDownFocusStatus := mfFocusSense; GetCursorPos(MouseDownPos); NotifyUserInput := True; PLMsg:=@LMMouse; @@ -1739,8 +1728,6 @@ begin end; WM_LBUTTONUP: begin - if (MouseDownWindow = Window) and (MouseDownFocusStatus = mfNone) then - MouseDownFocusStatus := mfFocusSense; NotifyUserInput := True; PLMsg:=@LMMouse; with LMMouse Do @@ -2101,12 +2088,6 @@ begin // move focus to another application window but process event first if (Window = Win32WidgetSet.AppHandle) then PostMessage(Window, CM_ACTIVATE, 0, 0); - // handle feature mouse-click, setfocus, mouse-click -> double-click - if (Window <> MouseDownWindow) and (MouseDownFocusStatus <> mfNone) then - begin - MouseDownFocusStatus := mfFocusChanged; - MouseDownFocusWindow := Window; - end; LMessage.Msg := LM_SETFOCUS; end; WM_SHOWWINDOW: @@ -2546,11 +2527,6 @@ begin end; else case Msg of - WM_LBUTTONDOWN, WM_LBUTTONUP: - begin - if MouseDownFocusStatus = mfFocusSense then - MouseDownFocusStatus := mfNone; - end; {$ifndef RedirectDestroyMessages} WM_NCDESTROY: begin diff --git a/lcl/interfaces/win32/win32int.pp b/lcl/interfaces/win32/win32int.pp index 1be4828d89..3bd6d89ce7 100644 --- a/lcl/interfaces/win32/win32int.pp +++ b/lcl/interfaces/win32/win32int.pp @@ -1,4 +1,4 @@ -{ $Id$ } +{ $Id: win32int.pp 39894 2013-01-19 17:42:38Z juha $ } { /*************************************************************************** WIN32INT.pp - Win32Interface Object @@ -253,8 +253,6 @@ uses Win32Extra, LclProc, LCLMessageGlue; type - TMouseDownFocusStatus = (mfNone, mfFocusSense, mfFocusChanged); - PProcessEvent = ^TProcessEvent; TProcessEvent = record Handle: THandle; @@ -268,8 +266,6 @@ var MouseDownTime: dword; MouseDownPos: TPoint; MouseDownWindow: HWND = 0; - MouseDownFocusWindow: HWND; - MouseDownFocusStatus: TMouseDownFocusStatus = mfNone; ComboBoxHandleSizeWindow: HWND = 0; IgnoreNextCharWindow: HWND = 0; // ignore next WM_(SYS)CHAR message // set to true, if we are redirecting a WM_MOUSEWHEEL message, to prevent recursion diff --git a/lcl/interfaces/wince/wincecallback.inc b/lcl/interfaces/wince/wincecallback.inc index 968a111f39..cc3ad22058 100644 --- a/lcl/interfaces/wince/wincecallback.inc +++ b/lcl/interfaces/wince/wincecallback.inc @@ -1523,15 +1523,6 @@ begin end; WM_LBUTTONDOWN: begin - // if mouse-click, focus-change, mouse-click, cursor hasn't moved: - // simulate double click, assume focus change due to first mouse-click - if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window) - and (GetTickCount - MouseDownTime <= GetDoubleClickTime) - and CheckMouseMovement then - begin - PostMessage(Window, WM_LBUTTONDBLCLK, WParam, LParam); - end; - {$ifndef win32} // Gesture recognition process to enable popup menus. if (lWinControl.PopupMenu <> nil) then @@ -1548,8 +1539,6 @@ begin MouseDownTime := GetTickCount; MouseDownWindow := Window; - MouseDownFocusWindow := 0; - MouseDownFocusStatus := mfFocusSense; GetCursorPos(MouseDownPos); NotifyUserInput := True; PLMsg:=@LMMouse; @@ -1572,8 +1561,6 @@ begin end; WM_LBUTTONUP: begin - if (MouseDownWindow = Window) and (MouseDownFocusStatus = mfNone) then - MouseDownFocusStatus := mfFocusSense; NotifyUserInput := True; PLMsg:=@LMMouse; with LMMouse Do @@ -1853,12 +1840,6 @@ begin {$ifdef DEBUG_CARET} DebugLn('WM_SETFOCUS received for window ', IntToHex(Window, 8)); {$endif} - // handle feature mouse-click, setfocus, mouse-click -> double-click - if (Window <> MouseDownWindow) and (MouseDownFocusStatus <> mfNone) then - begin - MouseDownFocusStatus := mfFocusChanged; - MouseDownFocusWindow := Window; - end; LMessage.Msg := LM_SETFOCUS; if (lWinControl <> nil) and (lWinControl.FCompStyle = csEdit) then Windows.SendMessage(Window, EM_SETSEL, 0, -1); @@ -2203,11 +2184,6 @@ begin else case Msg of - WM_LBUTTONDOWN, WM_LBUTTONUP: - begin - if MouseDownFocusStatus = mfFocusSense then - MouseDownFocusStatus := mfNone; - end; WM_NCDESTROY: begin //roozbeh : test this.... diff --git a/lcl/interfaces/wince/winceint.pp b/lcl/interfaces/wince/winceint.pp index ad484b5b32..40e2310507 100644 --- a/lcl/interfaces/wince/winceint.pp +++ b/lcl/interfaces/wince/winceint.pp @@ -252,8 +252,6 @@ uses Spin, CheckLst, LCLProc, LCLMessageGlue; type - TMouseDownFocusStatus = (mfNone, mfFocusSense, mfFocusChanged); - PProcessEvent = ^TProcessEvent; TProcessEvent = record Handle: THandle; @@ -266,8 +264,6 @@ var MouseDownTime: dword; MouseDownPos: TPoint; MouseDownWindow: HWND = 0; - MouseDownFocusWindow: HWND; - MouseDownFocusStatus: TMouseDownFocusStatus = mfNone; ComboBoxHandleSizeWindow: HWND = 0;//just do not know the use yet IgnoreNextCharWindow: HWND = 0; // ignore next WM_(SYS)CHAR message OnClipBoardRequest: TClipboardRequestEvent = nil;