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
218c478d
Commit
218c478d
authored
Jul 14, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allocate the dialog info in DIALOG_CreateIndirect if this wasn't
already done by the dialog procedure.
parent
5288361f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
22 deletions
+19
-22
controls.h
dlls/user/controls.h
+1
-5
dialog16.c
dlls/user/dialog16.c
+1
-1
defdlg.c
windows/defdlg.c
+12
-11
dialog.c
windows/dialog.c
+5
-5
No files found.
dlls/user/controls.h
View file @
218c478d
...
...
@@ -134,11 +134,7 @@ typedef struct
/* offset of DIALOGINFO ptr in dialog extra bytes */
#define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
inline
static
DIALOGINFO
*
DIALOG_get_info
(
HWND
hwnd
)
{
return
(
DIALOGINFO
*
)
GetWindowLongW
(
hwnd
,
DWL_WINE_DIALOGINFO
);
}
extern
DIALOGINFO
*
DIALOG_get_info
(
HWND
hwnd
,
BOOL
create
);
extern
BOOL
DIALOG_GetCharSize
(
HDC
hdc
,
HFONT
hFont
,
SIZE
*
pSize
);
extern
void
DIALOG_EnableOwner
(
HWND
hOwner
);
extern
BOOL
DIALOG_DisableOwner
(
HWND
hOwner
);
...
...
dlls/user/dialog16.c
View file @
218c478d
...
...
@@ -139,7 +139,7 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info )
static
BOOL
DIALOG_CreateControls16
(
HWND
hwnd
,
LPCSTR
template
,
const
DLG_TEMPLATE
*
dlgTemplate
,
HINSTANCE16
hInst
)
{
DIALOGINFO
*
dlgInfo
=
DIALOG_get_info
(
hwnd
);
DIALOGINFO
*
dlgInfo
=
DIALOG_get_info
(
hwnd
,
TRUE
);
DLG_CONTROL_INFO
info
;
HWND
hwndCtrl
,
hwndDefButton
=
0
;
INT
items
=
dlgTemplate
->
nbItems
;
...
...
windows/defdlg.c
View file @
218c478d
...
...
@@ -81,7 +81,7 @@ static void DEFDLG_SaveFocus( HWND hwnd )
HWND
hwndFocus
=
GetFocus
();
if
(
!
hwndFocus
||
!
IsChild
(
hwnd
,
hwndFocus
))
return
;
if
(
!
(
infoPtr
=
DIALOG_get_info
(
hwnd
)))
return
;
if
(
!
(
infoPtr
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
return
;
infoPtr
->
hwndFocus
=
hwndFocus
;
/* Remove default button */
}
...
...
@@ -95,7 +95,7 @@ static void DEFDLG_RestoreFocus( HWND hwnd )
DIALOGINFO
*
infoPtr
;
if
(
IsIconic
(
hwnd
))
return
;
if
(
!
(
infoPtr
=
DIALOG_get_info
(
hwnd
)))
return
;
if
(
!
(
infoPtr
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
return
;
if
(
!
IsWindow
(
infoPtr
->
hwndFocus
))
return
;
/* Don't set the focus back to controls if EndDialog is already called.*/
if
(
!
(
infoPtr
->
flags
&
DF_END
))
...
...
@@ -284,16 +284,17 @@ static LRESULT DEFDLG_Epilog(HWND hwnd, UINT msg, BOOL fResult)
}
/***********************************************************************
* D
EFDLG_InitDlgI
nfo
* D
IALOG_get_i
nfo
*
*
Allocate memory for DIALOGINFO structure and store in DWL_DIALOGINFO
*
structure. Also flag the window as a dialog type
.
*
Get the DIALOGINFO structure of a window, allocating it if needed
*
and 'create' is TRUE
.
*/
static
DIALOGINFO
*
DEFDLG_InitDlgInfo
(
HWND
hwnd
)
DIALOGINFO
*
DIALOG_get_info
(
HWND
hwnd
,
BOOL
create
)
{
WND
*
wndPtr
;
DIALOGINFO
*
dlgInfo
=
DIALOG_get_info
(
hwnd
);
if
(
!
dlgInfo
)
DIALOGINFO
*
dlgInfo
=
(
DIALOGINFO
*
)
GetWindowLongW
(
hwnd
,
DWL_WINE_DIALOGINFO
);
if
(
!
dlgInfo
&&
create
)
{
if
(
!
(
dlgInfo
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dlgInfo
)
)))
return
NULL
;
dlgInfo
->
hwndFocus
=
0
;
...
...
@@ -332,7 +333,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
BOOL
result
=
FALSE
;
/* Perform DIALOGINFO intialization if not done */
if
(
!
(
dlgInfo
=
D
EFDLG_InitDlgInfo
(
hwnd32
)))
return
-
1
;
if
(
!
(
dlgInfo
=
D
IALOG_get_info
(
hwnd32
,
TRUE
)))
return
-
1
;
SetWindowLongW
(
hwnd32
,
DWL_MSGRESULT
,
0
);
...
...
@@ -389,7 +390,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
BOOL
result
=
FALSE
;
/* Perform DIALOGINFO initialization if not done */
if
(
!
(
dlgInfo
=
D
EFDLG_InitDlgInfo
(
hwnd
)))
return
-
1
;
if
(
!
(
dlgInfo
=
D
IALOG_get_info
(
hwnd
,
TRUE
)))
return
-
1
;
SetWindowLongW
(
hwnd
,
DWL_MSGRESULT
,
0
);
...
...
@@ -446,7 +447,7 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
WNDPROC
dlgproc
;
/* Perform DIALOGINFO intialization if not done */
if
(
!
(
dlgInfo
=
D
EFDLG_InitDlgInfo
(
hwnd
)))
return
-
1
;
if
(
!
(
dlgInfo
=
D
IALOG_get_info
(
hwnd
,
TRUE
)))
return
-
1
;
SetWindowLongW
(
hwnd
,
DWL_MSGRESULT
,
0
);
...
...
windows/dialog.c
View file @
218c478d
...
...
@@ -288,7 +288,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
static
BOOL
DIALOG_CreateControls32
(
HWND
hwnd
,
LPCSTR
template
,
const
DLG_TEMPLATE
*
dlgTemplate
,
HINSTANCE
hInst
,
BOOL
unicode
)
{
DIALOGINFO
*
dlgInfo
=
DIALOG_get_info
(
hwnd
);
DIALOGINFO
*
dlgInfo
=
DIALOG_get_info
(
hwnd
,
TRUE
);
DLG_CONTROL_INFO
info
;
HWND
hwndCtrl
,
hwndDefButton
=
0
;
INT
items
=
dlgTemplate
->
nbItems
;
...
...
@@ -633,7 +633,7 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
/* moved this from the top of the method to here as DIALOGINFO structure
will be valid only after WM_CREATE message has been handled in DefDlgProc
All the members of the structure get filled here using temp variables */
dlgInfo
=
DIALOG_get_info
(
hwnd
);
dlgInfo
=
DIALOG_get_info
(
hwnd
,
TRUE
);
dlgInfo
->
hwndFocus
=
0
;
dlgInfo
->
hUserFont
=
hUserFont
;
dlgInfo
->
hMenu
=
hMenu
;
...
...
@@ -764,7 +764,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
INT
retval
;
HWND
ownerMsg
=
GetAncestor
(
owner
,
GA_ROOT
);
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
)))
return
-
1
;
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
return
-
1
;
if
(
!
(
dlgInfo
->
flags
&
DF_END
))
/* was EndDialog called in WM_INITDIALOG ? */
{
...
...
@@ -876,7 +876,7 @@ BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval )
TRACE
(
"%p %d
\n
"
,
hwnd
,
retval
);
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
)))
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
{
ERR
(
"got invalid window handle (%p); buggy app !?
\n
"
,
hwnd
);
return
FALSE
;
...
...
@@ -1455,7 +1455,7 @@ DWORD WINAPI GetDialogBaseUnits(void)
BOOL
WINAPI
MapDialogRect
(
HWND
hwnd
,
LPRECT
rect
)
{
DIALOGINFO
*
dlgInfo
;
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
)))
return
FALSE
;
if
(
!
(
dlgInfo
=
DIALOG_get_info
(
hwnd
,
FALSE
)))
return
FALSE
;
rect
->
left
=
MulDiv
(
rect
->
left
,
dlgInfo
->
xBaseUnit
,
4
);
rect
->
right
=
MulDiv
(
rect
->
right
,
dlgInfo
->
xBaseUnit
,
4
);
rect
->
top
=
MulDiv
(
rect
->
top
,
dlgInfo
->
yBaseUnit
,
8
);
...
...
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