Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b662e11a
Commit
b662e11a
authored
Oct 16, 2001
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved scrollbar tracking code to scroll.c.
Avoid unnecessary coordinates conversion in NC_HandleSysCommand.
parent
2895e7f4
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
93 deletions
+82
-93
menu.c
controls/menu.c
+4
-0
scroll.c
controls/scroll.c
+54
-31
controls.h
dlls/user/controls.h
+1
-1
nonclient.h
include/nonclient.h
+1
-1
defwnd.c
windows/defwnd.c
+1
-6
nonclient.c
windows/nonclient.c
+21
-54
No files found.
controls/menu.c
View file @
b662e11a
...
...
@@ -2944,6 +2944,10 @@ void MENU_TrackMouseMenuBar( HWND hWnd, INT ht, POINT pt )
if
(
IsMenu
(
hMenu
))
{
/* map point to parent client coordinates */
HWND
parent
=
GetAncestor
(
hWnd
,
GA_PARENT
);
if
(
parent
!=
GetDesktopWindow
())
ScreenToClient
(
parent
,
&
pt
);
MENU_InitTracking
(
hWnd
,
hMenu
,
FALSE
,
wFlags
);
MENU_TrackMenu
(
hMenu
,
wFlags
,
pt
.
x
,
pt
.
y
,
hWnd
,
NULL
);
MENU_ExitTracking
(
hWnd
);
...
...
controls/scroll.c
View file @
b662e11a
...
...
@@ -895,7 +895,7 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WPARAM wParam )
* 'pt' is the location of the mouse event in client (for SB_CTL) or
* windows coordinates.
*/
void
SCROLL_HandleScrollEvent
(
HWND
hwnd
,
INT
nBar
,
UINT
msg
,
POINT
pt
)
static
void
SCROLL_HandleScrollEvent
(
HWND
hwnd
,
INT
nBar
,
UINT
msg
,
POINT
pt
)
{
/* Previous mouse position for timer events */
static
POINT
prevPt
;
...
...
@@ -1110,6 +1110,58 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt)
/***********************************************************************
* SCROLL_TrackScrollBar
*
* Track a mouse button press on a scroll-bar.
* pt is in screen-coordinates for non-client scroll bars.
*/
void
SCROLL_TrackScrollBar
(
HWND
hwnd
,
INT
scrollbar
,
POINT
pt
)
{
MSG
msg
;
INT
xoffset
=
0
,
yoffset
=
0
;
if
(
scrollbar
!=
SB_CTL
)
{
WND
*
wndPtr
=
WIN_GetPtr
(
hwnd
);
if
(
!
wndPtr
||
wndPtr
==
WND_OTHER_PROCESS
)
return
;
xoffset
=
wndPtr
->
rectClient
.
left
-
wndPtr
->
rectWindow
.
left
;
yoffset
=
wndPtr
->
rectClient
.
top
-
wndPtr
->
rectWindow
.
top
;
WIN_ReleasePtr
(
wndPtr
);
ScreenToClient
(
hwnd
,
&
pt
);
pt
.
x
+=
xoffset
;
pt
.
y
+=
yoffset
;
}
SCROLL_HandleScrollEvent
(
hwnd
,
scrollbar
,
WM_LBUTTONDOWN
,
pt
);
do
{
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
if
(
CallMsgFilterW
(
&
msg
,
MSGF_SCROLLBAR
))
continue
;
switch
(
msg
.
message
)
{
case
WM_LBUTTONUP
:
case
WM_MOUSEMOVE
:
case
WM_SYSTIMER
:
pt
.
x
=
LOWORD
(
msg
.
lParam
)
+
xoffset
;
pt
.
y
=
HIWORD
(
msg
.
lParam
)
+
yoffset
;
SCROLL_HandleScrollEvent
(
hwnd
,
scrollbar
,
msg
.
message
,
pt
);
break
;
default:
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
break
;
}
if
(
!
IsWindow
(
hwnd
))
{
ReleaseCapture
();
break
;
}
}
while
(
msg
.
message
!=
WM_LBUTTONUP
);
}
/***********************************************************************
* ScrollBarWndProc
*/
static
LRESULT
WINAPI
ScrollBarWndProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
...
...
@@ -1156,38 +1208,9 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
case
WM_LBUTTONDOWN
:
{
POINT
pt
;
MSG
msg
;
pt
.
x
=
SLOWORD
(
lParam
);
pt
.
y
=
SHIWORD
(
lParam
);
SetCapture
(
hwnd
);
SCROLL_HandleScrollEvent
(
hwnd
,
SB_CTL
,
message
,
pt
);
TRACE
(
"Doing LBUTTONDOWN loop hwnd=%08x
\n
"
,
hwnd
);
do
{
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
if
(
CallMsgFilterW
(
&
msg
,
MSGF_SCROLLBAR
))
continue
;
switch
(
msg
.
message
)
{
case
WM_LBUTTONUP
:
case
WM_MOUSEMOVE
:
case
WM_SYSTIMER
:
pt
.
x
=
LOWORD
(
msg
.
lParam
);
pt
.
y
=
HIWORD
(
msg
.
lParam
);
SCROLL_HandleScrollEvent
(
hwnd
,
SB_CTL
,
msg
.
message
,
pt
);
break
;
default:
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
break
;
}
if
(
!
IsWindow
(
hwnd
))
{
ReleaseCapture
();
break
;
}
}
while
(
msg
.
message
!=
WM_LBUTTONUP
);
TRACE
(
"Out ofLBUTTON loop hwnd=%08x
\n
"
,
hwnd
);
SCROLL_TrackScrollBar
(
hwnd
,
SB_CTL
,
pt
);
}
break
;
case
WM_LBUTTONUP
:
...
...
dlls/user/controls.h
View file @
b662e11a
...
...
@@ -50,7 +50,7 @@ extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
/* scrollbar */
extern
void
SCROLL_DrawScrollBar
(
HWND
hwnd
,
HDC
hdc
,
INT
nBar
,
BOOL
arrows
,
BOOL
interior
);
extern
void
SCROLL_
HandleScrollEvent
(
HWND
hwnd
,
INT
nBar
,
UINT
msg
,
POINT
pt
);
extern
void
SCROLL_
TrackScrollBar
(
HWND
hwnd
,
INT
scrollbar
,
POINT
pt
);
extern
INT
SCROLL_SetNCSbState
(
HWND
hwnd
,
int
vMin
,
int
vMax
,
int
vPos
,
int
hMin
,
int
hMax
,
int
hPos
);
...
...
include/nonclient.h
View file @
b662e11a
...
...
@@ -15,7 +15,7 @@ extern LONG NC_HandleNCCalcSize( HWND hwnd, RECT *winRect );
extern
LONG
NC_HandleNCHitTest
(
HWND
hwnd
,
POINT
pt
);
extern
LONG
NC_HandleNCLButtonDown
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
LONG
NC_HandleNCLButtonDblClk
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
LONG
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
POINT
pt
);
extern
LONG
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
LONG
NC_HandleSetCursor
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
);
extern
void
NC_DrawSysButton
(
HWND
hwnd
,
HDC
hdc
,
BOOL
down
);
extern
BOOL
NC_DrawSysButton95
(
HWND
hwnd
,
HDC
hdc
,
BOOL
down
);
...
...
windows/defwnd.c
View file @
b662e11a
...
...
@@ -500,12 +500,7 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return
NC_HandleSetCursor
(
hwnd
,
wParam
,
lParam
);
case
WM_SYSCOMMAND
:
{
POINT
pt
;
pt
.
x
=
SLOWORD
(
lParam
);
pt
.
y
=
SHIWORD
(
lParam
);
return
NC_HandleSysCommand
(
hwnd
,
wParam
,
pt
);
}
return
NC_HandleSysCommand
(
hwnd
,
wParam
,
lParam
);
case
WM_KEYDOWN
:
if
(
wParam
==
VK_F10
)
iF10Key
=
VK_F10
;
...
...
windows/nonclient.c
View file @
b662e11a
...
...
@@ -1954,54 +1954,22 @@ NC_TrackCloseButton95 (HWND hwnd, WORD wParam)
*/
static
void
NC_TrackScrollBar
(
HWND
hwnd
,
WPARAM
wParam
,
POINT
pt
)
{
MSG
msg
;
INT
scrollbar
;
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
if
((
wParam
&
0xfff0
)
==
SC_HSCROLL
)
{
if
((
wParam
&
0x0f
)
!=
HTHSCROLL
)
goto
END
;
if
((
wParam
&
0x0f
)
!=
HTHSCROLL
)
return
;
scrollbar
=
SB_HORZ
;
}
else
/* SC_VSCROLL */
{
if
((
wParam
&
0x0f
)
!=
HTVSCROLL
)
goto
END
;
if
((
wParam
&
0x0f
)
!=
HTVSCROLL
)
return
;
scrollbar
=
SB_VERT
;
}
pt
.
x
-=
wndPtr
->
rectWindow
.
left
;
pt
.
y
-=
wndPtr
->
rectWindow
.
top
;
SetCapture
(
hwnd
);
SCROLL_HandleScrollEvent
(
hwnd
,
scrollbar
,
WM_LBUTTONDOWN
,
pt
);
do
{
if
(
!
GetMessageW
(
&
msg
,
0
,
0
,
0
))
break
;
if
(
CallMsgFilterW
(
&
msg
,
MSGF_SCROLLBAR
))
continue
;
switch
(
msg
.
message
)
{
case
WM_LBUTTONUP
:
case
WM_MOUSEMOVE
:
case
WM_SYSTIMER
:
pt
.
x
=
LOWORD
(
msg
.
lParam
)
+
wndPtr
->
rectClient
.
left
-
wndPtr
->
rectWindow
.
left
;
pt
.
y
=
HIWORD
(
msg
.
lParam
)
+
wndPtr
->
rectClient
.
top
-
wndPtr
->
rectWindow
.
top
;
SCROLL_HandleScrollEvent
(
hwnd
,
scrollbar
,
msg
.
message
,
pt
);
break
;
default:
TranslateMessage
(
&
msg
);
DispatchMessageW
(
&
msg
);
break
;
}
if
(
!
IsWindow
(
hwnd
))
{
ReleaseCapture
();
break
;
}
}
while
(
msg
.
message
!=
WM_LBUTTONUP
);
END:
WIN_ReleaseWndPtr
(
wndPtr
);
SCROLL_TrackScrollBar
(
hwnd
,
scrollbar
,
pt
);
}
/***********************************************************************
* NC_HandleNCLButtonDown
*
...
...
@@ -2130,20 +2098,11 @@ LONG NC_HandleNCLButtonDblClk( HWND hwnd, WPARAM wParam, LPARAM lParam )
*
* Handle a WM_SYSCOMMAND message. Called from DefWindowProc().
*/
LONG
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
POINT
pt
)
LONG
NC_HandleSysCommand
(
HWND
hwnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
UINT16
uCommand
=
wParam
&
0xFFF0
;
TRACE
(
"Handling WM_SYSCOMMAND %x %ld,%ld
\n
"
,
wParam
,
pt
.
x
,
pt
.
y
);
TRACE
(
"Handling WM_SYSCOMMAND %x %lx
\n
"
,
wParam
,
lParam
);
if
(
uCommand
!=
SC_KEYMENU
)
{
HWND
parent
=
GetAncestor
(
hwnd
,
GA_PARENT
);
if
(
parent
!=
GetDesktopWindow
())
ScreenToClient
(
parent
,
&
pt
);
}
switch
(
uCommand
)
switch
(
wParam
&
0xfff0
)
{
case
SC_SIZE
:
case
SC_MOVE
:
...
...
@@ -2170,22 +2129,31 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT pt )
break
;
case
SC_CLOSE
:
WIN_ReleaseWndPtr
(
wndPtr
);
return
SendMessageA
(
hwnd
,
WM_CLOSE
,
0
,
0
);
case
SC_VSCROLL
:
case
SC_HSCROLL
:
NC_TrackScrollBar
(
hwnd
,
wParam
,
pt
);
{
POINT
pt
;
pt
.
x
=
SLOWORD
(
lParam
);
pt
.
y
=
SHIWORD
(
lParam
);
NC_TrackScrollBar
(
hwnd
,
wParam
,
pt
);
}
break
;
case
SC_MOUSEMENU
:
MENU_TrackMouseMenuBar
(
hwnd
,
wParam
&
0x000F
,
pt
);
{
POINT
pt
;
pt
.
x
=
SLOWORD
(
lParam
);
pt
.
y
=
SHIWORD
(
lParam
);
MENU_TrackMouseMenuBar
(
hwnd
,
wParam
&
0x000F
,
pt
);
}
break
;
case
SC_KEYMENU
:
MENU_TrackKbdMenuBar
(
hwnd
,
wParam
,
pt
.
x
);
MENU_TrackKbdMenuBar
(
hwnd
,
wParam
,
LOWORD
(
lParam
)
);
break
;
case
SC_TASKLIST
:
WinExec
(
"taskman.exe"
,
SW_SHOWNORMAL
);
break
;
...
...
@@ -2213,7 +2181,6 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM wParam, POINT pt )
FIXME
(
"unimplemented!
\n
"
);
break
;
}
WIN_ReleaseWndPtr
(
wndPtr
);
return
0
;
}
...
...
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