Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
630c6ea6
Commit
630c6ea6
authored
Jul 11, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Jul 11, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The units passed into LB_SETTABSTOPS are dialog units, not logical
units.
parent
639048b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
listbox.c
dlls/user/listbox.c
+15
-4
No files found.
dlls/user/listbox.c
View file @
630c6ea6
...
...
@@ -92,6 +92,7 @@ typedef struct
INT
horz_pos
;
/* Horizontal position */
INT
nb_tabs
;
/* Number of tabs in array */
INT
*
tabs
;
/* Array of tabs */
INT
avg_char_width
;
/* Average width of characters */
BOOL
caret_on
;
/* Is caret on? */
BOOL
captured
;
/* Is mouse captured? */
BOOL
in_focus
;
...
...
@@ -719,6 +720,8 @@ static LRESULT LISTBOX_InitStorage( LB_DESCR *descr, INT nb_items )
*/
static
BOOL
LISTBOX_SetTabStops
(
LB_DESCR
*
descr
,
INT
count
,
LPINT
tabs
,
BOOL
short_ints
)
{
INT
i
;
if
(
!
(
descr
->
style
&
LBS_USETABSTOPS
))
return
TRUE
;
HeapFree
(
GetProcessHeap
(),
0
,
descr
->
tabs
);
if
(
!
(
descr
->
nb_tabs
=
count
))
...
...
@@ -743,6 +746,11 @@ static BOOL LISTBOX_SetTabStops( LB_DESCR *descr, INT count, LPINT tabs, BOOL sh
TRACE
(
"
\n
"
);
}
else
memcpy
(
descr
->
tabs
,
tabs
,
descr
->
nb_tabs
*
sizeof
(
INT
)
);
/* convert into "dialog units"*/
for
(
i
=
0
;
i
<
descr
->
nb_tabs
;
i
++
)
descr
->
tabs
[
i
]
=
MulDiv
(
descr
->
tabs
[
i
],
descr
->
avg_char_width
,
4
);
/* FIXME: repaint the window? */
return
TRUE
;
}
...
...
@@ -1248,7 +1256,8 @@ static INT LISTBOX_SetFont( LB_DESCR *descr, HFONT font )
{
HDC
hdc
;
HFONT
oldFont
=
0
;
TEXTMETRICW
tm
;
const
char
*
alphabet
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
SIZE
sz
;
descr
->
font
=
font
;
...
...
@@ -1258,12 +1267,14 @@ static INT LISTBOX_SetFont( LB_DESCR *descr, HFONT font )
return
16
;
}
if
(
font
)
oldFont
=
SelectObject
(
hdc
,
font
);
GetText
MetricsW
(
hdc
,
&
tm
);
GetText
ExtentPointA
(
hdc
,
alphabet
,
52
,
&
sz
);
if
(
oldFont
)
SelectObject
(
hdc
,
oldFont
);
ReleaseDC
(
descr
->
self
,
hdc
);
descr
->
avg_char_width
=
(
sz
.
cx
/
26
+
1
)
/
2
;
if
(
!
IS_OWNERDRAW
(
descr
))
LISTBOX_SetItemHeight
(
descr
,
0
,
tm
.
tmHeight
,
FALSE
);
return
tm
.
tmHeight
;
LISTBOX_SetItemHeight
(
descr
,
0
,
sz
.
cy
,
FALSE
);
return
sz
.
cy
;
}
...
...
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