Commit 832ec705 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

notepad: Wrap long lines by default like Windows does.

parent 8e5d2bdb
...@@ -143,6 +143,9 @@ static VOID NOTEPAD_InitData(VOID) ...@@ -143,6 +143,9 @@ static VOID NOTEPAD_InitData(VOID)
*p = '\0'; *p = '\0';
Globals.hDevMode = NULL; Globals.hDevMode = NULL;
Globals.hDevNames = NULL; Globals.hDevNames = NULL;
CheckMenuItem(GetMenu(Globals.hMainWnd), CMD_WRAP,
MF_BYCOMMAND | (Globals.bWrapLongLines ? MF_CHECKED : MF_UNCHECKED));
} }
/*********************************************************************** /***********************************************************************
...@@ -178,11 +181,15 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam, ...@@ -178,11 +181,15 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
case WM_CREATE: case WM_CREATE:
{ {
static const WCHAR editW[] = { 'e','d','i','t',0 }; static const WCHAR editW[] = { 'e','d','i','t',0 };
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL |
ES_AUTOVSCROLL | ES_MULTILINE;
RECT rc; RECT rc;
GetClientRect(hWnd, &rc); GetClientRect(hWnd, &rc);
if (!Globals.bWrapLongLines) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL;
Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL, Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL,
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | dwStyle,
ES_AUTOVSCROLL | ES_MULTILINE,
0, 0, rc.right, rc.bottom, hWnd, 0, 0, rc.right, rc.bottom, hWnd,
NULL, Globals.hInstance, NULL); NULL, Globals.hInstance, NULL);
NOTEPAD_InitFont(); NOTEPAD_InitFont();
...@@ -370,6 +377,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) ...@@ -370,6 +377,7 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
ZeroMemory(&Globals, sizeof(Globals)); ZeroMemory(&Globals, sizeof(Globals));
Globals.hInstance = hInstance; Globals.hInstance = hInstance;
Globals.bWrapLongLines = TRUE;
ZeroMemory(&class, sizeof(class)); ZeroMemory(&class, sizeof(class));
class.cbSize = sizeof(class); class.cbSize = sizeof(class);
......
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