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
5d657a10
Commit
5d657a10
authored
Sep 26, 2010
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/listview: Use proper A/W call to measure item text string.
parent
b65423c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
35 deletions
+28
-35
listview.c
dlls/comctl32/listview.c
+28
-35
No files found.
dlls/comctl32/listview.c
View file @
5d657a10
...
...
@@ -5873,20 +5873,20 @@ static HWND CreateEditLabelT(LISTVIEW_INFO *infoPtr, LPCWSTR text, BOOL isW)
static
HWND
LISTVIEW_EditLabelT
(
LISTVIEW_INFO
*
infoPtr
,
INT
nItem
,
BOOL
isW
)
{
WCHAR
szDispText
[
DISP_TEXT_SIZE
]
=
{
0
};
HWND
hwndSelf
=
infoPtr
->
hwndSelf
;
NMLVDISPINFOW
dispInfo
;
HFONT
hOldFont
=
NULL
;
TEXTMETRICW
tm
;
RECT
rect
;
SIZE
sz
;
HWND
hwndSelf
=
infoPtr
->
hwndSelf
;
HDC
hdc
;
HFONT
hOldFont
=
NULL
;
TEXTMETRICW
textMetric
;
TRACE
(
"(nItem=%d, isW=%d)
\n
"
,
nItem
,
isW
);
if
(
~
infoPtr
->
dwStyle
&
LVS_EDITLABELS
)
return
0
;
/*
Is the EditBox still there, if so remove it
*/
if
(
infoPtr
->
hwndEdit
!=
0
)
/*
remove existing edit box
*/
if
(
infoPtr
->
hwndEdit
)
{
SetFocus
(
infoPtr
->
hwndSelf
);
infoPtr
->
hwndEdit
=
0
;
...
...
@@ -5924,27 +5924,38 @@ static HWND LISTVIEW_EditLabelT(LISTVIEW_INFO *infoPtr, INT nItem, BOOL isW)
return
0
;
}
/*
Now
position and display edit box */
/* position and display edit box */
hdc
=
GetDC
(
infoPtr
->
hwndSelf
);
/*
S
elect the font to get appropriate metric dimensions */
if
(
infoPtr
->
hFont
!=
0
)
/*
s
elect the font to get appropriate metric dimensions */
if
(
infoPtr
->
hFont
)
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
/*
Get String L
ength in pixels */
GetTextExtentPoint32W
(
hdc
,
dispInfo
.
item
.
pszText
,
lstrlenW
(
dispInfo
.
item
.
pszText
),
&
sz
);
/*
get string l
ength in pixels */
TRACE
(
"text=%s
\n
"
,
debugtext_t
(
dispInfo
.
item
.
pszText
,
isW
)
);
/* Add Extra spacing for the next character */
GetTextMetricsW
(
hdc
,
&
textMetric
);
sz
.
cx
+=
(
textMetric
.
tmMaxCharWidth
*
2
);
if
(
isW
)
GetTextExtentPoint32W
(
hdc
,
dispInfo
.
item
.
pszText
,
lstrlenW
(
dispInfo
.
item
.
pszText
),
&
sz
);
else
{
const
CHAR
*
textA
=
(
CHAR
*
)
dispInfo
.
item
.
pszText
;
GetTextExtentPoint32A
(
hdc
,
textA
,
lstrlenA
(
textA
),
&
sz
);
}
/* add extra spacing for the next character */
GetTextMetricsW
(
hdc
,
&
tm
);
sz
.
cx
+=
tm
.
tmMaxCharWidth
*
2
;
if
(
infoPtr
->
hFont
!=
0
)
if
(
infoPtr
->
hFont
)
SelectObject
(
hdc
,
hOldFont
);
ReleaseDC
(
infoPtr
->
hwndSelf
,
hdc
);
MoveWindow
(
infoPtr
->
hwndEdit
,
rect
.
left
-
2
,
rect
.
top
-
1
,
sz
.
cx
,
rect
.
bottom
-
rect
.
top
+
2
,
FALSE
);
sz
.
cy
=
rect
.
bottom
-
rect
.
top
+
2
;
rect
.
left
-=
2
;
rect
.
top
-=
1
;
TRACE
(
"moving edit=(%d,%d)-(%d,%d)
\n
"
,
rect
.
left
,
rect
.
top
,
sz
.
cx
,
sz
.
cy
);
MoveWindow
(
infoPtr
->
hwndEdit
,
rect
.
left
,
rect
.
top
,
sz
.
cx
,
sz
.
cy
,
FALSE
);
ShowWindow
(
infoPtr
->
hwndEdit
,
SW_NORMAL
);
SetFocus
(
infoPtr
->
hwndEdit
);
SendMessageW
(
infoPtr
->
hwndEdit
,
EM_SETSEL
,
0
,
-
1
);
...
...
@@ -6074,7 +6085,7 @@ static INT LISTVIEW_FindItemW(const LISTVIEW_INFO *infoPtr, INT nStart,
}
if
(
!
lpFindInfo
||
nItem
<
0
)
return
-
1
;
lvItem
.
mask
=
0
;
if
(
lpFindInfo
->
flags
&
(
LVFI_STRING
|
LVFI_PARTIAL
)
||
lpFindInfo
->
flags
&
LVFI_SUBSTRING
)
...
...
@@ -6213,24 +6224,6 @@ static INT LISTVIEW_FindItemA(const LISTVIEW_INFO *infoPtr, INT nStart,
/***
* DESCRIPTION:
* Retrieves the background image of the listview control.
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
* [O] lpBkImage : background image attributes
*
* RETURN:
* SUCCESS : TRUE
* FAILURE : FALSE
*/
/* static BOOL LISTVIEW_GetBkImage(const LISTVIEW_INFO *infoPtr, LPLVBKIMAGE lpBkImage) */
/* { */
/* FIXME (listview, "empty stub!\n"); */
/* return FALSE; */
/* } */
/***
* DESCRIPTION:
* Retrieves column attributes.
*
* PARAMETER(S):
...
...
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