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
87115b23
Commit
87115b23
authored
Aug 14, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WM_NEXTDLGCTL should not change the default button ID (based on a
patch by Krishna Murthy).
parent
8024b5ee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
13 deletions
+53
-13
dialog.c
dlls/user/tests/dialog.c
+3
-3
defdlg.c
windows/defdlg.c
+50
-10
No files found.
dlls/user/tests/dialog.c
View file @
87115b23
...
...
@@ -588,7 +588,7 @@ static void WM_NEXTDLGCTLTest(void)
* Check whether the default button ID got changed by sending message "WM_NEXTDLGCTL"
*/
dwVal
=
DefDlgProcA
(
g_hwndTestDlg
,
DM_GETDEFID
,
0
,
0
);
todo_wine
ok
(
IDCANCEL
==
(
LOWORD
(
dwVal
)),
"WM_NEXTDLGCTL changed default button
\n
"
);
ok
(
IDCANCEL
==
(
LOWORD
(
dwVal
)),
"WM_NEXTDLGCTL changed default button
\n
"
);
/*
* Check whether the style of the button which got the focus, changed to BS_DEFPUSHBUTTON and
...
...
@@ -621,7 +621,7 @@ static void WM_NEXTDLGCTLTest(void)
*/
if
(
IDCANCEL
==
(
LOWORD
(
dwVal
))
)
{
todo_wine
ok
(
((
GetWindowLong
(
g_hwndTestDlgBut2
,
GWL_STYLE
))
&
BS_DEFPUSHBUTTON
),
ok
(
((
GetWindowLong
(
g_hwndTestDlgBut2
,
GWL_STYLE
))
&
BS_DEFPUSHBUTTON
),
"Button2 style not set to BS_DEFPUSHBUTTON
\n
"
);
ok
(
!
((
GetWindowLong
(
g_hwndTestDlgBut1
,
GWL_STYLE
))
&
BS_DEFPUSHBUTTON
),
...
...
@@ -638,7 +638,7 @@ static void WM_NEXTDLGCTLTest(void)
* Check whether the default button ID got changed by sending message "WM_NEXTDLGCTL"
*/
dwVal
=
DefDlgProcA
(
g_hwndTestDlg
,
DM_GETDEFID
,
0
,
0
);
todo_wine
ok
(
IDCANCEL
==
(
LOWORD
(
dwVal
)),
"WM_NEXTDLGCTL changed default button
\n
"
);
ok
(
IDCANCEL
==
(
LOWORD
(
dwVal
)),
"WM_NEXTDLGCTL changed default button
\n
"
);
}
}
...
...
windows/defdlg.c
View file @
87115b23
...
...
@@ -127,14 +127,15 @@ static HWND DEFDLG_FindDefButton( HWND hwndDlg )
/***********************************************************************
* DEFDLG_SetDef
Button
* DEFDLG_SetDef
Id
*
* Set the
new default button to be hwndNew
.
* Set the
default button id
.
*/
static
BOOL
DEFDLG_SetDef
Button
(
HWND
hwndDlg
,
DIALOGINFO
*
dlgInfo
,
WPARAM
wParam
)
static
BOOL
DEFDLG_SetDef
Id
(
HWND
hwndDlg
,
DIALOGINFO
*
dlgInfo
,
WPARAM
wParam
)
{
DWORD
dlgcode
=
0
;
/* initialize just to avoid a warning */
HWND
hwndNew
=
GetDlgItem
(
hwndDlg
,
wParam
);
HWND
hwndOld
,
hwndNew
=
GetDlgItem
(
hwndDlg
,
wParam
);
INT
old_id
=
dlgInfo
->
idResult
;
dlgInfo
->
idResult
=
wParam
;
if
(
hwndNew
&&
...
...
@@ -142,15 +143,54 @@ static BOOL DEFDLG_SetDefButton( HWND hwndDlg, DIALOGINFO *dlgInfo, WPARAM wPara
&
(
DLGC_UNDEFPUSHBUTTON
|
DLGC_BUTTON
)))
return
FALSE
;
/* Destination is not a push button */
if
(
dlgInfo
->
idResult
)
/* There's already a default pushbutton */
/* Make sure the old default control is a valid push button ID */
hwndOld
=
GetDlgItem
(
hwndDlg
,
old_id
);
if
(
!
hwndOld
||
!
(
SendMessageA
(
hwndOld
,
WM_GETDLGCODE
,
0
,
0
)
&
DLGC_DEFPUSHBUTTON
))
hwndOld
=
DEFDLG_FindDefButton
(
hwndDlg
);
if
(
hwndOld
&&
hwndOld
!=
hwndNew
)
SendMessageA
(
hwndOld
,
BM_SETSTYLE
,
BS_PUSHBUTTON
,
TRUE
);
if
(
hwndNew
)
{
if
(
dlgcode
&
DLGC_UNDEFPUSHBUTTON
)
SendMessageA
(
hwndNew
,
BM_SETSTYLE
,
BS_DEFPUSHBUTTON
,
TRUE
);
}
return
TRUE
;
}
/***********************************************************************
* DEFDLG_SetDefButton
*
* Set the new default button to be hwndNew.
*/
static
BOOL
DEFDLG_SetDefButton
(
HWND
hwndDlg
,
DIALOGINFO
*
dlgInfo
,
HWND
hwndNew
)
{
DWORD
dlgcode
=
0
;
/* initialize just to avoid a warning */
HWND
hwndOld
=
GetDlgItem
(
hwndDlg
,
dlgInfo
->
idResult
);
if
(
hwndOld
&&
(
SendMessageA
(
hwndOld
,
WM_GETDLGCODE
,
0
,
0
)
&
DLGC_DEFPUSHBUTTON
))
SendMessageA
(
hwndOld
,
BM_SETSTYLE
,
BS_PUSHBUTTON
,
TRUE
);
if
(
hwndNew
&&
!
((
dlgcode
=
SendMessageW
(
hwndNew
,
WM_GETDLGCODE
,
0
,
0
))
&
(
DLGC_UNDEFPUSHBUTTON
|
DLGC_DEFPUSHBUTTON
)))
{
/**
* Need to draw only default push button rectangle.
* Since the next control is not a push button, need to draw the push
* button rectangle for the default control.
*/
hwndNew
=
hwndOld
;
dlgcode
=
SendMessageW
(
hwndNew
,
WM_GETDLGCODE
,
0
,
0
);
}
/* Make sure the old default control is a valid push button ID */
if
(
!
hwndOld
||
!
(
SendMessageA
(
hwndOld
,
WM_GETDLGCODE
,
0
,
0
)
&
DLGC_DEFPUSHBUTTON
))
hwndOld
=
DEFDLG_FindDefButton
(
hwndDlg
);
if
(
hwndOld
&&
hwndOld
!=
hwndNew
)
SendMessageA
(
hwndOld
,
BM_SETSTYLE
,
BS_PUSHBUTTON
,
TRUE
);
if
(
hwndNew
)
{
if
(
dlgcode
==
DLGC_UNDEFPUSHBUTTON
)
if
(
dlgcode
&
DLGC_UNDEFPUSHBUTTON
)
SendMessageA
(
hwndNew
,
BM_SETSTYLE
,
BS_DEFPUSHBUTTON
,
TRUE
);
}
return
TRUE
;
...
...
@@ -214,7 +254,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
case
DM_SETDEFID
:
if
(
dlgInfo
&&
!
(
dlgInfo
->
flags
&
DF_END
))
DEFDLG_SetDef
Button
(
hwnd
,
dlgInfo
,
wParam
);
DEFDLG_SetDef
Id
(
hwnd
,
dlgInfo
,
wParam
);
return
1
;
case
DM_GETDEFID
:
...
...
@@ -235,7 +275,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
if
(
!
lParam
)
hwndDest
=
GetNextDlgTabItem
(
hwnd
,
GetFocus
(),
wParam
);
if
(
hwndDest
)
DEFDLG_SetFocus
(
hwnd
,
hwndDest
);
DEFDLG_SetDefButton
(
hwnd
,
dlgInfo
,
GetDlgCtrlID
(
hwndDest
)
);
DEFDLG_SetDefButton
(
hwnd
,
dlgInfo
,
hwndDest
);
}
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