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
a4c22a14
Commit
a4c22a14
authored
Sep 06, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 08, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/header: Implement HDF_FIXEDWIDTH format flag.
parent
5e1f5ebf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
109 additions
and
18 deletions
+109
-18
header.c
dlls/comctl32/header.c
+28
-16
header.c
dlls/comctl32/tests/header.c
+81
-2
No files found.
dlls/comctl32/header.c
View file @
a4c22a14
...
...
@@ -624,6 +624,13 @@ HEADER_InternalHitTest (const HEADER_INFO *infoPtr, const POINT *lpPt, UINT *pFl
rcTest
=
rect
;
rcTest
.
right
=
rcTest
.
left
+
DIVIDER_WIDTH
;
if
(
PtInRect
(
&
rcTest
,
*
lpPt
))
{
if
(
infoPtr
->
items
[
HEADER_PrevItem
(
infoPtr
,
iCount
)].
fmt
&
HDF_FIXEDWIDTH
)
{
*
pFlags
|=
HHT_ONHEADER
;
*
pItem
=
iCount
;
TRACE
(
"ON HEADER %d
\n
"
,
*
pItem
);
return
;
}
if
(
bNoWidth
)
{
*
pFlags
|=
HHT_ONDIVOPEN
;
*
pItem
=
HEADER_PrevItem
(
infoPtr
,
iCount
);
...
...
@@ -640,7 +647,9 @@ HEADER_InternalHitTest (const HEADER_INFO *infoPtr, const POINT *lpPt, UINT *pFl
}
rcTest
=
rect
;
rcTest
.
left
=
rcTest
.
right
-
DIVIDER_WIDTH
;
if
(
PtInRect
(
&
rcTest
,
*
lpPt
))
{
if
(
!
(
infoPtr
->
items
[
iCount
].
fmt
&
HDF_FIXEDWIDTH
)
&&
PtInRect
(
&
rcTest
,
*
lpPt
))
{
*
pFlags
|=
HHT_ONDIVIDER
;
*
pItem
=
iCount
;
TRACE
(
"ON DIVIDER %d
\n
"
,
*
pItem
);
...
...
@@ -655,21 +664,24 @@ HEADER_InternalHitTest (const HEADER_INFO *infoPtr, const POINT *lpPt, UINT *pFl
}
/* check for last divider part (on nowhere) */
rect
=
infoPtr
->
items
[
infoPtr
->
uNumItem
-
1
].
rect
;
rect
.
left
=
rect
.
right
;
rect
.
right
+=
DIVIDER_WIDTH
;
if
(
PtInRect
(
&
rect
,
*
lpPt
))
{
if
(
bNoWidth
)
{
*
pFlags
|=
HHT_ONDIVOPEN
;
*
pItem
=
infoPtr
->
uNumItem
-
1
;
TRACE
(
"ON DIVOPEN %d
\n
"
,
*
pItem
);
return
;
}
else
{
*
pFlags
|=
HHT_ONDIVIDER
;
*
pItem
=
infoPtr
->
uNumItem
-
1
;
TRACE
(
"ON DIVIDER %d
\n
"
,
*
pItem
);
return
;
if
(
!
(
infoPtr
->
items
[
infoPtr
->
uNumItem
-
1
].
fmt
&
HDF_FIXEDWIDTH
))
{
rect
=
infoPtr
->
items
[
infoPtr
->
uNumItem
-
1
].
rect
;
rect
.
left
=
rect
.
right
;
rect
.
right
+=
DIVIDER_WIDTH
;
if
(
PtInRect
(
&
rect
,
*
lpPt
))
{
if
(
bNoWidth
)
{
*
pFlags
|=
HHT_ONDIVOPEN
;
*
pItem
=
infoPtr
->
uNumItem
-
1
;
TRACE
(
"ON DIVOPEN %d
\n
"
,
*
pItem
);
return
;
}
else
{
*
pFlags
|=
HHT_ONDIVIDER
;
*
pItem
=
infoPtr
->
uNumItem
-
1
;
TRACE
(
"ON DIVIDER %d
\n
"
,
*
pItem
);
return
;
}
}
}
...
...
dlls/comctl32/tests/header.c
View file @
a4c22a14
...
...
@@ -24,6 +24,7 @@
#include <assert.h>
#include "wine/test.h"
#include "v6util.h"
#include "msg.h"
typedef
struct
tagEXPECTEDNOTIFY
...
...
@@ -1083,7 +1084,6 @@ static void test_hdm_bitmapmarginMessages(HWND hParent)
static
void
test_hdm_index_messages
(
HWND
hParent
)
{
HWND
hChild
;
int
retVal
;
int
loopcnt
;
...
...
@@ -1196,6 +1196,74 @@ static void test_hdm_index_messages(HWND hParent)
DestroyWindow
(
hChild
);
}
static
void
test_hdf_fixedwidth
(
HWND
hParent
)
{
HWND
hChild
;
HDITEM
hdItem
;
DWORD
ret
;
RECT
rect
;
HDHITTESTINFO
ht
;
hChild
=
create_custom_header_control
(
hParent
,
FALSE
);
hdItem
.
mask
=
HDI_WIDTH
|
HDI_FORMAT
;
hdItem
.
fmt
=
HDF_FIXEDWIDTH
;
hdItem
.
cxy
=
80
;
ret
=
SendMessage
(
hChild
,
HDM_INSERTITEM
,
0
,
(
LPARAM
)
&
hdItem
);
expect
(
0
,
ret
);
/* try to change width */
rect
.
right
=
rect
.
bottom
=
0
;
SendMessage
(
hChild
,
HDM_GETITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
ok
(
rect
.
right
!=
0
,
"Expected not zero width
\n
"
);
ok
(
rect
.
bottom
!=
0
,
"Expected not zero height
\n
"
);
SendMessage
(
hChild
,
WM_LBUTTONDOWN
,
0
,
MAKELPARAM
(
rect
.
right
,
rect
.
bottom
/
2
));
SendMessage
(
hChild
,
WM_MOUSEMOVE
,
0
,
MAKELPARAM
(
rect
.
right
+
20
,
rect
.
bottom
/
2
));
SendMessage
(
hChild
,
WM_LBUTTONUP
,
0
,
MAKELPARAM
(
rect
.
right
+
20
,
rect
.
bottom
/
2
));
SendMessage
(
hChild
,
HDM_GETITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
if
(
hdItem
.
cxy
!=
rect
.
right
)
{
win_skip
(
"HDF_FIXEDWIDTH format not supported
\n
"
);
DestroyWindow
(
hChild
);
return
;
}
/* try to adjust with message */
hdItem
.
mask
=
HDI_WIDTH
;
hdItem
.
cxy
=
90
;
ret
=
SendMessage
(
hChild
,
HDM_SETITEM
,
0
,
(
LPARAM
)
&
hdItem
);
expect
(
TRUE
,
ret
);
rect
.
right
=
0
;
SendMessage
(
hChild
,
HDM_GETITEMRECT
,
0
,
(
LPARAM
)
&
rect
);
expect
(
90
,
rect
.
right
);
/* hittesting doesn't report ondivider flag for HDF_FIXEDWIDTH */
ht
.
pt
.
x
=
rect
.
right
-
1
;
ht
.
pt
.
y
=
rect
.
bottom
/
2
;
SendMessage
(
hChild
,
HDM_HITTEST
,
0
,
(
LPARAM
)
&
ht
);
expect
(
HHT_ONHEADER
,
ht
.
flags
);
/* try to adjust with message */
hdItem
.
mask
=
HDI_FORMAT
;
hdItem
.
fmt
=
0
;
ret
=
SendMessage
(
hChild
,
HDM_SETITEM
,
0
,
(
LPARAM
)
&
hdItem
);
expect
(
TRUE
,
ret
);
ht
.
pt
.
x
=
90
;
ht
.
pt
.
y
=
rect
.
bottom
/
2
;
SendMessage
(
hChild
,
HDM_HITTEST
,
0
,
(
LPARAM
)
&
ht
);
expect
(
HHT_ONDIVIDER
,
ht
.
flags
);
DestroyWindow
(
hChild
);
}
#define TEST_NMCUSTOMDRAW(draw_stage, item_spec, lparam, _left, _top, _right, _bottom) \
ok(nm->dwDrawStage == draw_stage, "Invalid dwDrawStage %d vs %d\n", draw_stage, nm->dwDrawStage); \
if (item_spec != -1) \
...
...
@@ -1558,6 +1626,7 @@ static int init(void)
START_TEST
(
header
)
{
HWND
parent_hwnd
;
ULONG_PTR
ctx_cookie
;
if
(
!
init
())
return
;
...
...
@@ -1583,6 +1652,16 @@ START_TEST(header)
test_hdm_unicodeformatMessages
(
parent_hwnd
);
test_hdm_bitmapmarginMessages
(
parent_hwnd
);
DestroyWindow
(
parent_hwnd
);
if
(
!
load_v6_module
(
&
ctx_cookie
))
{
DestroyWindow
(
parent_hwnd
);
return
;
}
/* comctl32 version 6 tests start here */
test_hdf_fixedwidth
(
parent_hwnd
);
unload_v6_module
(
ctx_cookie
);
DestroyWindow
(
parent_hwnd
);
}
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