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
b927bc8d
Commit
b927bc8d
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: Handle EM_SETBKGNDCOLOR in the host.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4c0a69f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
32 deletions
+22
-32
editor.c
dlls/riched20/editor.c
+0
-26
editstr.h
dlls/riched20/editstr.h
+0
-2
txthost.c
dlls/riched20/txthost.c
+22
-4
No files found.
dlls/riched20/editor.c
View file @
b927bc8d
...
...
@@ -3005,8 +3005,6 @@ ME_TextEditor *ME_MakeEditor(ITextHost *texthost, BOOL bEmulateVersion10)
ed
->
nLastTotalLength
=
ed
->
nTotalLength
=
0
;
ed
->
nLastTotalWidth
=
ed
->
nTotalWidth
=
0
;
ed
->
nUDArrowX
=
-
1
;
ed
->
rgbBackColor
=
-
1
;
ed
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
ed
->
nEventMask
=
0
;
ed
->
nModifyStep
=
0
;
ed
->
nTextLimit
=
TEXT_LIMIT_DEFAULT
;
...
...
@@ -3100,8 +3098,6 @@ void ME_DestroyEditor(ME_TextEditor *editor)
if
(
editor
->
pFontCache
[
i
].
hFont
)
DeleteObject
(
editor
->
pFontCache
[
i
].
hFont
);
}
if
(
editor
->
rgbBackColor
!=
-
1
)
DeleteObject
(
editor
->
hbrBackground
);
if
(
editor
->
lpOleCallback
)
IRichEditOleCallback_Release
(
editor
->
lpOleCallback
);
if
(
editor
->
reOle
)
...
...
@@ -3516,28 +3512,6 @@ LRESULT editor_handle_message( ME_TextEditor *editor, UINT msg, WPARAM wParam,
}
case
EM_SELECTIONTYPE
:
return
ME_GetSelectionType
(
editor
);
case
EM_SETBKGNDCOLOR
:
{
LRESULT
lColor
;
if
(
editor
->
rgbBackColor
!=
-
1
)
{
DeleteObject
(
editor
->
hbrBackground
);
lColor
=
editor
->
rgbBackColor
;
}
else
lColor
=
ITextHost_TxGetSysColor
(
editor
->
texthost
,
COLOR_WINDOW
);
if
(
wParam
)
{
editor
->
rgbBackColor
=
-
1
;
editor
->
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
}
else
{
editor
->
rgbBackColor
=
lParam
;
editor
->
hbrBackground
=
CreateSolidBrush
(
editor
->
rgbBackColor
);
}
ITextHost_TxInvalidateRect
(
editor
->
texthost
,
NULL
,
TRUE
);
return
lColor
;
}
case
EM_GETMODIFY
:
return
editor
->
nModifyStep
==
0
?
0
:
-
1
;
case
EM_SETMODIFY
:
...
...
dlls/riched20/editstr.h
View file @
b927bc8d
...
...
@@ -392,8 +392,6 @@ typedef struct tagME_TextEditor
int
nAvailWidth
;
/* 0 = wrap to client area, else wrap width in twips */
int
nUDArrowX
;
int
total_rows
;
COLORREF
rgbBackColor
;
HBRUSH
hbrBackground
;
int
nEventMask
;
int
nModifyStep
;
struct
list
undo_stack
;
...
...
dlls/riched20/txthost.c
View file @
b927bc8d
...
...
@@ -45,9 +45,11 @@ struct host
unsigned
int
sel_bar
:
1
;
unsigned
int
client_edge
:
1
;
unsigned
int
use_set_rect
:
1
;
unsigned
int
use_back_colour
:
1
;
PARAFORMAT2
para_fmt
;
DWORD
props
,
scrollbars
,
event_mask
;
RECT
client_rect
,
set_rect
;
COLORREF
back_colour
;
};
static
const
ITextHostVtbl
textHostVtbl
;
...
...
@@ -111,6 +113,7 @@ struct host *host_create( HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10 )
texthost
->
use_set_rect
=
0
;
SetRectEmpty
(
&
texthost
->
set_rect
);
GetClientRect
(
hwnd
,
&
texthost
->
client_rect
);
texthost
->
use_back_colour
=
0
;
return
texthost
;
}
...
...
@@ -346,6 +349,9 @@ DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat( ITextHost *ifa
DEFINE_THISCALL_WRAPPER
(
ITextHostImpl_TxGetSysColor
,
8
)
DECLSPEC_HIDDEN
COLORREF
__thiscall
ITextHostImpl_TxGetSysColor
(
ITextHost
*
iface
,
int
index
)
{
struct
host
*
host
=
impl_from_ITextHost
(
iface
);
if
(
index
==
COLOR_WINDOW
&&
host
->
use_back_colour
)
return
host
->
back_colour
;
return
GetSysColor
(
index
);
}
...
...
@@ -992,9 +998,14 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
{
HDC
hdc
=
(
HDC
)
wparam
;
RECT
rc
;
HBRUSH
brush
;
if
(
GetUpdateRect
(
editor
->
hWnd
,
&
rc
,
TRUE
))
FillRect
(
hdc
,
&
rc
,
editor
->
hbrBackground
);
{
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
);
FillRect
(
hdc
,
&
rc
,
brush
);
DeleteObject
(
brush
);
}
return
1
;
}
case
EM_FINDTEXT
:
...
...
@@ -1127,13 +1138,13 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
HDC
hdc
;
RECT
rc
;
PAINTSTRUCT
ps
;
HBRUSH
old_brush
;
HBRUSH
brush
=
CreateSolidBrush
(
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
)
)
;
update_caret
(
editor
);
hdc
=
BeginPaint
(
editor
->
hWnd
,
&
ps
);
if
(
!
editor
->
bEmulateVersion10
||
(
editor
->
nEventMask
&
ENM_UPDATE
))
ME_SendOldNotify
(
editor
,
EN_UPDATE
);
old_brush
=
SelectObject
(
hdc
,
editor
->
hbrBackground
);
brush
=
SelectObject
(
hdc
,
brush
);
/* Erase area outside of the formatting rectangle */
if
(
ps
.
rcPaint
.
top
<
editor
->
rcFormat
.
top
)
...
...
@@ -1166,7 +1177,7 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
}
ME_PaintContent
(
editor
,
hdc
,
&
ps
.
rcPaint
);
SelectObject
(
hdc
,
old_brush
);
DeleteObject
(
SelectObject
(
hdc
,
brush
)
);
EndPaint
(
editor
->
hWnd
,
&
ps
);
return
0
;
}
...
...
@@ -1181,6 +1192,13 @@ static LRESULT RichEditWndProc_common( HWND hwnd, UINT msg, WPARAM wparam,
res
=
len
;
break
;
}
case
EM_SETBKGNDCOLOR
:
res
=
ITextHost_TxGetSysColor
(
&
host
->
ITextHost_iface
,
COLOR_WINDOW
);
host
->
use_back_colour
=
!
wparam
;
if
(
host
->
use_back_colour
)
host
->
back_colour
=
lparam
;
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
break
;
case
EM_SETEVENTMASK
:
host
->
event_mask
=
lparam
;
hr
=
ITextServices_TxSendMessage
(
host
->
text_srv
,
msg
,
wparam
,
lparam
,
&
res
);
...
...
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