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
4126e8bf
Commit
4126e8bf
authored
Jan 21, 2009
by
Huw Davies
Committed by
Alexandre Julliard
Jan 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Simplify the preview change function a little.
parent
048b57d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
39 deletions
+33
-39
printdlg.c
dlls/comdlg32/printdlg.c
+33
-39
No files found.
dlls/comdlg32/printdlg.c
View file @
4126e8bf
...
...
@@ -3097,46 +3097,40 @@ PRINTDLG_PS_ChangePrinterW(HWND hDlg, PageSetupDataW *pdw) {
}
/******************************************************************************************
* PRINTDLG_PS_ChangePaperPrev
*
* Changes paper preview size / position
* pagesetup_change_preview
*
* PARAMS:
* pda [i] Pointer for current PageSetupDataA structure
* Changes paper preview size / position
*
* RETURNS:
* always - TRUE
*/
static
BOOL
PRINTDLG_PS_ChangePaperPrev
(
const
PageSetupDataA
*
pda
)
static
void
pagesetup_change_preview
(
const
PageSetupDataA
*
data
)
{
LONG
width
,
height
,
x
,
y
;
RECT
rtT
mp
;
if
(
pda
->
dlga
->
ptPaperSize
.
x
>
pda
->
dlga
->
ptPaperSize
.
y
)
{
width
=
pda
->
rtDrawRect
.
right
-
pda
->
rtDrawRect
.
left
;
height
=
pda
->
dlga
->
ptPaperSize
.
y
*
width
/
pda
->
dlga
->
ptPaperSize
.
x
;
}
else
{
height
=
pda
->
rtDrawRect
.
bottom
-
pda
->
rtDrawRect
.
top
;
width
=
pda
->
dlga
->
ptPaperSize
.
x
*
height
/
pda
->
dlga
->
ptPaperSize
.
y
;
}
x
=
(
pda
->
rtDrawRect
.
right
+
pda
->
rtDrawRect
.
left
-
width
)
/
2
;
y
=
(
pda
->
rtDrawRect
.
bottom
+
pda
->
rtDrawRect
.
top
-
height
)
/
2
;
TRACE
(
"rtDrawRect(%d, %d, %d, %d) x=%d, y=%d, w=%d, h=%d
\n
"
,
pda
->
rtDrawRect
.
left
,
pda
->
rtDrawRect
.
top
,
pda
->
rtDrawRect
.
right
,
pda
->
rtDrawRect
.
bottom
,
x
,
y
,
width
,
height
)
;
#define SHADOW 4
MoveWindow
(
GetDlgItem
(
pda
->
hDlg
,
rct2
),
x
+
width
,
y
+
SHADOW
,
SHADOW
,
height
,
FALSE
);
MoveWindow
(
GetDlgItem
(
pda
->
hDlg
,
rct3
),
x
+
SHADOW
,
y
+
height
,
width
,
SHADOW
,
FALSE
);
MoveWindow
(
GetDlgItem
(
pda
->
hDlg
,
rct1
),
x
,
y
,
width
,
height
,
FALSE
);
rtTmp
=
pda
->
rtDrawRect
;
rtTmp
.
right
+=
SHADOW
;
rtTmp
.
bottom
+=
SHADOW
;
#undef SHADOW
InvalidateRect
(
pda
->
hDlg
,
&
rtTmp
,
TRUE
)
;
return
TRUE
;
RECT
t
mp
;
const
int
shadow
=
4
;
if
(
pagesetup_get_orientation
(
data
)
==
DMORIENT_LANDSCAPE
)
{
width
=
data
->
rtDrawRect
.
right
-
data
->
rtDrawRect
.
left
;
height
=
data
->
dlga
->
ptPaperSize
.
y
*
width
/
data
->
dlga
->
ptPaperSize
.
x
;
}
else
{
height
=
data
->
rtDrawRect
.
bottom
-
data
->
rtDrawRect
.
top
;
width
=
data
->
dlga
->
ptPaperSize
.
x
*
height
/
data
->
dlga
->
ptPaperSize
.
y
;
}
x
=
(
data
->
rtDrawRect
.
right
+
data
->
rtDrawRect
.
left
-
width
)
/
2
;
y
=
(
data
->
rtDrawRect
.
bottom
+
data
->
rtDrawRect
.
top
-
height
)
/
2
;
TRACE
(
"draw rect %s x=%d, y=%d, w=%d, h=%d
\n
"
,
wine_dbgstr_rect
(
&
data
->
rtDrawRect
),
x
,
y
,
width
,
height
);
MoveWindow
(
GetDlgItem
(
data
->
hDlg
,
rct2
),
x
+
width
,
y
+
shadow
,
shadow
,
height
,
FALSE
);
MoveWindow
(
GetDlgItem
(
data
->
hDlg
,
rct3
),
x
+
shadow
,
y
+
height
,
width
,
shadow
,
FALSE
)
;
MoveWindow
(
GetDlgItem
(
data
->
hDlg
,
rct1
),
x
,
y
,
width
,
height
,
FALSE
)
;
tmp
=
data
->
rtDrawRect
;
tmp
.
right
+=
shadow
;
tmp
.
bottom
+=
shadow
;
InvalidateRect
(
data
->
hDlg
,
&
tmp
,
TRUE
)
;
}
static
inline
LONG
*
element_from_margin_id
(
RECT
*
rc
,
WORD
id
)
...
...
@@ -3261,7 +3255,7 @@ static void pagesetup_printer_properties(HWND hDlg, PageSetupDataA *data)
pagesetup_update_orientation_buttons
(
hDlg
,
data
);
/* Changing paper preview */
PRINTDLG_PS_ChangePaperPrev
(
data
);
pagesetup_change_preview
(
data
);
/* Selecting paper in combo */
count
=
SendDlgItemMessageW
(
hDlg
,
cmb2
,
CB_GETCOUNT
,
0
,
0
);
...
...
@@ -3320,7 +3314,7 @@ PRINTDLG_PS_WMCommandA(
pagesetup_update_papersize
(
pda
);
rotate_rect
(
&
pda
->
dlga
->
rtMargin
,
(
id
==
rad2
));
update_margin_edits
(
hDlg
,
pda
,
0
);
PRINTDLG_PS_ChangePaperPrev
(
pda
);
pagesetup_change_preview
(
pda
);
}
break
;
case
cmb1
:
/* Printer combo */
...
...
@@ -3341,7 +3335,7 @@ PRINTDLG_PS_WMCommandA(
{
pagesetup_set_papersize
(
pda
,
paperword
);
pagesetup_update_papersize
(
pda
);
PRINTDLG_PS_ChangePaperPrev
(
pda
);
pagesetup_change_preview
(
pda
);
}
else
FIXME
(
"could not get dialog text for papersize cmbbox?
\n
"
);
}
...
...
@@ -3731,7 +3725,7 @@ PRINTDLG_PageDlgProcA(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
pagesetup_set_defaultsource
(
pda
,
DMBIN_FORMSOURCE
);
/* FIXME: This is the auto select bin. Is this correct? */
/* Drawing paper prev */
PRINTDLG_PS_ChangePaperPrev
(
pda
);
pagesetup_change_preview
(
pda
);
return
TRUE
;
}
else
{
pda
=
GetPropW
(
hDlg
,
pagesetupdlg_prop
);
...
...
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