From 6e7b2b5af433a327789d0c740f583b51e7398533 Mon Sep 17 00:00:00 2001 From: Nathan Woods Date: Sun, 25 Sep 2005 00:35:13 +0000 Subject: [PATCH] 1. Moved windows styles pertaining to the edit control to main.h 2. Stopped using WS_BORDER on the edit control svn path=/trunk/; revision=18040 --- reactos/subsys/system/notepad/dialog.c | 5 ++--- reactos/subsys/system/notepad/main.c | 4 +--- reactos/subsys/system/notepad/main.h | 5 +++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/reactos/subsys/system/notepad/dialog.c b/reactos/subsys/system/notepad/dialog.c index 1d87a544fbd..f0b381fec65 100644 --- a/reactos/subsys/system/notepad/dialog.c +++ b/reactos/subsys/system/notepad/dialog.c @@ -617,8 +617,7 @@ VOID DIALOG_EditTimeDate(VOID) VOID DIALOG_EditWrap(VOID) { static const WCHAR editW[] = { 'e','d','i','t',0 }; - DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | - ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL; + DWORD dwStyle; RECT rc; DWORD size; LPWSTR pTemp; @@ -633,7 +632,7 @@ VOID DIALOG_EditWrap(VOID) GetWindowText(Globals.hEdit, pTemp, size); DestroyWindow(Globals.hEdit); GetClientRect(Globals.hMainWnd, &rc); - if( Globals.bWrapLongLines ) dwStyle |= WS_HSCROLL | ES_AUTOHSCROLL; + dwStyle = Globals.bWrapLongLines ? EDIT_STYLE_WRAP : EDIT_STYLE; Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL, dwStyle, 0, 0, rc.right, rc.bottom, Globals.hMainWnd, NULL, Globals.hInstance, NULL); diff --git a/reactos/subsys/system/notepad/main.c b/reactos/subsys/system/notepad/main.c index 25c23e80c91..5f21ae124a1 100644 --- a/reactos/subsys/system/notepad/main.c +++ b/reactos/subsys/system/notepad/main.c @@ -222,9 +222,7 @@ static LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam, static const WCHAR editW[] = { 'e','d','i','t',0 }; RECT rc; GetClientRect(hWnd, &rc); - Globals.hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, editW, NULL, - WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL | - ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL, + Globals.hEdit = CreateWindowEx(EDIT_EXSTYLE, editW, NULL, EDIT_STYLE, 0, 0, rc.right, rc.bottom, hWnd, NULL, Globals.hInstance, NULL); break; diff --git a/reactos/subsys/system/notepad/main.h b/reactos/subsys/system/notepad/main.h index 755e370acf7..b1467b58c30 100644 --- a/reactos/subsys/system/notepad/main.h +++ b/reactos/subsys/system/notepad/main.h @@ -23,6 +23,11 @@ #include "notepad_res.h" +#define EDIT_STYLE (WS_CHILD | WS_VISIBLE | WS_VSCROLL \ + | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL) +#define EDIT_STYLE_WRAP (EDIT_STYLE | WS_HSCROLL | ES_AUTOHSCROLL) +#define EDIT_EXSTYLE (WS_EX_CLIENTEDGE) + #define MAX_STRING_LEN 255 #define ENCODING_ANSI 0