Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9b7825f6
Commit
9b7825f6
authored
Jan 21, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Jan 22, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Added test for scroll position after EM_SETTEXTEX.
parent
9b5f3ed8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
1 deletion
+73
-1
editor.c
dlls/riched20/tests/editor.c
+73
-1
No files found.
dlls/riched20/tests/editor.c
View file @
9b7825f6
...
...
@@ -3345,7 +3345,9 @@ static void test_EM_STREAMOUT(void)
static
void
test_EM_SETTEXTEX
(
void
)
{
HWND
hwndRichEdit
=
new_richedit
(
NULL
);
HWND
hwndRichEdit
,
parent
;
SCROLLINFO
si
;
int
sel_start
,
sel_end
;
SETTEXTEX
setText
;
GETTEXTEX
getText
;
WCHAR
TestItem1
[]
=
{
'T'
,
'e'
,
's'
,
't'
,
...
...
@@ -3392,6 +3394,76 @@ static void test_EM_SETTEXTEX(void)
int
result
;
CHARRANGE
cr
;
EDITSTREAM
es
;
WNDCLASSA
cls
;
/* Test the scroll position with and without a parent window.
*
* For some reason the scroll position is 0 after EM_SETTEXTEX
* with the ST_SELECTION flag only when the control has a parent
* window, even though the selection is at the end. */
cls
.
style
=
0
;
cls
.
lpfnWndProc
=
DefWindowProcA
;
cls
.
cbClsExtra
=
0
;
cls
.
cbWndExtra
=
0
;
cls
.
hInstance
=
GetModuleHandleA
(
0
);
cls
.
hIcon
=
0
;
cls
.
hCursor
=
LoadCursorA
(
0
,
(
LPSTR
)
IDC_ARROW
);
cls
.
hbrBackground
=
GetStockObject
(
WHITE_BRUSH
);
cls
.
lpszMenuName
=
NULL
;
cls
.
lpszClassName
=
"ParentTestClass"
;
if
(
!
RegisterClassA
(
&
cls
))
assert
(
0
);
parent
=
CreateWindow
(
cls
.
lpszClassName
,
NULL
,
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
200
,
60
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
parent
!=
0
,
"Failed to create parent window
\n
"
);
hwndRichEdit
=
CreateWindowEx
(
0
,
RICHEDIT_CLASS
,
NULL
,
ES_MULTILINE
|
WS_VSCROLL
|
WS_VISIBLE
|
WS_CHILD
,
0
,
0
,
200
,
60
,
parent
,
NULL
,
hmoduleRichEdit
,
NULL
);
setText
.
codepage
=
CP_ACP
;
setText
.
flags
=
ST_SELECTION
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
"{
\\
rtf 1
\\
par 2
\\
par 3
\\
par 4
\\
par 5
\\
par 6
\\
par 7
\\
par 8
\\
par 9
\\
par}"
);
si
.
cbSize
=
sizeof
(
si
);
si
.
fMask
=
SIF_ALL
;
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
todo_wine
ok
(
si
.
nPos
==
0
,
"Position is incorrectly at %d
\n
"
,
si
.
nPos
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
sel_start
,
(
LPARAM
)
&
sel_end
);
ok
(
sel_start
==
18
,
"Selection start incorrectly at %d
\n
"
,
sel_start
);
ok
(
sel_end
==
18
,
"Selection end incorrectly at %d
\n
"
,
sel_end
);
DestroyWindow
(
parent
);
/* Test without a parent window */
hwndRichEdit
=
new_richedit
(
NULL
);
setText
.
codepage
=
CP_ACP
;
setText
.
flags
=
ST_SELECTION
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
"{
\\
rtf 1
\\
par 2
\\
par 3
\\
par 4
\\
par 5
\\
par 6
\\
par 7
\\
par 8
\\
par 9
\\
par}"
);
si
.
cbSize
=
sizeof
(
si
);
si
.
fMask
=
SIF_ALL
;
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(
si
.
nPos
!=
0
,
"Position is incorrectly at %d
\n
"
,
si
.
nPos
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
sel_start
,
(
LPARAM
)
&
sel_end
);
ok
(
sel_start
==
18
,
"Selection start incorrectly at %d
\n
"
,
sel_start
);
ok
(
sel_end
==
18
,
"Selection end incorrectly at %d
\n
"
,
sel_end
);
/* The scroll position should also be 0 after EM_SETTEXTEX with ST_DEFAULT,
* but this time it is because the selection is at the beginning. */
setText
.
codepage
=
CP_ACP
;
setText
.
flags
=
ST_DEFAULT
;
SendMessage
(
hwndRichEdit
,
EM_SETTEXTEX
,
(
WPARAM
)
&
setText
,
(
LPARAM
)
"{
\\
rtf 1
\\
par 2
\\
par 3
\\
par 4
\\
par 5
\\
par 6
\\
par 7
\\
par 8
\\
par 9
\\
par}"
);
si
.
cbSize
=
sizeof
(
si
);
si
.
fMask
=
SIF_ALL
;
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(
si
.
nPos
==
0
,
"Position is incorrectly at %d
\n
"
,
si
.
nPos
);
SendMessage
(
hwndRichEdit
,
EM_GETSEL
,
(
WPARAM
)
&
sel_start
,
(
LPARAM
)
&
sel_end
);
ok
(
sel_start
==
0
,
"Selection start incorrectly at %d
\n
"
,
sel_start
);
ok
(
sel_end
==
0
,
"Selection end incorrectly at %d
\n
"
,
sel_end
);
setText
.
codepage
=
1200
;
/* no constant for unicode */
getText
.
codepage
=
1200
;
/* no constant for unicode */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment