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
0ad80117
Commit
0ad80117
authored
Mar 18, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Move scrollbar initialisation out of WM_CREATE.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
887ffec9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
41 deletions
+18
-41
editor.c
dlls/riched20/editor.c
+14
-29
editor.c
dlls/riched20/tests/editor.c
+0
-10
txthost.c
dlls/riched20/txthost.c
+4
-2
No files found.
dlls/riched20/editor.c
View file @
0ad80117
...
@@ -3019,6 +3019,20 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
...
@@ -3019,6 +3019,20 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed
->
horz_si
.
nPage
=
0
;
ed
->
horz_si
.
nPage
=
0
;
ed
->
horz_si
.
nPos
=
0
;
ed
->
horz_si
.
nPos
=
0
;
if
(
ed
->
scrollbars
&
ES_DISABLENOSCROLL
)
{
if
(
ed
->
scrollbars
&
WS_VSCROLL
)
{
ITextHost_TxSetScrollRange
(
texthost
,
SB_VERT
,
0
,
1
,
TRUE
);
ITextHost_TxEnableScrollBar
(
texthost
,
SB_VERT
,
ESB_DISABLE_BOTH
);
}
if
(
ed
->
scrollbars
&
WS_HSCROLL
)
{
ITextHost_TxSetScrollRange
(
texthost
,
SB_HORZ
,
0
,
1
,
TRUE
);
ITextHost_TxEnableScrollBar
(
texthost
,
SB_HORZ
,
ESB_DISABLE_BOTH
);
}
}
ed
->
wheel_remain
=
0
;
ed
->
wheel_remain
=
0
;
list_init
(
&
ed
->
reobj_list
);
list_init
(
&
ed
->
reobj_list
);
...
@@ -3160,33 +3174,6 @@ static void ME_SetText(ME_TextEditor *editor, void *text, BOOL unicode)
...
@@ -3160,33 +3174,6 @@ static void ME_SetText(ME_TextEditor *editor, void *text, BOOL unicode)
ME_EndToUnicode
(
codepage
,
wszText
);
ME_EndToUnicode
(
codepage
,
wszText
);
}
}
static
LRESULT
ME_WmCreate
(
ME_TextEditor
*
editor
)
{
INT
max
;
max
=
(
editor
->
scrollbars
&
ES_DISABLENOSCROLL
)
?
1
:
0
;
if
(
~
editor
->
scrollbars
&
ES_DISABLENOSCROLL
||
editor
->
scrollbars
&
WS_VSCROLL
)
ITextHost_TxSetScrollRange
(
editor
->
texthost
,
SB_VERT
,
0
,
max
,
TRUE
);
if
(
~
editor
->
scrollbars
&
ES_DISABLENOSCROLL
||
editor
->
scrollbars
&
WS_HSCROLL
)
ITextHost_TxSetScrollRange
(
editor
->
texthost
,
SB_HORZ
,
0
,
max
,
TRUE
);
if
(
editor
->
scrollbars
&
ES_DISABLENOSCROLL
)
{
if
(
editor
->
scrollbars
&
WS_VSCROLL
)
{
ITextHost_TxEnableScrollBar
(
editor
->
texthost
,
SB_VERT
,
ESB_DISABLE_BOTH
);
ITextHost_TxShowScrollBar
(
editor
->
texthost
,
SB_VERT
,
TRUE
);
}
if
(
editor
->
scrollbars
&
WS_HSCROLL
)
{
ITextHost_TxEnableScrollBar
(
editor
->
texthost
,
SB_HORZ
,
ESB_DISABLE_BOTH
);
ITextHost_TxShowScrollBar
(
editor
->
texthost
,
SB_HORZ
,
TRUE
);
}
}
return
0
;
}
static
LRESULT
handle_EM_SETCHARFORMAT
(
ME_TextEditor
*
editor
,
WPARAM
flags
,
const
CHARFORMAT2W
*
fmt_in
)
static
LRESULT
handle_EM_SETCHARFORMAT
(
ME_TextEditor
*
editor
,
WPARAM
flags
,
const
CHARFORMAT2W
*
fmt_in
)
{
{
CHARFORMAT2W
fmt
;
CHARFORMAT2W
fmt
;
...
@@ -3891,8 +3878,6 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
...
@@ -3891,8 +3878,6 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
return
(
wParam
>=
0x40000
)
?
0
:
MAKELONG
(
pt
.
x
,
pt
.
y
);
return
(
wParam
>=
0x40000
)
?
0
:
MAKELONG
(
pt
.
x
,
pt
.
y
);
}
}
case
WM_CREATE
:
return
ME_WmCreate
(
editor
);
case
WM_LBUTTONDBLCLK
:
case
WM_LBUTTONDBLCLK
:
case
WM_LBUTTONDOWN
:
case
WM_LBUTTONDOWN
:
{
{
...
...
dlls/riched20/tests/editor.c
View file @
0ad80117
...
@@ -3109,11 +3109,9 @@ static void test_scrollbar_visibility(void)
...
@@ -3109,11 +3109,9 @@ static void test_scrollbar_visibility(void)
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
"Vertical scrollbar is invisible, should be visible.
\n
"
);
"Vertical scrollbar is invisible, should be visible.
\n
"
);
todo_wine
{
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
}
/* Ditto, see above */
/* Ditto, see above */
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
...
@@ -3123,11 +3121,9 @@ static void test_scrollbar_visibility(void)
...
@@ -3123,11 +3121,9 @@ static void test_scrollbar_visibility(void)
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
"Vertical scrollbar is invisible, should be visible.
\n
"
);
"Vertical scrollbar is invisible, should be visible.
\n
"
);
todo_wine
{
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
}
/* Ditto, see above */
/* Ditto, see above */
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a"
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a"
);
...
@@ -3137,11 +3133,9 @@ static void test_scrollbar_visibility(void)
...
@@ -3137,11 +3133,9 @@ static void test_scrollbar_visibility(void)
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
"Vertical scrollbar is invisible, should be visible.
\n
"
);
"Vertical scrollbar is invisible, should be visible.
\n
"
);
todo_wine
{
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
}
/* Ditto, see above */
/* Ditto, see above */
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a
\n
a"
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
"a
\n
a"
);
...
@@ -3151,11 +3145,9 @@ static void test_scrollbar_visibility(void)
...
@@ -3151,11 +3145,9 @@ static void test_scrollbar_visibility(void)
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
"Vertical scrollbar is invisible, should be visible.
\n
"
);
"Vertical scrollbar is invisible, should be visible.
\n
"
);
todo_wine
{
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
}
/* Ditto, see above */
/* Ditto, see above */
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
...
@@ -3165,11 +3157,9 @@ static void test_scrollbar_visibility(void)
...
@@ -3165,11 +3157,9 @@ static void test_scrollbar_visibility(void)
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
GetScrollInfo
(
hwndRichEdit
,
SB_VERT
,
&
si
);
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
ok
(((
GetWindowLongA
(
hwndRichEdit
,
GWL_STYLE
)
&
WS_VSCROLL
)
!=
0
),
"Vertical scrollbar is invisible, should be visible.
\n
"
);
"Vertical scrollbar is invisible, should be visible.
\n
"
);
todo_wine
{
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
ok
(
si
.
nPage
==
0
&&
si
.
nMin
==
0
&&
si
.
nMax
==
100
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
"reported page/range is %d (%d..%d) expected 0 (0..100)
\n
"
,
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
si
.
nPage
,
si
.
nMin
,
si
.
nMax
);
}
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
text
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
SendMessageA
(
hwndRichEdit
,
WM_SETTEXT
,
0
,
0
);
...
...
dlls/riched20/txthost.c
View file @
0ad80117
...
@@ -63,6 +63,10 @@ static void host_init_props( struct host *host )
...
@@ -63,6 +63,10 @@ static void host_init_props( struct host *host )
style
=
GetWindowLongW
(
host
->
window
,
GWL_STYLE
);
style
=
GetWindowLongW
(
host
->
window
,
GWL_STYLE
);
/* text services assumes the scrollbars are originally not shown, so hide them.
However with ES_DISABLENOSCROLL it'll immediately show them, so don't bother */
if
(
!
(
style
&
ES_DISABLENOSCROLL
))
ShowScrollBar
(
host
->
window
,
SB_BOTH
,
FALSE
);
host
->
scrollbars
=
style
&
(
WS_VSCROLL
|
WS_HSCROLL
|
ES_AUTOVSCROLL
|
host
->
scrollbars
=
style
&
(
WS_VSCROLL
|
WS_HSCROLL
|
ES_AUTOVSCROLL
|
ES_AUTOHSCROLL
|
ES_DISABLENOSCROLL
);
ES_AUTOHSCROLL
|
ES_DISABLENOSCROLL
);
if
(
style
&
WS_VSCROLL
)
host
->
scrollbars
|=
ES_AUTOVSCROLL
;
if
(
style
&
WS_VSCROLL
)
host
->
scrollbars
|=
ES_AUTOVSCROLL
;
...
@@ -989,8 +993,6 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
...
@@ -989,8 +993,6 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
}
}
ITextServices_TxSetText
(
host
->
text_srv
,
textW
);
ITextServices_TxSetText
(
host
->
text_srv
,
textW
);
if
(
lparam
)
ME_EndToUnicode
(
codepage
,
textW
);
if
(
lparam
)
ME_EndToUnicode
(
codepage
,
textW
);
hr
=
ITextServices_TxSendMessage
(
host
->
text_srv
,
msg
,
wparam
,
lparam
,
&
res
);
break
;
break
;
}
}
case
WM_DESTROY
:
case
WM_DESTROY
:
...
...
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