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
bd8026ca
Commit
bd8026ca
authored
May 24, 2005
by
Vitaly Lipatov
Committed by
Alexandre Julliard
May 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BUTTON_NOTIFY_PARENT macro (as in edit.c).
Notify parent about WM_KILL/SETFOCUS events.
parent
255541a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
button.c
dlls/user/button.c
+23
-7
No files found.
dlls/user/button.c
View file @
bd8026ca
...
...
@@ -48,9 +48,9 @@
* - BCN_HOTITEMCHANGE
* - BN_DISABLE
* - BN_PUSHED/BN_HILITE
*
- BN_KILLFOCUS
*
+ BN_KILLFOCUS: is it OK?
* - BN_PAINT
*
- BN_SETFOCUS
*
+ BN_SETFOCUS: is it OK?
* - BN_UNPUSHED/BN_UNHILITE
* - NM_CUSTOMDRAW
*
...
...
@@ -74,6 +74,9 @@
#include "wine/winuser16.h"
#include "controls.h"
#include "user_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
button
);
/* GetWindowLong offsets for window extra information */
#define STATE_GWL_OFFSET 0
...
...
@@ -93,6 +96,14 @@
#define BUTTON_UNKNOWN2 0x20
#define BUTTON_UNKNOWN3 0x10
#define BUTTON_NOTIFY_PARENT(hWnd, code) \
do {
/* Notify parent which has created this button control */
\
TRACE("notification " #code " sent to hwnd=%p\n", GetParent(hWnd)); \
SendMessageW(GetParent(hWnd), WM_COMMAND, \
MAKEWPARAM(GetWindowLongPtrW((hWnd),GWLP_ID), (code)), \
(LPARAM)(hWnd)); \
} while(0)
static
UINT
BUTTON_CalcLabelRect
(
HWND
hwnd
,
HDC
hdc
,
RECT
*
rc
);
static
void
PB_Paint
(
HWND
hwnd
,
HDC
hDC
,
UINT
action
);
static
void
CB_Paint
(
HWND
hwnd
,
HDC
hDC
,
UINT
action
);
...
...
@@ -294,9 +305,7 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
btn_type
==
BS_USERBUTTON
||
btn_type
==
BS_OWNERDRAW
)
{
SendMessageW
(
GetParent
(
hWnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLongPtrW
(
hWnd
,
GWLP_ID
),
BN_DOUBLECLICKED
),
(
LPARAM
)
hWnd
);
BUTTON_NOTIFY_PARENT
(
hWnd
,
BN_DOUBLECLICKED
);
break
;
}
/* fall through */
...
...
@@ -340,12 +349,12 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
(
state
&
BUTTON_3STATE
)
?
0
:
((
state
&
3
)
+
1
),
0
);
break
;
}
SendMessageW
(
GetParent
(
hWnd
),
WM_COMMAND
,
MAKEWPARAM
(
GetWindowLongPtrW
(
hWnd
,
GWLP_ID
),
BN_CLICKED
),
(
LPARAM
)
hWnd
);
BUTTON_NOTIFY_PARENT
(
hWnd
,
BN_CLICKED
);
}
break
;
case
WM_CAPTURECHANGED
:
TRACE
(
"WM_CAPTURECHANGED %p
\n
"
,
hWnd
);
state
=
get_button_state
(
hWnd
);
if
(
state
&
BUTTON_BTNPRESSED
)
{
...
...
@@ -405,17 +414,24 @@ static LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
return
(
LRESULT
)
get_button_font
(
hWnd
);
case
WM_SETFOCUS
:
TRACE
(
"WM_SETFOCUS %p
\n
"
,
hWnd
);
set_button_state
(
hWnd
,
get_button_state
(
hWnd
)
|
BUTTON_HASFOCUS
);
paint_button
(
hWnd
,
btn_type
,
ODA_FOCUS
);
if
(
style
&
BS_NOTIFY
)
BUTTON_NOTIFY_PARENT
(
hWnd
,
BN_SETFOCUS
);
break
;
case
WM_KILLFOCUS
:
TRACE
(
"WM_KILLFOCUS %p
\n
"
,
hWnd
);
state
=
get_button_state
(
hWnd
);
set_button_state
(
hWnd
,
state
&
~
BUTTON_HASFOCUS
);
paint_button
(
hWnd
,
btn_type
,
ODA_FOCUS
);
if
((
state
&
BUTTON_BTNPRESSED
)
&&
GetCapture
()
==
hWnd
)
ReleaseCapture
();
if
(
style
&
BS_NOTIFY
)
BUTTON_NOTIFY_PARENT
(
hWnd
,
BN_KILLFOCUS
);
break
;
case
WM_SYSCOLORCHANGE
:
...
...
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