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
72b940e0
Commit
72b940e0
authored
Aug 07, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix the dialog centering logic.
parent
315c097a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
dialog.c
dlls/msi/dialog.c
+23
-16
No files found.
dlls/msi/dialog.c
View file @
72b940e0
...
@@ -2077,25 +2077,36 @@ static void msi_get_screen_resolution( msi_dialog *dialog, UINT *xres, UINT *yre
...
@@ -2077,25 +2077,36 @@ static void msi_get_screen_resolution( msi_dialog *dialog, UINT *xres, UINT *yre
*
yres
=
atolW
(
num
);
*
yres
=
atolW
(
num
);
}
}
static
void
msi_dialog_adjust_dialog_pos
(
msi_dialog
*
dialog
,
LPRECT
pos
,
LPSIZE
sz
)
static
void
msi_dialog_adjust_dialog_pos
(
msi_dialog
*
dialog
,
MSIRECORD
*
rec
,
LPRECT
pos
)
{
{
UINT
xres
,
yres
;
UINT
xres
,
yres
;
POINT
center
;
SIZE
sz
;
LONG
style
;
LONG
style
;
sz
->
cx
=
msi_dialog_scale_unit
(
dialog
,
sz
->
cx
);
center
.
x
=
MSI_RecordGetInteger
(
rec
,
2
);
sz
->
cy
=
msi_dialog_scale_unit
(
dialog
,
sz
->
cy
);
center
.
y
=
MSI_RecordGetInteger
(
rec
,
3
);
sz
.
cx
=
MSI_RecordGetInteger
(
rec
,
4
);
sz
.
cy
=
MSI_RecordGetInteger
(
rec
,
5
);
sz
.
cx
=
msi_dialog_scale_unit
(
dialog
,
sz
.
cx
);
sz
.
cy
=
msi_dialog_scale_unit
(
dialog
,
sz
.
cy
);
msi_get_screen_resolution
(
dialog
,
&
xres
,
&
yres
);
msi_get_screen_resolution
(
dialog
,
&
xres
,
&
yres
);
pos
->
left
=
MulDiv
(
pos
->
left
,
xres
,
100
);
center
.
x
=
MulDiv
(
center
.
x
,
xres
,
100
);
pos
->
top
=
MulDiv
(
pos
->
top
,
yres
,
100
);
center
.
y
=
MulDiv
(
center
.
y
,
yres
,
100
);
/* turn the client pos into the window rectangle */
/* turn the client pos into the window rectangle */
pos
->
right
=
pos
->
left
+
sz
->
cx
;
pos
->
left
=
center
.
x
-
sz
.
cx
/
2
;
pos
->
bottom
=
pos
->
top
+
sz
->
cy
;
pos
->
right
=
pos
->
left
+
sz
.
cx
;
pos
->
top
=
center
.
y
-
sz
.
cy
/
2
;
pos
->
bottom
=
pos
->
top
+
sz
.
cy
;
TRACE
(
"%lu %lu %lu %lu
\n
"
,
pos
->
left
,
pos
->
top
,
pos
->
right
,
pos
->
bottom
);
style
=
GetWindowLongPtrW
(
dialog
->
hwnd
,
GWL_STYLE
);
style
=
GetWindowLongPtrW
(
dialog
->
hwnd
,
GWL_STYLE
);
AdjustWindowRect
(
pos
,
style
,
FALSE
);
AdjustWindowRect
(
pos
,
style
,
FALSE
);
sz
->
cx
=
pos
->
right
-
pos
->
left
;
sz
->
cy
=
pos
->
bottom
-
pos
->
top
;
}
}
static
BOOL
msi_control_set_next
(
msi_control
*
control
,
msi_control
*
next
)
static
BOOL
msi_control_set_next
(
msi_control
*
control
,
msi_control
*
next
)
...
@@ -2140,7 +2151,6 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
...
@@ -2140,7 +2151,6 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
msi_dialog
*
dialog
=
(
msi_dialog
*
)
cs
->
lpCreateParams
;
msi_dialog
*
dialog
=
(
msi_dialog
*
)
cs
->
lpCreateParams
;
MSIRECORD
*
rec
=
NULL
;
MSIRECORD
*
rec
=
NULL
;
LPWSTR
title
=
NULL
;
LPWSTR
title
=
NULL
;
SIZE
size
;
RECT
pos
;
RECT
pos
;
TRACE
(
"%p %p
\n
"
,
dialog
,
dialog
->
package
);
TRACE
(
"%p %p
\n
"
,
dialog
,
dialog
->
package
);
...
@@ -2157,11 +2167,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
...
@@ -2157,11 +2167,7 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
dialog
->
scale
=
msi_dialog_get_sans_serif_height
(
dialog
->
hwnd
);
dialog
->
scale
=
msi_dialog_get_sans_serif_height
(
dialog
->
hwnd
);
pos
.
left
=
MSI_RecordGetInteger
(
rec
,
2
);
msi_dialog_adjust_dialog_pos
(
dialog
,
rec
,
&
pos
);
pos
.
top
=
MSI_RecordGetInteger
(
rec
,
3
);
size
.
cx
=
MSI_RecordGetInteger
(
rec
,
4
);
size
.
cy
=
MSI_RecordGetInteger
(
rec
,
5
);
msi_dialog_adjust_dialog_pos
(
dialog
,
&
pos
,
&
size
);
dialog
->
attributes
=
MSI_RecordGetInteger
(
rec
,
6
);
dialog
->
attributes
=
MSI_RecordGetInteger
(
rec
,
6
);
...
@@ -2176,7 +2182,8 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
...
@@ -2176,7 +2182,8 @@ static LRESULT msi_dialog_oncreate( HWND hwnd, LPCREATESTRUCTW cs )
SetWindowTextW
(
hwnd
,
title
);
SetWindowTextW
(
hwnd
,
title
);
msi_free
(
title
);
msi_free
(
title
);
SetWindowPos
(
hwnd
,
0
,
pos
.
left
,
pos
.
top
,
size
.
cx
,
size
.
cy
,
SetWindowPos
(
hwnd
,
0
,
pos
.
left
,
pos
.
top
,
pos
.
right
-
pos
.
left
,
pos
.
bottom
-
pos
.
top
,
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_NOREDRAW
);
SWP_NOACTIVATE
|
SWP_NOZORDER
|
SWP_NOREDRAW
);
msi_dialog_build_font_list
(
dialog
);
msi_dialog_build_font_list
(
dialog
);
...
...
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