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

richedit: Added tests to show that options are stored internally.

parent d2685e7b
...@@ -1458,6 +1458,10 @@ static void test_EM_SETOPTIONS(void) ...@@ -1458,6 +1458,10 @@ static void test_EM_SETOPTIONS(void)
HWND hwndRichEdit = new_richedit(NULL); HWND hwndRichEdit = new_richedit(NULL);
static const char text[] = "Hello. My name is RichEdit!"; static const char text[] = "Hello. My name is RichEdit!";
char buffer[1024] = {0}; char buffer[1024] = {0};
DWORD dwStyle, options, oldOptions;
DWORD optionStyles = ES_AUTOVSCROLL|ES_AUTOHSCROLL|ES_NOHIDESEL|
ES_READONLY|ES_WANTRETURN|ES_SAVESEL|
ES_SELECTIONBAR|ES_VERTICAL;
/* NEGATIVE TESTING - NO OPTIONS SET */ /* NEGATIVE TESTING - NO OPTIONS SET */
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text);
...@@ -1480,6 +1484,25 @@ static void test_EM_SETOPTIONS(void) ...@@ -1480,6 +1484,25 @@ static void test_EM_SETOPTIONS(void)
ok(buffer[0]==text[0], ok(buffer[0]==text[0],
"EM_SETOPTIONS: Text changed! s1:%s s2:%s\n", text, buffer); "EM_SETOPTIONS: Text changed! s1:%s s2:%s\n", text, buffer);
/* EM_SETOPTIONS changes the window style, but changing the
* window style does not change the options. */
dwStyle = GetWindowLong(hwndRichEdit, GWL_STYLE);
ok(dwStyle & ES_READONLY, "Readonly style not set by EM_SETOPTIONS\n");
SetWindowLong(hwndRichEdit, GWL_STYLE, dwStyle & ~ES_READONLY);
options = SendMessage(hwndRichEdit, EM_GETOPTIONS, 0, 0);
todo_wine ok(options & ES_READONLY, "Readonly option set by SetWindowLong\n");
/* Confirm that the text is still read only. */
SendMessage(hwndRichEdit, WM_CHAR, 'a', ('a' << 16) | 0x0001);
SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
todo_wine ok(buffer[0]==text[0],
"EM_SETOPTIONS: Text changed! s1:%s s2:%s\n", text, buffer);
oldOptions = options;
SetWindowLong(hwndRichEdit, GWL_STYLE, dwStyle|optionStyles);
options = SendMessage(hwndRichEdit, EM_GETOPTIONS, 0, 0);
todo_wine ok(options == oldOptions,
"Options set by SetWindowLong (%x -> %x)\n", oldOptions, options);
DestroyWindow(hwndRichEdit); DestroyWindow(hwndRichEdit);
} }
......
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