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
0549b900
Commit
0549b900
authored
Jan 01, 2008
by
Eric Pouech
Committed by
Alexandre Julliard
Jan 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Simplified handling of background brush while painting.
parent
2602a39b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
23 deletions
+12
-23
editor.c
dlls/riched20/editor.c
+8
-3
editor.h
dlls/riched20/editor.h
+0
-1
paint.c
dlls/riched20/paint.c
+4
-19
No files found.
dlls/riched20/editor.c
View file @
0549b900
...
...
@@ -1284,7 +1284,8 @@ void ME_DestroyEditor(ME_TextEditor *editor)
if
(
editor
->
pFontCache
[
i
].
hFont
)
DeleteObject
(
editor
->
pFontCache
[
i
].
hFont
);
}
DeleteObject
(
editor
->
hbrBackground
);
if
(
editor
->
rgbBackColor
!=
-
1
)
DeleteObject
(
editor
->
hbrBackground
);
if
(
editor
->
lpOleCallback
)
IUnknown_Release
(
editor
->
lpOleCallback
);
...
...
@@ -1732,9 +1733,13 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
}
case
EM_SETBKGNDCOLOR
:
{
LRESULT
lColor
=
ME_GetBackColor
(
editor
)
;
if
(
editor
->
rgbBackColor
!=
-
1
)
LRESULT
lColor
;
if
(
editor
->
rgbBackColor
!=
-
1
)
{
DeleteObject
(
editor
->
hbrBackground
);
lColor
=
editor
->
rgbBackColor
;
}
else
lColor
=
GetSysColor
(
COLOR_WINDOW
);
if
(
wParam
)
{
editor
->
rgbBackColor
=
-
1
;
...
...
dlls/riched20/editor.h
View file @
0549b900
...
...
@@ -239,7 +239,6 @@ void ME_RewrapRepaint(ME_TextEditor *editor);
void
ME_UpdateRepaint
(
ME_TextEditor
*
editor
);
void
ME_DrawParagraph
(
ME_Context
*
c
,
ME_DisplayItem
*
paragraph
);
void
ME_EnsureVisible
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
pRun
);
COLORREF
ME_GetBackColor
(
const
ME_TextEditor
*
editor
);
void
ME_InvalidateSelection
(
ME_TextEditor
*
editor
);
void
ME_QueueInvalidateFromCursor
(
ME_TextEditor
*
editor
,
int
nCursor
);
BOOL
ME_SetZoom
(
ME_TextEditor
*
editor
,
int
numerator
,
int
denominator
);
...
...
dlls/riched20/paint.c
View file @
0549b900
...
...
@@ -146,13 +146,12 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in
ME_Style
*
s
,
int
*
width
,
int
nSelFrom
,
int
nSelTo
,
int
ymin
,
int
cy
)
{
HDC
hDC
=
c
->
hDC
;
HGDIOBJ
hOldFont
;
COLORREF
rgbOld
,
rgbBack
;
COLORREF
rgbOld
;
int
yOffset
=
0
,
yTwipsOffset
=
0
;
SIZE
sz
;
COLORREF
rgb
;
hOldFont
=
ME_SelectStyleFont
(
c
->
editor
,
hDC
,
s
);
rgbBack
=
ME_GetBackColor
(
c
->
editor
);
if
((
s
->
fmt
.
dwMask
&
CFM_LINK
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_LINK
))
rgb
=
RGB
(
0
,
0
,
255
);
else
if
((
s
->
fmt
.
dwMask
&
CFM_COLOR
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_AUTOCOLOR
))
...
...
@@ -309,17 +308,6 @@ static void ME_DrawRun(ME_Context *c, int x, int y, ME_DisplayItem *rundi, ME_Pa
}
}
COLORREF
ME_GetBackColor
(
const
ME_TextEditor
*
editor
)
{
/* Looks like I was seriously confused
return GetSysColor((GetWindowLong(editor->hWnd, GWL_STYLE) & ES_READONLY) ? COLOR_3DFACE: COLOR_WINDOW);
*/
if
(
editor
->
rgbBackColor
==
-
1
)
return
GetSysColor
(
COLOR_WINDOW
);
else
return
editor
->
rgbBackColor
;
}
void
ME_DrawParagraph
(
ME_Context
*
c
,
ME_DisplayItem
*
paragraph
)
{
int
align
=
SetTextAlign
(
c
->
hDC
,
TA_BASELINE
);
ME_DisplayItem
*
p
;
...
...
@@ -350,22 +338,19 @@ void ME_DrawParagraph(ME_Context *c, ME_DisplayItem *paragraph) {
rcPara
.
bottom
=
y
+
p
->
member
.
row
.
nHeight
;
visible
=
RectVisible
(
c
->
hDC
,
&
rcPara
);
if
(
visible
)
{
HBRUSH
hbr
;
hbr
=
CreateSolidBrush
(
ME_GetBackColor
(
c
->
editor
));
/* left margin */
rc
.
left
=
c
->
rcView
.
left
;
rc
.
right
=
c
->
rcView
.
left
+
nMargWidth
;
rc
.
top
=
y
;
rc
.
bottom
=
y
+
p
->
member
.
row
.
nHeight
;
FillRect
(
c
->
hDC
,
&
rc
,
hbr
/* c->hbrMargin */
);
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
/* right margin */
rc
.
left
=
xe
;
rc
.
right
=
c
->
rcView
.
right
;
FillRect
(
c
->
hDC
,
&
rc
,
hbr
/* c->hbrMargin */
);
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
rc
.
left
=
c
->
rcView
.
left
+
nMargWidth
;
rc
.
right
=
xe
;
FillRect
(
c
->
hDC
,
&
rc
,
hbr
);
DeleteObject
(
hbr
);
FillRect
(
c
->
hDC
,
&
rc
,
c
->
editor
->
hbrBackground
);
}
if
(
me_debug
)
{
...
...
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