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
f92a7770
Commit
f92a7770
authored
Dec 05, 1999
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 05, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove hack for keyboard messages in dialogs.
parent
1cc90fff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
35 deletions
+21
-35
button.c
controls/button.c
+19
-7
dialog.c
windows/dialog.c
+2
-28
No files found.
controls/button.c
View file @
f92a7770
...
...
@@ -119,7 +119,7 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
return
-
1
;
/* abort */
infoPtr
->
state
=
BUTTON_UNCHECKED
;
infoPtr
->
hFont
=
0
;
infoPtr
->
hImage
=
NULL
;
infoPtr
->
hImage
=
0
;
return
0
;
case
WM_ERASEBKGND
:
...
...
@@ -136,6 +136,14 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
}
break
;
case
WM_KEYDOWN
:
if
(
wParam
==
VK_SPACE
)
{
SendMessageA
(
hWnd
,
BM_SETSTATE
,
TRUE
,
0
);
infoPtr
->
state
|=
BUTTON_BTNPRESSED
;
}
break
;
case
WM_LBUTTONDBLCLK
:
if
(
wndPtr
->
dwStyle
&
BS_NOTIFY
||
style
==
BS_RADIOBUTTON
||
...
...
@@ -153,6 +161,10 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
infoPtr
->
state
|=
BUTTON_BTNPRESSED
;
break
;
case
WM_KEYUP
:
if
(
wParam
!=
VK_SPACE
)
break
;
/* fall through */
case
WM_LBUTTONUP
:
if
(
!
(
infoPtr
->
state
&
BUTTON_BTNPRESSED
))
break
;
infoPtr
->
state
&=
BUTTON_NSTATES
;
...
...
@@ -163,7 +175,7 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
SendMessageA
(
hWnd
,
BM_SETSTATE
,
FALSE
,
0
);
ReleaseCapture
();
GetClientRect
(
hWnd
,
&
rect
);
if
(
PtInRect
(
&
rect
,
pt
))
if
(
uMsg
==
WM_KEYUP
||
PtInRect
(
&
rect
,
pt
))
{
switch
(
style
)
{
...
...
@@ -265,7 +277,7 @@ static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
else
if
(
wParam
==
IMAGE_ICON
)
return
(
HICON
)
infoPtr
->
hImage
;
else
return
NULL
;
return
(
HICON
)
0
;
case
BM_GETCHECK16
:
case
BM_GETCHECK
:
...
...
@@ -483,7 +495,7 @@ static void BUTTON_DrawPushButton(
}
}
if
(
((
wndPtr
->
dwStyle
&
BS_ICON
)
||
(
wndPtr
->
dwStyle
&
BS_BITMAP
)
)
&&
(
infoPtr
->
hImage
!=
NULL
)
)
(
infoPtr
->
hImage
!=
0
)
)
{
int
yOffset
,
xOffset
;
int
imageWidth
,
imageHeight
;
...
...
@@ -523,7 +535,7 @@ static void BUTTON_DrawPushButton(
/* If the image is too big for the button then create a region*/
if
(
xOffset
<
0
||
yOffset
<
0
)
{
HRGN
hBitmapRgn
=
NULL
;
HRGN
hBitmapRgn
=
0
;
hBitmapRgn
=
CreateRectRgn
(
rc
.
left
+
xBorderOffset
,
rc
.
top
+
yBorderOffset
,
rc
.
right
-
xBorderOffset
,
rc
.
bottom
-
yBorderOffset
);
...
...
@@ -560,7 +572,7 @@ static void BUTTON_DrawPushButton(
if
(
xOffset
<
0
||
yOffset
<
0
)
{
SelectClipRgn
(
hDC
,
NULL
);
SelectClipRgn
(
hDC
,
0
);
}
}
...
...
@@ -647,7 +659,7 @@ static void CB_Paint( WND *wndPtr, HDC hDC, WORD action )
* if the button has a bitmap/icon, draw a normal pushbutton
* instead of a radion button.
*/
if
(
infoPtr
->
hImage
!=
NULL
)
if
(
infoPtr
->
hImage
!=
0
)
{
BOOL
bHighLighted
=
((
infoPtr
->
state
&
BUTTON_HIGHLIGHTED
)
||
(
infoPtr
->
state
&
BUTTON_CHECKED
));
...
...
windows/dialog.c
View file @
f92a7770
...
...
@@ -1127,18 +1127,6 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey )
BOOL
RetVal
=
FALSE
;
INT
dlgCode
;
if
(
vKey
==
VK_SPACE
)
{
dlgCode
=
SendMessageA
(
hwndControl
,
WM_GETDLGCODE
,
0
,
0
);
if
(
dlgCode
&
DLGC_BUTTON
)
{
SendMessageA
(
hwndControl
,
WM_LBUTTONDOWN
,
0
,
0
);
SendMessageA
(
hwndControl
,
WM_LBUTTONUP
,
0
,
0
);
RetVal
=
TRUE
;
}
}
else
{
do
{
wndPtr
=
WIN_FindWndPtr
(
hwndControl
);
...
...
@@ -1169,21 +1157,7 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey )
/* and bump it on to next */
SendMessageA
(
hwndDlg
,
WM_NEXTDLGCTL
,
0
,
0
);
}
else
if
(
dlgCode
&
(
DLGC_DEFPUSHBUTTON
|
DLGC_UNDEFPUSHBUTTON
))
{
/* send command message as from the control */
SendMessageA
(
hwndDlg
,
WM_COMMAND
,
MAKEWPARAM
(
LOWORD
(
wndPtr
->
wIDmenu
),
BN_CLICKED
),
(
LPARAM
)
hwndControl
);
}
else
{
/* click the control */
SendMessageA
(
hwndControl
,
WM_LBUTTONDOWN
,
0
,
0
);
SendMessageA
(
hwndControl
,
WM_LBUTTONUP
,
0
,
0
);
}
RetVal
=
TRUE
;
WIN_ReleaseWndPtr
(
wndPtr
);
break
;
...
...
@@ -1219,7 +1193,7 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey )
hwndControl
=
hwndNext
;
}
while
(
hwndControl
&&
(
hwndControl
!=
hwnd
));
}
return
RetVal
;
}
...
...
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