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
d5bb6169
Commit
d5bb6169
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 page setup dialog.
parent
61876c72
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
62 additions
and
6 deletions
+62
-6
De.rc
programs/wordpad/De.rc
+1
-0
En.rc
programs/wordpad/En.rc
+1
-0
Fr.rc
programs/wordpad/Fr.rc
+1
-0
Hu.rc
programs/wordpad/Hu.rc
+1
-0
Ko.rc
programs/wordpad/Ko.rc
+1
-0
Nl.rc
programs/wordpad/Nl.rc
+1
-0
No.rc
programs/wordpad/No.rc
+1
-0
Pl.rc
programs/wordpad/Pl.rc
+1
-0
Ru.rc
programs/wordpad/Ru.rc
+1
-0
Tr.rc
programs/wordpad/Tr.rc
+2
-0
resource.h
programs/wordpad/resource.h
+3
-2
wordpad.c
programs/wordpad/wordpad.c
+48
-4
No files found.
programs/wordpad/De.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Speichern &unter...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Beenden", ID_FILE_EXIT
END
...
...
programs/wordpad/En.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Save &as . . .", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_FILE_EXIT
END
...
...
programs/wordpad/Fr.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Enregistrer &sous...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Page setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Quitter", ID_FILE_EXIT
END
...
...
programs/wordpad/Hu.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Ments m&sknt...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Page setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Kilps", ID_FILE_EXIT
END
...
...
programs/wordpad/Ko.rc
View file @
d5bb6169
...
...
@@ -29,6 +29,7 @@ BEGIN
MENUITEM "다른 이름으로 저장(&A)...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "나가기(&X)", ID_FILE_EXIT
END
...
...
programs/wordpad/Nl.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Ops&laan als...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Afsluiten", ID_FILE_EXIT
END
...
...
programs/wordpad/No.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM "Lagre &som . . .", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Skriv ut . . .\tCtrl+P", ID_PRINT
MENUITEM "&Utskriftformat . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Avslutt", ID_FILE_EXIT
END
...
...
programs/wordpad/Pl.rc
View file @
d5bb6169
...
...
@@ -29,6 +29,7 @@ BEGIN
MENUITEM "Z&apisz jako...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "Za&kocz", ID_FILE_EXIT
END
...
...
programs/wordpad/Ru.rc
View file @
d5bb6169
...
...
@@ -28,6 +28,7 @@ BEGIN
MENUITEM " &...", ID_FILE_SAVEAS
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&", ID_FILE_EXIT
END
...
...
programs/wordpad/Tr.rc
View file @
d5bb6169
...
...
@@ -28,8 +28,10 @@ BEGIN
MENUITEM "&A...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Kaydet\tCtrl+S", ID_FILE_SAVE
MENUITEM "&Farkl Kaydet...", ID_FILE_SAVEAS
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&Print . . .\tCtrl+P", ID_PRINT
MENUITEM "Pag&e setup . . .", ID_PRINTSETUP
MENUITEM SEPARATOR
MENUITEM "&k", ID_FILE_EXIT
END
...
...
programs/wordpad/resource.h
View file @
d5bb6169
...
...
@@ -30,9 +30,10 @@
#define ID_PRINT 1010
#define ID_PREVIEW 1011
#define ID_PRINTSETUP 1012
#define ID_FIND 101
2
#define ID_FIND_NEXT 101
3
#define ID_FIND 101
3
#define ID_FIND_NEXT 101
4
#define ID_ALIGN_LEFT 1100
#define ID_ALIGN_CENTER 1101
...
...
programs/wordpad/wordpad.c
View file @
d5bb6169
...
...
@@ -915,6 +915,15 @@ static LONG devunits_to_twips(int units, int dpi)
return
(
LONG
)
ret
;
}
static
int
centmm_to_twips
(
int
mm
)
{
return
MulDiv
(
mm
,
567
,
1000
);
}
static
RECT
margins
;
static
HGLOBAL
devMode
;
static
void
print
(
LPPRINTDLGW
pd
)
{
FORMATRANGE
fr
;
...
...
@@ -929,10 +938,10 @@ static void print(LPPRINTDLGW pd)
width
=
devunits_to_twips
(
GetDeviceCaps
(
fr
.
hdc
,
PHYSICALWIDTH
),
dpiX
);
height
=
devunits_to_twips
(
GetDeviceCaps
(
fr
.
hdc
,
PHYSICALHEIGHT
),
dpiY
);
fr
.
rc
.
left
=
devunits_to_twips
(
GetDeviceCaps
(
fr
.
hdc
,
PHYSICALOFFSETX
),
dpiX
);
fr
.
rc
.
right
=
width
-
(
fr
.
rc
.
left
*
2
);
fr
.
rc
.
top
=
devunits_to_twips
(
GetDeviceCaps
(
fr
.
hdc
,
PHYSICALOFFSETY
),
dpiY
);
fr
.
rc
.
bottom
=
height
-
(
fr
.
rc
.
top
*
2
);
fr
.
rc
.
left
=
centmm_to_twips
(
margins
.
left
);
fr
.
rc
.
right
=
width
-
centmm_to_twips
(
margins
.
right
);
fr
.
rc
.
top
=
centmm_to_twips
(
margins
.
top
);
fr
.
rc
.
bottom
=
height
-
centmm_to_twips
(
margins
.
bottom
);
fr
.
rcPage
.
left
=
0
;
fr
.
rcPage
.
right
=
width
;
fr
.
rcPage
.
top
=
0
;
...
...
@@ -978,6 +987,32 @@ static void print(LPPRINTDLGW pd)
SendMessageW
(
hEditorWnd
,
EM_FORMATRANGE
,
FALSE
,
0
);
}
static
void
registry_read_margins
(
void
)
{
margins
.
top
=
2500
;
margins
.
bottom
=
2500
;
margins
.
left
=
3100
;
margins
.
right
=
3100
;
}
static
void
dialog_printsetup
(
void
)
{
PAGESETUPDLGW
ps
;
ZeroMemory
(
&
ps
,
sizeof
(
ps
));
ps
.
lStructSize
=
sizeof
(
ps
);
ps
.
hwndOwner
=
hMainWnd
;
ps
.
Flags
=
PSD_INHUNDREDTHSOFMILLIMETERS
|
PSD_MARGINS
;
ps
.
rtMargin
=
margins
;
ps
.
hDevMode
=
devMode
;
if
(
PageSetupDlgW
(
&
ps
))
{
margins
=
ps
.
rtMargin
;
devMode
=
ps
.
hDevMode
;
}
}
static
void
dialog_print
(
void
)
{
PRINTDLGW
pd
;
...
...
@@ -990,13 +1025,17 @@ static void dialog_print(void)
pd
.
Flags
=
PD_RETURNDC
|
PD_USEDEVMODECOPIESANDCOLLATE
;
pd
.
nMinPage
=
1
;
pd
.
nMaxPage
=
1
;
pd
.
hDevMode
=
devMode
;
SendMessageW
(
hEditorWnd
,
EM_GETSEL
,
(
WPARAM
)
&
from
,
(
LPARAM
)
&
to
);
if
(
from
==
to
)
pd
.
Flags
|=
PD_NOSELECTION
;
if
(
PrintDlgW
(
&
pd
))
{
devMode
=
pd
.
hDevMode
;
print
(
&
pd
);
}
}
static
void
HandleCommandLine
(
LPWSTR
cmdline
)
...
...
@@ -1660,6 +1699,7 @@ static LRESULT OnCreate( HWND hWnd, WPARAM wParam, LPARAM lParam)
registry_read_filelist
(
hWnd
);
registry_read_options
();
registry_read_margins
();
DragAcceptFiles
(
hWnd
,
TRUE
);
return
0
;
...
...
@@ -1834,6 +1874,10 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
}
break
;
case
ID_PRINTSETUP
:
dialog_printsetup
();
break
;
case
ID_FORMAT_BOLD
:
case
ID_FORMAT_ITALIC
:
case
ID_FORMAT_UNDERLINE
:
...
...
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