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
f78f4d89
Commit
f78f4d89
authored
Feb 04, 2009
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Feb 04, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Make the test dpi and theme aware by using SM_CYSIZE.
parent
a14a75b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
5 deletions
+20
-5
status.c
dlls/comctl32/tests/status.c
+20
-5
No files found.
dlls/comctl32/tests/status.c
View file @
f78f4d89
...
...
@@ -40,6 +40,7 @@ static WNDPROC g_status_wndproc;
static
RECT
g_rcCreated
;
static
HWND
g_hMainWnd
;
static
int
g_wmsize_count
=
0
;
static
DWORD
g_height
;
static
HWND
create_status_control
(
DWORD
style
,
DWORD
exstyle
)
{
...
...
@@ -113,10 +114,16 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMET
{
HWND
hwndStatus
=
(
HWND
)
lParam
;
HDC
hdc
=
GetDC
(
NULL
);
static
const
int
sizes
[]
=
{
8
,
9
,
10
,
12
,
16
,
22
,
28
,
36
,
48
,
72
};
int
i
;
static
const
int
sizes
[]
=
{
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
15
,
16
,
20
,
22
,
28
,
36
,
48
,
72
};
DWORD
i
;
DWORD
y
;
LPSTR
facename
=
(
CHAR
*
)
enumlf
->
elfFullName
;
/* on win9x, enumlf->elfFullName is only valid for truetype fonts */
if
(
type
!=
TRUETYPE_FONTTYPE
)
facename
=
enumlf
->
elfLogFont
.
lfFaceName
;
trace
(
"Font %s
\n
"
,
enumlf
->
elfFullName
);
for
(
i
=
0
;
i
<
sizeof
(
sizes
)
/
sizeof
(
sizes
[
0
]);
i
++
)
{
HFONT
hFont
;
...
...
@@ -132,7 +139,11 @@ static int CALLBACK check_height_font_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTMET
GetClientRect
(
hwndStatus
,
&
rcCtrl
);
GetTextMetrics
(
hdc
,
&
tm
);
expect
(
max
(
tm
.
tmHeight
+
(
tm
.
tmInternalLeading
?
tm
.
tmInternalLeading
:
2
)
+
4
,
20
),
rcCtrl
.
bottom
);
y
=
tm
.
tmHeight
+
(
tm
.
tmInternalLeading
?
tm
.
tmInternalLeading
:
2
)
+
4
;
ok
(
rcCtrl
.
bottom
==
max
(
y
,
g_height
),
"got %d (expected %d) for %s #%d
\n
"
,
rcCtrl
.
bottom
,
max
(
y
,
g_height
),
facename
,
sizes
[
i
]);
SelectObject
(
hdc
,
hOldFont
);
SendMessage
(
hwndStatus
,
WM_SETFONT
,
(
WPARAM
)
hCtrlFont
,
TRUE
);
...
...
@@ -213,7 +224,11 @@ static void test_height(void)
ZeroMemory
(
&
lf
,
sizeof
(
lf
));
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
0
,
0
);
hdc
=
GetDC
(
NULL
);
trace
(
"dpi=%d
\n
"
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
));
g_height
=
GetSystemMetrics
(
SM_CYSIZE
)
+
2
;
if
(
g_height
&
1
)
g_height
--
;
/* The height is always even */
trace
(
"dpi=%d (min height: %d)
\n
"
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
),
g_height
);
EnumFontFamiliesEx
(
hdc
,
&
lf
,
(
FONTENUMPROC
)
check_height_family_enumproc
,
(
LPARAM
)
hwndStatus
,
0
);
ReleaseDC
(
NULL
,
hdc
);
...
...
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