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
fa3e750e
Commit
fa3e750e
authored
May 11, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
May 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Fix custom draw stage sequence.
parent
dcab5fe6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
14 deletions
+69
-14
listview.c
dlls/comctl32/listview.c
+0
-0
listview.c
dlls/comctl32/tests/listview.c
+69
-14
No files found.
dlls/comctl32/listview.c
View file @
fa3e750e
This diff is collapsed.
Click to expand it.
dlls/comctl32/tests/listview.c
View file @
fa3e750e
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2006 Mike McCormack for CodeWeavers
* Copyright 2007 George Gov
* Copyright 2009-201
3
Nikolay Sivov
* Copyright 2009-201
4
Nikolay Sivov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -28,12 +28,15 @@
#include "v6util.h"
#include "msg.h"
#define PARENT_SEQ_INDEX 0
#define PARENT_FULL_SEQ_INDEX 1
#define LISTVIEW_SEQ_INDEX 2
#define EDITBOX_SEQ_INDEX 3
#define COMBINED_SEQ_INDEX 4
#define NUM_MSG_SEQUENCES 5
enum
seq_index
{
PARENT_SEQ_INDEX
,
PARENT_FULL_SEQ_INDEX
,
PARENT_CD_SEQ_INDEX
,
LISTVIEW_SEQ_INDEX
,
EDITBOX_SEQ_INDEX
,
COMBINED_SEQ_INDEX
,
NUM_MSG_SEQUENCES
};
#define LISTVIEW_ID 0
#define HEADER_ID 1
...
...
@@ -389,6 +392,26 @@ static const struct message parent_insert_focused_seq[] = {
{
0
}
};
static
const
struct
message
parent_report_cd_seq
[]
=
{
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_PREPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPREPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPREPAINT
|
CDDS_SUBITEM
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPOSTPAINT
|
CDDS_SUBITEM
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPREPAINT
|
CDDS_SUBITEM
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPOSTPAINT
|
CDDS_SUBITEM
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPOSTPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_POSTPAINT
},
{
0
}
};
static
const
struct
message
parent_list_cd_seq
[]
=
{
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_PREPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPREPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_ITEMPOSTPAINT
},
{
WM_NOTIFY
,
sent
|
id
|
custdraw
,
0
,
0
,
NM_CUSTOMDRAW
,
CDDS_POSTPAINT
},
{
0
}
};
static
LRESULT
WINAPI
parent_wnd_proc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
static
LONG
defwndproc_counter
=
0
;
...
...
@@ -1758,24 +1781,36 @@ static void test_redraw(void)
DestroyWindow
(
hwnd
);
}
static
LRESULT
WINAPI
cd_wndproc
(
HWND
hwnd
,
UINT
m
sg
,
WPARAM
wp
,
LPARAM
lp
)
static
LRESULT
WINAPI
cd_wndproc
(
HWND
hwnd
,
UINT
m
essage
,
WPARAM
wParam
,
LPARAM
lParam
)
{
COLORREF
clr
,
c0ffee
=
RGB
(
0xc0
,
0xff
,
0xee
);
if
(
m
sg
==
WM_NOTIFY
)
{
NMHDR
*
nmhdr
=
(
PVOID
)
lp
;
if
(
m
essage
==
WM_NOTIFY
)
{
NMHDR
*
nmhdr
=
(
NMHDR
*
)
lParam
;
if
(
nmhdr
->
code
==
NM_CUSTOMDRAW
)
{
NMLVCUSTOMDRAW
*
nmlvcd
=
(
NMLVCUSTOMDRAW
*
)
nmhdr
;
struct
message
msg
;
msg
.
message
=
message
;
msg
.
flags
=
sent
|
wparam
|
lparam
|
custdraw
;
msg
.
wParam
=
wParam
;
msg
.
lParam
=
lParam
;
msg
.
id
=
nmhdr
->
code
;
msg
.
stage
=
nmlvcd
->
nmcd
.
dwDrawStage
;
add_message
(
sequences
,
PARENT_CD_SEQ_INDEX
,
&
msg
);
switch
(
nmlvcd
->
nmcd
.
dwDrawStage
)
{
case
CDDS_PREPAINT
:
SetBkColor
(
nmlvcd
->
nmcd
.
hdc
,
c0ffee
);
return
CDRF_NOTIFYITEMDRAW
;
return
CDRF_NOTIFYITEMDRAW
|
CDRF_NOTIFYPOSTPAINT
;
case
CDDS_ITEMPREPAINT
:
nmlvcd
->
clrTextBk
=
CLR_DEFAULT
;
return
CDRF_NOTIFYSUBITEMDRAW
;
nmlvcd
->
clrText
=
RGB
(
0
,
255
,
0
);
return
CDRF_NOTIFYSUBITEMDRAW
|
CDRF_NOTIFYPOSTPAINT
;
case
CDDS_ITEMPREPAINT
|
CDDS_SUBITEM
:
clr
=
GetBkColor
(
nmlvcd
->
nmcd
.
hdc
);
ok
(
nmlvcd
->
clrTextBk
==
CLR_DEFAULT
,
"got 0x%x
\n
"
,
nmlvcd
->
clrTextBk
);
ok
(
nmlvcd
->
clrText
==
RGB
(
0
,
255
,
0
),
"got 0x%x
\n
"
,
nmlvcd
->
clrText
);
if
(
nmlvcd
->
iSubItem
)
todo_wine
ok
(
clr
==
c0ffee
,
"clr=%.8x
\n
"
,
clr
);
else
...
...
@@ -1784,13 +1819,15 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
case
CDDS_ITEMPOSTPAINT
|
CDDS_SUBITEM
:
clr
=
GetBkColor
(
nmlvcd
->
nmcd
.
hdc
);
todo_wine
ok
(
clr
==
c0ffee
,
"clr=%.8x
\n
"
,
clr
);
ok
(
nmlvcd
->
clrTextBk
==
CLR_DEFAULT
,
"got 0x%x
\n
"
,
nmlvcd
->
clrTextBk
);
ok
(
nmlvcd
->
clrText
==
RGB
(
0
,
255
,
0
),
"got 0x%x
\n
"
,
nmlvcd
->
clrText
);
return
CDRF_DODEFAULT
;
}
return
CDRF_DODEFAULT
;
}
}
return
DefWindowProcA
(
hwnd
,
m
sg
,
wp
,
lp
);
return
DefWindowProcA
(
hwnd
,
m
essage
,
wParam
,
lParam
);
}
static
void
test_customdraw
(
void
)
...
...
@@ -1810,9 +1847,27 @@ static void test_customdraw(void)
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
UpdateWindow
(
hwnd
);
SetWindowLongPtrA
(
hwndparent
,
GWLP_WNDPROC
,
(
LONG_PTR
)
oldwndproc
);
/* message tests */
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
UpdateWindow
(
hwnd
);
ok_sequence
(
sequences
,
PARENT_CD_SEQ_INDEX
,
parent_report_cd_seq
,
"parent customdraw, LVS_REPORT"
,
FALSE
);
DestroyWindow
(
hwnd
);
hwnd
=
create_listview_control
(
LVS_LIST
);
insert_column
(
hwnd
,
0
);
insert_column
(
hwnd
,
1
);
insert_item
(
hwnd
,
0
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
InvalidateRect
(
hwnd
,
NULL
,
TRUE
);
UpdateWindow
(
hwnd
);
ok_sequence
(
sequences
,
PARENT_CD_SEQ_INDEX
,
parent_list_cd_seq
,
"parent customdraw, LVS_LIST"
,
FALSE
);
SetWindowLongPtrA
(
hwndparent
,
GWLP_WNDPROC
,
(
LONG_PTR
)
oldwndproc
);
DestroyWindow
(
hwnd
);
}
static
void
test_icon_spacing
(
void
)
...
...
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