Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
25c62cc6
Commit
25c62cc6
authored
Sep 11, 1999
by
Pierre Mageau
Committed by
Alexandre Julliard
Sep 11, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the mouse capture on the combo listbox.
parent
5b68233d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
20 deletions
+120
-20
combo.c
controls/combo.c
+7
-0
listbox.c
controls/listbox.c
+113
-20
No files found.
controls/combo.c
View file @
25c62cc6
...
...
@@ -1211,6 +1211,11 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
lphc
->
wState
&=
~
CBF_DROPPED
;
ShowWindow
(
lphc
->
hWndLBox
,
SW_HIDE
);
if
(
GetCapture
()
==
lphc
->
hWndLBox
)
{
ReleaseCapture
();
}
if
(
CB_GETTYPE
(
lphc
)
==
CBS_DROPDOWN
)
{
...
...
@@ -1737,6 +1742,8 @@ static void COMBO_LButtonUp( LPHEADCOMBO lphc, LPARAM lParam )
CBUpdateEdit
(
lphc
,
index
);
}
ReleaseCapture
();
SetCapture
(
lphc
->
hWndLBox
);
}
if
(
lphc
->
wState
&
CBF_BUTTONDOWN
)
...
...
controls/listbox.c
View file @
25c62cc6
...
...
@@ -1806,6 +1806,100 @@ static LRESULT LISTBOX_HandleLButtonDown( WND *wnd, LB_DESCR *descr,
}
/*************************************************************************
* LISTBOX_HandleLButtonDownCombo [Internal]
*
* Process LButtonDown message for the ComboListBox
*
* PARAMS
* pWnd [I] The windows internal structure
* pDescr [I] The ListBox internal structure
* wParam [I] Key Flag (WM_LBUTTONDOWN doc for more info)
* x [I] X Mouse Coordinate
* y [I] Y Mouse Coordinate
*
* RETURNS
* 0 since we are processing the WM_LBUTTONDOWN Message
*
* NOTES
* This function is only to be used when a ListBox is a ComboListBox
*/
static
LRESULT
LISTBOX_HandleLButtonDownCombo
(
WND
*
pWnd
,
LB_DESCR
*
pDescr
,
WPARAM
wParam
,
INT
x
,
INT
y
)
{
RECT
clientRect
,
screenRect
;
POINT
mousePos
;
mousePos
.
x
=
x
;
mousePos
.
y
=
y
;
GetClientRect
(
pWnd
->
hwndSelf
,
&
clientRect
);
if
(
PtInRect
(
&
clientRect
,
mousePos
))
{
/* MousePos is in client, resume normal processing */
return
LISTBOX_HandleLButtonDown
(
pWnd
,
pDescr
,
wParam
,
x
,
y
);
}
else
{
POINT
screenMousePos
;
HWND
hWndOldCapture
;
/* Check the Non-Client Area */
screenMousePos
=
mousePos
;
hWndOldCapture
=
GetCapture
();
ReleaseCapture
();
GetWindowRect
(
pWnd
->
hwndSelf
,
&
screenRect
);
ClientToScreen
(
pWnd
->
hwndSelf
,
&
screenMousePos
);
if
(
!
PtInRect
(
&
screenRect
,
screenMousePos
))
{
/* Close The Drop Down */
SEND_NOTIFICATION
(
pWnd
,
pDescr
,
LBN_SELCANCEL
);
return
0
;
}
else
{
/* Check to see the NC is a scrollbar */
INT
nHitTestType
=
0
;
/* Check Vertical scroll bar */
if
(
pWnd
->
dwStyle
&
WS_VSCROLL
)
{
clientRect
.
right
+=
GetSystemMetrics
(
SM_CXVSCROLL
);
if
(
PtInRect
(
&
clientRect
,
mousePos
))
{
nHitTestType
=
HTVSCROLL
;
}
}
/* Check horizontal scroll bar */
if
(
pWnd
->
dwStyle
&
WS_HSCROLL
)
{
clientRect
.
bottom
+=
GetSystemMetrics
(
SM_CYHSCROLL
);
if
(
PtInRect
(
&
clientRect
,
mousePos
))
{
nHitTestType
=
HTHSCROLL
;
}
}
/* Windows sends this message when a scrollbar is clicked
*/
if
(
nHitTestType
!=
0
)
{
SendMessageA
(
pWnd
->
hwndSelf
,
WM_NCLBUTTONDOWN
,
nHitTestType
,
MAKELONG
(
screenMousePos
.
x
,
screenMousePos
.
y
));
}
/* Resume the Capture after scrolling is complete
*/
if
(
hWndOldCapture
!=
0
)
{
SetCapture
(
hWndOldCapture
);
}
}
}
return
0
;
}
/***********************************************************************
* LISTBOX_HandleLButtonUp
*/
...
...
@@ -2686,27 +2780,27 @@ static inline LRESULT WINAPI ComboLBWndProc_locked( WND* wnd, UINT msg,
* If we are in a dropdown combobox, we simulate that
* the mouse is captured to show the tracking of the item.
*/
captured
=
descr
->
captured
;
descr
->
captured
=
TRUE
;
LISTBOX_HandleMouseMove
(
wnd
,
descr
,
mousePos
.
x
,
mousePos
.
y
);
descr
->
captured
=
captured
;
/*
* However, when tracking, it is important that we do not
* perform a selection if the cursor is outside the list.
*/
GetClientRect
(
hwnd
,
&
clientRect
);
if
(
!
PtInRect
(
&
clientRect
,
mousePos
))
if
(
PtInRect
(
&
clientRect
,
mousePos
))
{
LISTBOX_MoveCaret
(
wnd
,
descr
,
-
1
,
FALSE
);
}
captured
=
descr
->
captured
;
descr
->
captured
=
TRUE
;
LISTBOX_HandleMouseMove
(
wnd
,
descr
,
mousePos
.
x
,
mousePos
.
y
);
descr
->
captured
=
captured
;
}
else
{
LISTBOX_HandleMouseMove
(
wnd
,
descr
,
mousePos
.
x
,
mousePos
.
y
);
}
return
0
;
}
else
{
...
...
@@ -2748,10 +2842,9 @@ static inline LRESULT WINAPI ComboLBWndProc_locked( WND* wnd, UINT msg,
}
return
LISTBOX_HandleLButtonUp
(
wnd
,
descr
);
case
WM_LBUTTONDOWN
:
return
LISTBOX_HandleLButtonDown
(
wnd
,
descr
,
wParam
,
(
INT16
)
LOWORD
(
lParam
),
(
INT16
)
HIWORD
(
lParam
));
/* avoid activation at all costs */
return
LISTBOX_HandleLButtonDownCombo
(
wnd
,
descr
,
wParam
,
(
INT16
)
LOWORD
(
lParam
),
(
INT16
)
HIWORD
(
lParam
)
);
case
WM_MOUSEACTIVATE
:
return
MA_NOACTIVATE
;
case
WM_NCACTIVATE
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment