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
33bdf53d
Commit
33bdf53d
authored
Apr 28, 2000
by
Martin Fuchs
Committed by
Alexandre Julliard
Apr 28, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Return modified rectangle after layouting header control
- Output text in header control when no other Flag specified - Delay bounding rectangle calculation for header control items
parent
980afc9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
61 deletions
+55
-61
header.c
dlls/comctl32/header.c
+54
-61
header.h
include/header.h
+1
-0
No files found.
dlls/comctl32/header.c
View file @
33bdf53d
...
...
@@ -29,15 +29,49 @@
DEFAULT_DEBUG_CHANNEL
(
header
)
#define __HDM_LAYOUT_HACK__
#define VERT_BORDER 4
#define DIVIDER_WIDTH 10
#define HEADER_GetInfoPtr(hwnd) ((HEADER_INFO *)GetWindowLongA(hwnd,0))
static
void
HEADER_SetItemBounds
(
HWND
hwnd
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
HEADER_ITEM
*
phdi
;
RECT
rect
;
int
i
,
x
;
infoPtr
->
bRectsValid
=
TRUE
;
if
(
infoPtr
->
uNumItem
==
0
)
return
;
GetClientRect
(
hwnd
,
&
rect
);
x
=
rect
.
left
;
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
phdi
=
&
infoPtr
->
items
[
i
];
phdi
->
rect
.
top
=
rect
.
top
;
phdi
->
rect
.
bottom
=
rect
.
bottom
;
phdi
->
rect
.
left
=
x
;
phdi
->
rect
.
right
=
phdi
->
rect
.
left
+
phdi
->
cxy
;
x
=
phdi
->
rect
.
right
;
}
}
static
LRESULT
HEADER_Size
(
HWND
hwnd
,
WPARAM
wParam
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
infoPtr
->
bRectsValid
=
FALSE
;
return
0
;
}
static
INT
HEADER_DrawItem
(
HWND
hwnd
,
HDC
hdc
,
INT
iItem
,
BOOL
bHotTrack
)
{
...
...
@@ -46,6 +80,9 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
RECT
r
;
INT
oldBkMode
;
if
(
!
infoPtr
->
bRectsValid
)
HEADER_SetItemBounds
(
hwnd
);
r
=
phdi
->
rect
;
if
(
r
.
right
-
r
.
left
==
0
)
return
phdi
->
rect
.
right
;
...
...
@@ -180,7 +217,10 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
/* ImageList_Draw (infoPtr->himl, phdi->iImage,...); */
}
if
((
phdi
->
fmt
&
HDF_STRING
)
&&
(
phdi
->
pszText
))
{
if
(((
phdi
->
fmt
&
HDF_STRING
)
||
(
!
(
phdi
->
fmt
&
(
HDF_OWNERDRAW
|
HDF_STRING
|
HDF_BITMAP
|
HDF_BITMAP_ON_RIGHT
|
HDF_IMAGE
))))
/* no explicit format specified? */
&&
(
phdi
->
pszText
))
{
oldBkMode
=
SetBkMode
(
hdc
,
TRANSPARENT
);
r
.
left
+=
3
;
r
.
right
-=
3
;
...
...
@@ -246,53 +286,6 @@ HEADER_RefreshItem (HWND hwnd, HDC hdc, INT iItem)
static
void
HEADER_SetItemBounds
(
HWND
hwnd
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
HEADER_ITEM
*
phdi
;
RECT
rect
;
int
i
,
x
;
if
(
infoPtr
->
uNumItem
==
0
)
return
;
GetClientRect
(
hwnd
,
&
rect
);
x
=
rect
.
left
;
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
phdi
=
&
infoPtr
->
items
[
i
];
phdi
->
rect
.
top
=
rect
.
top
;
phdi
->
rect
.
bottom
=
rect
.
bottom
;
phdi
->
rect
.
left
=
x
;
phdi
->
rect
.
right
=
phdi
->
rect
.
left
+
phdi
->
cxy
;
x
=
phdi
->
rect
.
right
;
}
}
static
void
HEADER_ForceItemBounds
(
HWND
hwnd
,
INT
cy
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
HEADER_ITEM
*
phdi
;
int
i
,
x
;
if
(
infoPtr
->
uNumItem
==
0
)
return
;
x
=
0
;
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
phdi
=
&
infoPtr
->
items
[
i
];
phdi
->
rect
.
top
=
0
;
phdi
->
rect
.
bottom
=
cy
;
phdi
->
rect
.
left
=
x
;
phdi
->
rect
.
right
=
phdi
->
rect
.
left
+
phdi
->
cxy
;
x
=
phdi
->
rect
.
right
;
}
}
static
void
HEADER_InternalHitTest
(
HWND
hwnd
,
LPPOINT
lpPt
,
UINT
*
pFlags
,
INT
*
pItem
)
{
HEADER_INFO
*
infoPtr
=
HEADER_GetInfoPtr
(
hwnd
);
...
...
@@ -901,21 +894,17 @@ HEADER_Layout (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpLayout
->
pwpos
->
cx
=
lpLayout
->
prc
->
right
-
lpLayout
->
prc
->
left
;
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
HDS_HIDDEN
)
lpLayout
->
pwpos
->
cy
=
0
;
else
else
{
lpLayout
->
pwpos
->
cy
=
infoPtr
->
nHeight
;
lpLayout
->
prc
->
top
+=
infoPtr
->
nHeight
;
}
lpLayout
->
pwpos
->
flags
=
SWP_NOZORDER
;
TRACE
(
"Layout x=%d y=%d cx=%d cy=%d
\n
"
,
lpLayout
->
pwpos
->
x
,
lpLayout
->
pwpos
->
y
,
lpLayout
->
pwpos
->
cx
,
lpLayout
->
pwpos
->
cy
);
HEADER_ForceItemBounds
(
hwnd
,
lpLayout
->
pwpos
->
cy
);
/* hack */
#ifdef __HDM_LAYOUT_HACK__
MoveWindow
(
lpLayout
->
pwpos
->
hwnd
,
lpLayout
->
pwpos
->
x
,
lpLayout
->
pwpos
->
y
,
lpLayout
->
pwpos
->
cx
,
lpLayout
->
pwpos
->
cy
,
TRUE
);
#endif
infoPtr
->
bRectsValid
=
FALSE
;
return
TRUE
;
}
...
...
@@ -1096,6 +1085,7 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr
->
nHeight
=
20
;
infoPtr
->
hFont
=
0
;
infoPtr
->
items
=
0
;
infoPtr
->
bRectsValid
=
FALSE
;
infoPtr
->
hcurArrow
=
LoadCursorA
(
0
,
IDC_ARROWA
);
infoPtr
->
hcurDivider
=
LoadCursorA
(
0
,
IDC_SIZEWEA
);
infoPtr
->
hcurDivopen
=
LoadCursorA
(
0
,
IDC_SIZENSA
);
...
...
@@ -1446,8 +1436,9 @@ HEADER_SetFont (HWND hwnd, WPARAM wParam, LPARAM lParam)
SelectObject
(
hdc
,
hOldFont
);
ReleaseDC
(
0
,
hdc
);
infoPtr
->
bRectsValid
=
FALSE
;
if
(
lParam
)
{
HEADER_ForceItemBounds
(
hwnd
,
infoPtr
->
nHeight
);
hdc
=
GetDC
(
hwnd
);
HEADER_Refresh
(
hwnd
,
hdc
);
ReleaseDC
(
hwnd
,
hdc
);
...
...
@@ -1513,7 +1504,6 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case
HDM_SETUNICODEFORMAT
:
return
HEADER_SetUnicodeFormat
(
hwnd
,
wParam
);
case
WM_CREATE
:
return
HEADER_Create
(
hwnd
,
wParam
,
lParam
);
...
...
@@ -1543,6 +1533,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
/* case WM_NOTIFYFORMAT: */
case
WM_SIZE
:
return
HEADER_Size
(
hwnd
,
wParam
);
case
WM_PAINT
:
return
HEADER_Paint
(
hwnd
,
wParam
);
...
...
include/header.h
View file @
33bdf53d
...
...
@@ -46,6 +46,7 @@ typedef struct
HIMAGELIST
himl
;
/* handle to a image list (may be 0) */
HEADER_ITEM
*
items
;
/* pointer to array of HEADER_ITEM's */
BOOL
bRectsValid
;
/* validity flag for bounding rectangles */
LPINT
pOrder
;
/* pointer to order array */
}
HEADER_INFO
;
...
...
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