Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
4126e8bf
Commit
4126e8bf
authored
16 years ago
by
Huw Davies
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
comdlg32: Simplify the preview change function a little.
parent
048b57d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comdlg32/printdlg.c
+33
-39
33 additions, 39 deletions
dlls/comdlg32/printdlg.c
with
33 additions
and
39 deletions
dlls/comdlg32/printdlg.c
+
33
−
39
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
=
(
pd
a
->
rtDrawRect
.
bottom
+
pd
a
->
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
,
r
ct
2
),
x
+
width
,
y
+
SHADOW
,
SHADOW
,
height
,
FALSE
);
MoveWindow
(
GetDlgItem
(
pda
->
hDlg
,
rct3
),
x
+
SHADOW
,
y
+
height
,
width
,
SHADOW
,
FALSE
);
MoveWindow
(
GetDlgItem
(
p
da
->
hDlg
,
rct
1
),
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
=
dat
a
->
rtDrawRect
.
bottom
-
dat
a
->
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
->
rtDrawRe
ct
),
x
,
y
,
width
,
height
);
MoveWindow
(
GetDlgItem
(
d
at
a
->
hDlg
,
rct
2
),
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment