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
e660bf67
Commit
e660bf67
authored
Oct 07, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 07, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Set control content in WM_CREATE message.
parent
0aa72d88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
0 deletions
+62
-0
editor.c
dlls/riched20/editor.c
+24
-0
editor.c
dlls/riched20/tests/editor.c
+38
-0
No files found.
dlls/riched20/editor.c
View file @
e660bf67
...
...
@@ -3999,6 +3999,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
case
WM_CREATE
:
{
void
*
text
=
NULL
;
INT
max
;
ME_SetDefaultFormatRect
(
editor
);
...
...
@@ -4024,6 +4025,29 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
}
if
(
lParam
)
{
text
=
(
unicode
?
(
void
*
)((
CREATESTRUCTW
*
)
lParam
)
->
lpszName
:
(
void
*
)((
CREATESTRUCTA
*
)
lParam
)
->
lpszName
);
}
if
(
text
)
{
WCHAR
*
textW
;
int
len
;
textW
=
ME_ToUnicode
(
unicode
,
text
,
&
len
);
if
(
!
(
editor
->
styleFlags
&
ES_MULTILINE
))
{
len
=
0
;
while
(
textW
[
len
]
!=
'0'
&&
textW
[
len
]
!=
'\r'
&&
textW
[
len
]
!=
'\n'
)
len
++
;
}
ME_InsertTextFromCursor
(
editor
,
0
,
textW
,
len
,
editor
->
pBuffer
->
pDefaultStyle
);
ME_EndToUnicode
(
unicode
,
textW
);
ME_SetCursorToStart
(
editor
,
&
editor
->
pCursors
[
0
]);
ME_SetCursorToStart
(
editor
,
&
editor
->
pCursors
[
1
]);
}
ME_CommitUndo
(
editor
);
ME_WrapMarkedParagraphs
(
editor
);
ME_MoveCaret
(
editor
);
...
...
dlls/riched20/tests/editor.c
View file @
e660bf67
...
...
@@ -7410,6 +7410,43 @@ static void test_enter(void)
DestroyWindow
(
hwndRichEdit
);
}
static
void
test_WM_CREATE
(
void
)
{
static
const
WCHAR
titleW
[]
=
{
'l'
,
'i'
,
'n'
,
'e'
,
'1'
,
'\n'
,
'l'
,
'i'
,
'n'
,
'e'
,
'2'
,
0
};
static
const
char
title
[]
=
"line1
\n
line2"
;
HWND
rich_edit
;
LRESULT
res
;
char
buf
[
64
];
int
len
;
rich_edit
=
CreateWindowA
(
RICHEDIT_CLASS20A
,
title
,
WS_POPUP
|
WS_VISIBLE
,
0
,
0
,
200
,
80
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
rich_edit
!=
NULL
,
"class: %s, error: %d
\n
"
,
RICHEDIT_CLASS20A
,
(
int
)
GetLastError
());
len
=
GetWindowText
(
rich_edit
,
buf
,
sizeof
(
buf
));
ok
(
len
==
5
,
"GetWindowText returned %d
\n
"
,
len
);
ok
(
!
strcmp
(
buf
,
"line1"
),
"buf = %s
\n
"
,
buf
);
res
=
SendMessage
(
rich_edit
,
EM_GETSEL
,
0
,
0
);
ok
(
res
==
0
,
"SendMessage(EM_GETSEL) returned %lx
\n
"
,
res
);
DestroyWindow
(
rich_edit
);
rich_edit
=
CreateWindowW
(
RICHEDIT_CLASS20W
,
titleW
,
WS_POPUP
|
WS_VISIBLE
|
ES_MULTILINE
,
0
,
0
,
200
,
80
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
rich_edit
!=
NULL
,
"class: %s, error: %d
\n
"
,
wine_dbgstr_w
(
RICHEDIT_CLASS20W
),
(
int
)
GetLastError
());
len
=
GetWindowText
(
rich_edit
,
buf
,
sizeof
(
buf
));
ok
(
len
==
12
,
"GetWindowText returned %d
\n
"
,
len
);
ok
(
!
strcmp
(
buf
,
"line1
\r\n
line2"
),
"buf = %s
\n
"
,
buf
);
res
=
SendMessage
(
rich_edit
,
EM_GETSEL
,
0
,
0
);
ok
(
res
==
0
,
"SendMessage(EM_GETSEL) returned %lx
\n
"
,
res
);
DestroyWindow
(
rich_edit
);
}
START_TEST
(
editor
)
{
BOOL
ret
;
...
...
@@ -7470,6 +7507,7 @@ START_TEST( editor )
test_EM_FINDWORDBREAK_W
();
test_EM_FINDWORDBREAK_A
();
test_enter
();
test_WM_CREATE
();
/* Set the environment variable WINETEST_RICHED20 to keep windows
* responsive and open for 30 seconds. This is useful for debugging.
...
...
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