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
f586e1cc
Commit
f586e1cc
authored
Aug 23, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Sep 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Add quick print support.
parent
6d73cd11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
3 deletions
+43
-3
resource.h
programs/wordpad/resource.h
+3
-2
wordpad.c
programs/wordpad/wordpad.c
+40
-1
No files found.
programs/wordpad/resource.h
View file @
f586e1cc
...
@@ -31,9 +31,10 @@
...
@@ -31,9 +31,10 @@
#define ID_PRINT 1010
#define ID_PRINT 1010
#define ID_PREVIEW 1011
#define ID_PREVIEW 1011
#define ID_PRINTSETUP 1012
#define ID_PRINTSETUP 1012
#define ID_PRINT_QUICK 1013
#define ID_FIND 101
3
#define ID_FIND 101
4
#define ID_FIND_NEXT 101
4
#define ID_FIND_NEXT 101
5
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101
#define ID_ALIGN_CENTER 1101
...
...
programs/wordpad/wordpad.c
View file @
f586e1cc
...
@@ -929,6 +929,7 @@ static int twips_to_centmm(int twips)
...
@@ -929,6 +929,7 @@ static int twips_to_centmm(int twips)
}
}
static
HGLOBAL
devMode
;
static
HGLOBAL
devMode
;
static
HGLOBAL
devNames
;
static
void
print
(
LPPRINTDLGW
pd
)
static
void
print
(
LPPRINTDLGW
pd
)
{
{
...
@@ -1006,6 +1007,7 @@ static void dialog_printsetup(void)
...
@@ -1006,6 +1007,7 @@ static void dialog_printsetup(void)
ps
.
rtMargin
.
top
=
twips_to_centmm
(
margins
.
top
);
ps
.
rtMargin
.
top
=
twips_to_centmm
(
margins
.
top
);
ps
.
rtMargin
.
bottom
=
twips_to_centmm
(
margins
.
bottom
);
ps
.
rtMargin
.
bottom
=
twips_to_centmm
(
margins
.
bottom
);
ps
.
hDevMode
=
devMode
;
ps
.
hDevMode
=
devMode
;
ps
.
hDevNames
=
devNames
;
if
(
PageSetupDlgW
(
&
ps
))
if
(
PageSetupDlgW
(
&
ps
))
{
{
...
@@ -1014,9 +1016,40 @@ static void dialog_printsetup(void)
...
@@ -1014,9 +1016,40 @@ static void dialog_printsetup(void)
margins
.
top
=
centmm_to_twips
(
ps
.
rtMargin
.
top
);
margins
.
top
=
centmm_to_twips
(
ps
.
rtMargin
.
top
);
margins
.
bottom
=
centmm_to_twips
(
ps
.
rtMargin
.
bottom
);
margins
.
bottom
=
centmm_to_twips
(
ps
.
rtMargin
.
bottom
);
devMode
=
ps
.
hDevMode
;
devMode
=
ps
.
hDevMode
;
devNames
=
ps
.
hDevNames
;
}
}
}
}
static
void
print_quick
(
void
)
{
PRINTDLGW
pd
;
ZeroMemory
(
&
pd
,
sizeof
(
pd
));
if
(
devMode
&&
devNames
)
{
LPDEVNAMES
dn
=
GlobalLock
(
devNames
);
LPDEVMODEW
dm
=
GlobalLock
(
devMode
);
pd
.
hDC
=
CreateDCW
((
LPWSTR
)
dn
+
dn
->
wDriverOffset
,
(
LPWSTR
)
dn
+
dn
->
wDeviceOffset
,
0
,
dm
);
GlobalUnlock
(
dn
);
GlobalUnlock
(
dm
);
}
else
{
ZeroMemory
(
&
pd
,
sizeof
(
pd
));
pd
.
lStructSize
=
sizeof
(
pd
);
pd
.
Flags
=
PD_RETURNDC
|
PD_RETURNDEFAULT
;
pd
.
hwndOwner
=
hMainWnd
;
pd
.
hDevMode
=
(
HGLOBAL
)
devMode
;
PrintDlgW
(
&
pd
);
devMode
=
pd
.
hDevMode
;
devNames
=
pd
.
hDevNames
;
}
print
(
&
pd
);
}
static
void
dialog_print
(
void
)
static
void
dialog_print
(
void
)
{
{
PRINTDLGW
pd
;
PRINTDLGW
pd
;
...
@@ -1030,6 +1063,7 @@ static void dialog_print(void)
...
@@ -1030,6 +1063,7 @@ static void dialog_print(void)
pd
.
nMinPage
=
1
;
pd
.
nMinPage
=
1
;
pd
.
nMaxPage
=
1
;
pd
.
nMaxPage
=
1
;
pd
.
hDevMode
=
devMode
;
pd
.
hDevMode
=
devMode
;
pd
.
hDevNames
=
devNames
;
SendMessageW
(
hEditorWnd
,
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
SendMessageW
(
hEditorWnd
,
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
if
(
from
==
to
)
if
(
from
==
to
)
...
@@ -1038,6 +1072,7 @@ static void dialog_print(void)
...
@@ -1038,6 +1072,7 @@ static void dialog_print(void)
if
(
PrintDlgW
(
&
pd
))
if
(
PrintDlgW
(
&
pd
))
{
{
devMode
=
pd
.
hDevMode
;
devMode
=
pd
.
hDevMode
;
devNames
=
pd
.
hDevNames
;
print
(
&
pd
);
print
(
&
pd
);
}
}
}
}
...
@@ -1643,7 +1678,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
...
@@ -1643,7 +1678,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILEOPEN
,
ID_FILE_OPEN
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILEOPEN
,
ID_FILE_OPEN
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILESAVE
,
ID_FILE_SAVE
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FILESAVE
,
ID_FILE_SAVE
);
AddSeparator
(
hToolBarWnd
);
AddSeparator
(
hToolBarWnd
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_PRINT
,
ID_PRINT
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_PRINT
,
ID_PRINT
_QUICK
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_PRINTPRE
,
ID_PREVIEW
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_PRINTPRE
,
ID_PREVIEW
);
AddSeparator
(
hToolBarWnd
);
AddSeparator
(
hToolBarWnd
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FIND
,
ID_FIND
);
AddButton
(
hToolBarWnd
,
nStdBitmaps
+
STD_FIND
,
ID_FIND
);
...
@@ -1888,6 +1923,10 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
...
@@ -1888,6 +1923,10 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
dialog_print
();
dialog_print
();
break
;
break
;
case
ID_PRINT_QUICK
:
print_quick
();
break
;
case
ID_PREVIEW
:
case
ID_PREVIEW
:
{
{
static
const
WCHAR
wszNotImplemented
[]
=
{
'N'
,
'o'
,
't'
,
' '
,
static
const
WCHAR
wszNotImplemented
[]
=
{
'N'
,
'o'
,
't'
,
' '
,
...
...
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