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
76859b0f
Commit
76859b0f
authored
Oct 17, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Erase background on WM_PAINT if BeginPaint() tells us to do it.
parent
a00d2235
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
14 deletions
+57
-14
treeview.c
dlls/comctl32/tests/treeview.c
+12
-0
treeview.c
dlls/comctl32/treeview.c
+45
-14
No files found.
dlls/comctl32/tests/treeview.c
View file @
76859b0f
...
...
@@ -928,6 +928,17 @@ static void test_itemedit(void)
DestroyWindow
(
hTree
);
}
static
void
test_treeview_classinfo
(
void
)
{
WNDCLASSA
cls
;
memset
(
&
cls
,
0
,
sizeof
(
cls
));
GetClassInfo
(
GetModuleHandleA
(
"comctl32.dll"
),
WC_TREEVIEWA
,
&
cls
);
ok
(
cls
.
hbrBackground
==
NULL
,
"Expected NULL background brush, got %p
\n
"
,
cls
.
hbrBackground
);
ok
(
cls
.
style
==
(
CS_GLOBALCLASS
|
CS_DBLCLKS
),
"Expected got %x
\n
"
,
cls
.
style
);
expect
(
0
,
cls
.
cbClsExtra
);
}
START_TEST
(
treeview
)
{
HMODULE
hComctl32
;
...
...
@@ -976,6 +987,7 @@ START_TEST(treeview)
test_callback
();
test_expandinvisible
();
test_itemedit
();
test_treeview_classinfo
();
PostMessageA
(
hMainWnd
,
WM_CLOSE
,
0
,
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
...
...
dlls/comctl32/treeview.c
View file @
76859b0f
...
...
@@ -2788,19 +2788,27 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
infoPtr
->
uInternalStatus
&=
~
TV_HSCROLL
;
}
/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */
static
LRESULT
TREEVIEW_EraseBackground
(
const
TREEVIEW_INFO
*
infoPtr
,
HDC
hDC
)
static
void
TREEVIEW_FillBkgnd
(
const
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc
,
const
RECT
*
rc
)
{
HBRUSH
hBrush
;
COLORREF
clrBk
=
infoPtr
->
clrBk
==
-
1
?
comctl32_color
.
clrWindow
:
infoPtr
->
clrBk
;
hBrush
=
CreateSolidBrush
(
clrBk
);
FillRect
(
hdc
,
rc
,
hBrush
);
DeleteObject
(
hBrush
);
}
/* CtrlSpy doesn't mention this, but CorelDRAW's object manager needs it. */
static
LRESULT
TREEVIEW_EraseBackground
(
const
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc
)
{
RECT
rect
;
hBrush
=
CreateSolidBrush
(
clrBk
);
TRACE
(
"%p
\n
"
,
infoPtr
);
GetClientRect
(
infoPtr
->
hwnd
,
&
rect
);
FillRect
(
hDC
,
&
rect
,
hBrush
);
DeleteObject
(
hBrush
);
TREEVIEW_FillBkgnd
(
infoPtr
,
hdc
,
&
rect
);
return
1
;
}
...
...
@@ -2860,7 +2868,7 @@ TREEVIEW_Invalidate(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
}
static
LRESULT
TREEVIEW_Paint
(
TREEVIEW_INFO
*
infoPtr
,
WPARAM
wParam
)
TREEVIEW_Paint
(
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc_ref
)
{
HDC
hdc
;
PAINTSTRUCT
ps
;
...
...
@@ -2868,27 +2876,48 @@ TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, WPARAM wParam)
TRACE
(
"
\n
"
);
if
(
wParam
)
if
(
hdc_ref
)
{
hdc
=
(
HDC
)
wParam
;
GetClientRect
(
infoPtr
->
hwnd
,
&
rc
);
TREEVIEW_EraseBackground
(
infoPtr
,
hdc
);
hdc
=
hdc_ref
;
GetClientRect
(
infoPtr
->
hwnd
,
&
rc
);
}
else
{
hdc
=
BeginPaint
(
infoPtr
->
hwnd
,
&
ps
);
rc
=
ps
.
rcPaint
;
rc
=
ps
.
rcPaint
;
if
(
ps
.
fErase
)
TREEVIEW_FillBkgnd
(
infoPtr
,
hdc
,
&
rc
);
}
if
(
infoPtr
->
bRedraw
)
/* WM_SETREDRAW sets bRedraw */
TREEVIEW_Refresh
(
infoPtr
,
hdc
,
&
rc
);
if
(
!
wParam
)
if
(
!
hdc_ref
)
EndPaint
(
infoPtr
->
hwnd
,
&
ps
);
return
0
;
}
static
LRESULT
TREEVIEW_PrintClient
(
TREEVIEW_INFO
*
infoPtr
,
HDC
hdc
,
DWORD
options
)
{
FIXME
(
"Partial Stub: (hdc=%p options=0x%08x)
\n
"
,
hdc
,
options
);
if
((
options
&
PRF_CHECKVISIBLE
)
&&
!
IsWindowVisible
(
infoPtr
->
hwnd
))
return
0
;
if
(
options
&
PRF_ERASEBKGND
)
TREEVIEW_EraseBackground
(
infoPtr
,
hdc
);
if
(
options
&
PRF_CLIENT
)
{
RECT
rc
;
GetClientRect
(
infoPtr
->
hwnd
,
&
rc
);
TREEVIEW_Refresh
(
infoPtr
,
hdc
,
&
rc
);
}
return
0
;
}
/* Sorting **************************************************************/
...
...
@@ -5707,8 +5736,10 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
TREEVIEW_NotifyFormat
(
infoPtr
,
(
HWND
)
wParam
,
(
UINT
)
lParam
);
case
WM_PRINTCLIENT
:
return
TREEVIEW_PrintClient
(
infoPtr
,
(
HDC
)
wParam
,
lParam
);
case
WM_PAINT
:
return
TREEVIEW_Paint
(
infoPtr
,
wParam
);
return
TREEVIEW_Paint
(
infoPtr
,
(
HDC
)
wParam
);
case
WM_RBUTTONDOWN
:
return
TREEVIEW_RButtonDown
(
infoPtr
,
lParam
);
...
...
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