Commit f124a586 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

wordpad: Added option to disable word wrap.

parent 8ef9d20f
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Liniebrydning", 0, 10, 10, 130, 85
RADIOBUTTON "Bryd tekst efter v&indusbredden", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Bryd tekst efter &margen", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Bryd tekst efter v&indusbredden", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Bryd tekst efter &margen", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Vrktjslinier", 0, 150, 10, 120, 85
CHECKBOX "&Vrktjslinie", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatteringlinie", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -166,8 +166,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Zeilenumbruch", 0, 10, 10, 130, 85
RADIOBUTTON "&Am Fenster umbrechen", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "A&m Lineal umbrechen", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "&Am Fenster umbrechen", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "A&m Lineal umbrechen", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Symbolleisten", 0, 150, 10, 120, 85
CHECKBOX "&Symbolleiste", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatierungsleiste", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Line wrapping", 0, 10, 10, 130, 85
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "&No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Toolbars", 0, 150, 10, 120, 85
CHECKBOX "&Toolbar", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatbar", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Enveloppement de ligne", 0, 10, 10, 170, 85
RADIOBUTTON "Enveloppe le texte partir de la bordure de fentre", IDC_PAGEFMT_WW, 18, 25, 145, 15
RADIOBUTTON "Enveloppe le texte partir de la &marge", IDC_PAGEFMT_WM, 18, 45, 145, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 145, 15
RADIOBUTTON "Enveloppe le texte partir de la bordure de fentre", IDC_PAGEFMT_WW, 18, 45, 145, 15
RADIOBUTTON "Enveloppe le texte partir de la &marge", IDC_PAGEFMT_WM, 18, 65, 145, 15
GROUPBOX "Barres d'outils", 0, 170, 10, 120, 85
CHECKBOX "&Barre d'outils", IDC_PAGEFMT_TB, 180, 20, 80, 15
CHECKBOX "Barre de &format", IDC_PAGEFMT_FB, 180, 38, 80, 15
......
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Line wrapping", 0, 10, 10, 130, 85
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Toolbars", 0, 150, 10, 120, 85
CHECKBOX "&Toolbar", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatbar", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -167,8 +167,9 @@ CAPTION ""
FONT 9, "MS Shell Dlg"
BEGIN
GROUPBOX "行の折り返し", 0, 10, 10, 130, 85
RADIOBUTTON "ウィンドウの境界で折り返す(&W)", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "マージンで折り返す(&M)", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "ウィンドウの境界で折り返す(&W)", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "マージンで折り返す(&M)", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "ツールバー", 0, 150, 10, 120, 85
CHECKBOX "ツールバー(&T)", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "書式バー(&F)", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -166,8 +166,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "줄 넘기기", 0, 10, 10, 130, 85
RADIOBUTTON "창 가장자리서 글 넘기기(&W)", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "가장자리에서 줄 넘기기(&M)", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "창 가장자리서 글 넘기기(&W)", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "가장자리에서 줄 넘기기(&M)", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX " 도구바", 0, 150, 10, 120, 85
CHECKBOX "도구바(&T)", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "형식바(&F)", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -165,8 +165,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Regel afbreken", 0, 10, 10, 130, 85
RADIOBUTTON "Breek tekst af bij &venster rand", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Breek tekst af bij de &marge", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Breek tekst af bij &venster rand", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Breek tekst af bij de &marge", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Toolbars", 0, 150, 10, 120, 85
CHECKBOX "&Toolbalk", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formaatbalk", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Linjebryting", 0, 10, 10, 130, 85
RADIOBUTTON "Bryt tekst etter v&indusbredden", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Bryt tekst etter &margen", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Bryt tekst etter v&indusbredden", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Bryt tekst etter &margen", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Verktylinjer", 0, 150, 10, 120, 85
CHECKBOX "&Verktylinje", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatlinje", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -165,8 +165,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Zawijanie wierszy", 0, 10, 10, 130, 85
RADIOBUTTON "Zawijaj do &brzegu okna", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Zawijaj do &marginesu", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Zawijaj do &brzegu okna", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Zawijaj do &marginesu", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Paski narzdzi", 0, 150, 10, 120, 85
CHECKBOX "Pasek &narzdzi", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "Pasek &formatu", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -164,8 +164,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX " ", 0, 10, 10, 130, 85
RADIOBUTTON " &", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON " &", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON " &", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON " &", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "", 0, 150, 10, 120, 85
CHECKBOX "&", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -166,8 +166,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Prelom vrstic", 0, 10, 10, 130, 85
RADIOBUTTON "Prelomi besedilo na robu o&kna", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Prelomi besedilo na robu &papirja", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Prelomi besedilo na robu o&kna", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Prelomi besedilo na robu &papirja", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Orodne vrstice", 0, 150, 10, 120, 85
CHECKBOX "O&rodna vrstica", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "O&blikovna vrstica", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -166,8 +166,9 @@ Caption ""
FONT 8, "MS Shell Dlg"
BEGIN
GROUPBOX "Line wrapping", 0, 10, 10, 130, 85
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "Wrap text by the &window border", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "Wrap text by the &margin", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "Toolbars", 0, 150, 10, 120, 85
CHECKBOX "&Toolbar", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "&Formatbar", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -169,8 +169,9 @@ Caption ""
FONT 9, "MS Song"
BEGIN
GROUPBOX "自动换行", 0, 10, 10, 130, 85
RADIOBUTTON "按视窗宽度(&W)", IDC_PAGEFMT_WW, 18, 25, 117, 15
RADIOBUTTON "按纸张宽度(&M)", IDC_PAGEFMT_WM, 18, 45, 117, 15
RADIOBUTTON "No line wrapping", IDC_PAGEFMT_WN, 18, 25, 117, 15
RADIOBUTTON "按视窗宽度(&W)", IDC_PAGEFMT_WW, 18, 45, 117, 15
RADIOBUTTON "按纸张宽度(&M)", IDC_PAGEFMT_WM, 18, 65, 117, 15
GROUPBOX "工具栏", 0, 150, 10, 120, 85
CHECKBOX "工具栏(&T)", IDC_PAGEFMT_TB, 160, 20, 80, 15
CHECKBOX "格式工具栏(&F)", IDC_PAGEFMT_FB, 160, 38, 80, 15
......
......@@ -179,25 +179,35 @@ static RECT get_print_rect(HDC hdc)
void target_device(HWND hMainWnd, DWORD wordWrap)
{
HWND hEditorWnd = GetDlgItem(hMainWnd, IDC_EDITOR);
HDC hdc = make_dc();
int width = 0;
if(wordWrap == ID_WORDWRAP_MARGIN)
{
int width = 0;
LRESULT result;
HDC hdc = make_dc();
RECT rc = get_print_rect(hdc);
width = rc.right - rc.left;
}
width = rc.right - rc.left;
if(!hdc)
{
HDC hMaindc = GetDC(hMainWnd);
hdc = CreateCompatibleDC(hMaindc);
ReleaseDC(hMainWnd, hMaindc);
}
result = SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, (WPARAM)hdc, width);
DeleteDC(hdc);
if (result)
return;
/* otherwise EM_SETTARGETDEVICE failed, so fall back on wrapping
* to window using the NULL DC. */
}
SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, (WPARAM)hdc, width);
if (wordWrap != ID_WORDWRAP_NONE) {
SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, 0, 0);
} else {
SendMessageW(hEditorWnd, EM_SETTARGETDEVICE, 0, 1);
}
DeleteDC(hdc);
}
static LPWSTR dialog_print_to_file(HWND hMainWnd)
......
......@@ -366,7 +366,7 @@ static void registry_read_formatopts(int index, LPCWSTR key, DWORD barState[], D
if(index == reg_formatindex(SF_RTF))
wordWrap[index] = ID_WORDWRAP_WINDOW;
else if(index == reg_formatindex(SF_TEXT))
wordWrap[index] = ID_WORDWRAP_WINDOW; /* FIXME: should be ID_WORDWRAP_NONE once we support it */
wordWrap[index] = ID_WORDWRAP_NONE;
RegCloseKey(hKey);
}
......
......@@ -980,13 +980,15 @@ static INT_PTR CALLBACK formatopts_proc(HWND hWnd, UINT message, WPARAM wParam,
sprintf(id, "%d\n", (int)ps->lParam);
SetWindowTextA(hIdWnd, id);
if(wordWrap[ps->lParam] == ID_WORDWRAP_WINDOW)
if(wordWrap[ps->lParam] == ID_WORDWRAP_NONE)
wrap = IDC_PAGEFMT_WN;
else if(wordWrap[ps->lParam] == ID_WORDWRAP_WINDOW)
wrap = IDC_PAGEFMT_WW;
else if(wordWrap[ps->lParam] == ID_WORDWRAP_MARGIN)
wrap = IDC_PAGEFMT_WM;
if(wrap != -1)
CheckRadioButton(hWnd, IDC_PAGEFMT_WW,
CheckRadioButton(hWnd, IDC_PAGEFMT_WN,
IDC_PAGEFMT_WM, wrap);
if(barState[ps->lParam] & (1 << BANDID_TOOLBAR))
......@@ -1003,9 +1005,10 @@ static INT_PTR CALLBACK formatopts_proc(HWND hWnd, UINT message, WPARAM wParam,
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDC_PAGEFMT_WN:
case IDC_PAGEFMT_WW:
case IDC_PAGEFMT_WM:
CheckRadioButton(hWnd, IDC_PAGEFMT_WW, IDC_PAGEFMT_WM,
CheckRadioButton(hWnd, IDC_PAGEFMT_WN, IDC_PAGEFMT_WM,
LOWORD(wParam));
break;
......@@ -1029,7 +1032,9 @@ static INT_PTR CALLBACK formatopts_proc(HWND hWnd, UINT message, WPARAM wParam,
GetWindowTextA(hIdWnd, sid, 4);
id = atoi(sid);
if(IsDlgButtonChecked(hWnd, IDC_PAGEFMT_WW))
if(IsDlgButtonChecked(hWnd, IDC_PAGEFMT_WN))
wordWrap[id] = ID_WORDWRAP_NONE;
else if(IsDlgButtonChecked(hWnd, IDC_PAGEFMT_WW))
wordWrap[id] = ID_WORDWRAP_WINDOW;
else if(IsDlgButtonChecked(hWnd, IDC_PAGEFMT_WM))
wordWrap[id] = ID_WORDWRAP_MARGIN;
......@@ -1819,7 +1824,7 @@ static LRESULT OnCreate( HWND hWnd )
hEditorWnd = CreateWindowExW(WS_EX_CLIENTEDGE, wszRichEditClass, NULL,
WS_CHILD|WS_VISIBLE|ES_SELECTIONBAR|ES_MULTILINE|ES_AUTOVSCROLL
|ES_WANTRETURN|WS_VSCROLL|ES_NOHIDESEL,
|ES_WANTRETURN|WS_VSCROLL|ES_NOHIDESEL|WS_HSCROLL,
0, 0, 1000, 100, hWnd, (HMENU)IDC_EDITOR, hInstance, NULL);
if (!hEditorWnd)
......
......@@ -114,9 +114,10 @@
#define IDC_PAGEFMT_FB 101
#define IDC_PAGEFMT_RU 102
#define IDC_PAGEFMT_SB 103
#define IDC_PAGEFMT_WW 104
#define IDC_PAGEFMT_WM 105
#define IDC_PAGEFMT_ID 106
#define IDC_PAGEFMT_WN 104
#define IDC_PAGEFMT_WW 105
#define IDC_PAGEFMT_WM 106
#define IDC_PAGEFMT_ID 107
#define ID_DATETIME 1600
#define ID_PARAFORMAT 1601
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment