richedit: Added tests for autoscrolling options based on WS_V/HSCROLL.
Dylan Smith
dylan.ah.smith at gmail.com
Sun Jan 11 01:58:54 CST 2009
It seems as if the autoscrolling options can be set based on whether
WS_VSCROLL or WS_HSCROLL styles are used to create the window, but this
is done differently between version 1.0 and 3.0 of the richedit control.
I noticed this indirectly before because wordwrap is initially set only
if the auto-horizontal scrolling is initially enabled.
---
dlls/riched20/tests/editor.c | 30 ++++++++++++++++++++++++++++--
dlls/riched32/tests/editor.c | 32 ++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 2 deletions(-)
-------------- next part --------------
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 11930ad..7d7cc1a 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -5803,7 +5803,7 @@ static void test_word_wrap(void)
DestroyWindow(hwnd);
}
-static void test_auto_yscroll(void)
+static void test_autoscroll(void)
{
HWND hwnd = new_richedit(NULL);
int lines, ret, redraw;
@@ -5833,6 +5833,32 @@ static void test_auto_yscroll(void)
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
DestroyWindow(hwnd);
+
+ /* The WS_VSCROLL and WS_HSCROLL styles implicitly set
+ * auto vertical/horizontal scrolling options. */
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ todo_wine ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n");
+ todo_wine ok(ret & ECO_AUTOHSCROLL, "ECO_AUTOHSCROLL isn't set.\n");
+ ret = GetWindowLongW(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLongW(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
}
@@ -6232,7 +6258,7 @@ START_TEST( editor )
test_EM_CHARFROMPOS();
test_SETPARAFORMAT();
test_word_wrap();
- test_auto_yscroll();
+ test_autoscroll();
test_format_rect();
test_WM_GETDLGCODE();
diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c
index 09bdc2e..27571f0 100644
--- a/dlls/riched32/tests/editor.c
+++ b/dlls/riched32/tests/editor.c
@@ -889,6 +889,37 @@ static void test_word_wrap(void)
DestroyWindow(hwnd);
}
+static void test_autoscroll(void)
+{
+ HWND hwnd;
+ UINT ret;
+
+ /* The WS_VSCROLL and WS_HSCROLL styles implicitly set
+ * auto vertical/horizontal scrolling options. */
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS10A, NULL,
+ WS_POPUP|ES_MULTILINE|WS_VSCROLL|WS_HSCROLL,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ todo_wine ok(ret & ECO_AUTOVSCROLL, "ECO_AUTOVSCROLL isn't set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLongW(hwnd, GWL_STYLE);
+ todo_wine ok(ret & ES_AUTOVSCROLL, "ES_AUTOVSCROLL isn't set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+
+ hwnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL,
+ WS_POPUP|ES_MULTILINE,
+ 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL);
+ ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS, (int) GetLastError());
+ ret = SendMessage(hwnd, EM_GETOPTIONS, 0, 0);
+ ok(!(ret & ECO_AUTOVSCROLL), "ECO_AUTOVSCROLL is set.\n");
+ ok(!(ret & ECO_AUTOHSCROLL), "ECO_AUTOHSCROLL is set.\n");
+ ret = GetWindowLongW(hwnd, GWL_STYLE);
+ ok(!(ret & ES_AUTOVSCROLL), "ES_AUTOVSCROLL is set.\n");
+ ok(!(ret & ES_AUTOHSCROLL), "ES_AUTOHSCROLL is set.\n");
+ DestroyWindow(hwnd);
+}
START_TEST( editor )
{
@@ -911,6 +942,7 @@ START_TEST( editor )
test_EM_FINDTEXT();
test_EM_POSFROMCHAR();
test_word_wrap();
+ test_autoscroll();
/* Set the environment variable WINETEST_RICHED32 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
More information about the wine-patches
mailing list