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
f240b8f4
Commit
f240b8f4
authored
Jul 17, 2008
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: statusbar: Change the height expression to one that seems to be the same as in Windows.
parent
20a1ca2b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
4 deletions
+59
-4
status.c
dlls/comctl32/status.c
+4
-1
status.c
dlls/comctl32/tests/status.c
+55
-3
No files found.
dlls/comctl32/status.c
View file @
f240b8f4
...
...
@@ -94,6 +94,7 @@ typedef struct
#define HORZ_BORDER 0
#define VERT_BORDER 2
#define HORZ_GAP 2
#define MIN_PANE_HEIGHT 18
static
const
WCHAR
themeClass
[]
=
{
'S'
,
't'
,
'a'
,
't'
,
'u'
,
's'
,
0
};
...
...
@@ -114,9 +115,11 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
HTHEME
theme
;
UINT
height
;
TEXTMETRICW
tm
;
int
margin
;
COMCTL32_GetFontMetrics
(
infoPtr
->
hFont
?
infoPtr
->
hFont
:
infoPtr
->
hDefaultFont
,
&
tm
);
height
=
tm
.
tmHeight
+
4
+
infoPtr
->
verticalBorder
;
margin
=
(
tm
.
tmInternalLeading
?
tm
.
tmInternalLeading
:
2
);
height
=
max
(
tm
.
tmHeight
+
margin
+
2
*
GetSystemMetrics
(
SM_CYBORDER
),
MIN_PANE_HEIGHT
)
+
infoPtr
->
verticalBorder
;
if
((
theme
=
GetWindowTheme
(
infoPtr
->
Self
)))
{
...
...
dlls/comctl32/tests/status.c
View file @
f240b8f4
...
...
@@ -106,12 +106,56 @@ static void test_create()
DestroyWindow
(
hwnd
);
}
static
void
test_setfont
(
)
static
int
CALLBACK
check_height_font_enumproc
(
ENUMLOGFONTEX
*
enumlf
,
NEWTEXTMETRICEX
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
HWND
hwndStatus
=
(
HWND
)
lParam
;
HDC
hdc
=
GetDC
(
NULL
);
static
const
int
sizes
[]
=
{
8
,
9
,
10
,
12
,
16
,
22
,
28
,
36
,
48
,
72
};
int
i
;
trace
(
"Font %s
\n
"
,
enumlf
->
elfFullName
);
for
(
i
=
0
;
i
<
sizeof
(
sizes
)
/
sizeof
(
sizes
[
0
]);
i
++
)
{
HFONT
hFont
;
TEXTMETRIC
tm
;
HFONT
hCtrlFont
;
HFONT
hOldFont
;
RECT
rcCtrl
;
enumlf
->
elfLogFont
.
lfHeight
=
sizes
[
i
];
hFont
=
CreateFontIndirect
(
&
enumlf
->
elfLogFont
);
hCtrlFont
=
(
HFONT
)
SendMessage
(
hwndStatus
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
TRUE
);
hOldFont
=
SelectObject
(
hdc
,
hFont
);
GetClientRect
(
hwndStatus
,
&
rcCtrl
);
GetTextMetrics
(
hdc
,
&
tm
);
expect
(
max
(
tm
.
tmHeight
+
(
tm
.
tmInternalLeading
?
tm
.
tmInternalLeading
:
2
)
+
4
,
20
),
rcCtrl
.
bottom
);
SelectObject
(
hdc
,
hOldFont
);
SendMessage
(
hwndStatus
,
WM_SETFONT
,
(
WPARAM
)
hCtrlFont
,
TRUE
);
DeleteObject
(
hFont
);
}
ReleaseDC
(
NULL
,
hdc
);
return
1
;
}
static
int
CALLBACK
check_height_family_enumproc
(
ENUMLOGFONTEX
*
enumlf
,
NEWTEXTMETRICEX
*
ntm
,
DWORD
type
,
LPARAM
lParam
)
{
HDC
hdc
=
GetDC
(
NULL
);
enumlf
->
elfLogFont
.
lfHeight
=
0
;
EnumFontFamiliesEx
(
hdc
,
&
enumlf
->
elfLogFont
,
(
FONTENUMPROC
)
check_height_font_enumproc
,
lParam
,
0
);
ReleaseDC
(
NULL
,
hdc
);
return
1
;
}
static
void
test_height
(
void
)
{
LOGFONT
lf
;
HFONT
hFont
;
RECT
rc1
,
rc2
;
HWND
hwndStatus
=
CreateWindow
(
SUBCLASS_NAME
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
300
,
20
,
g_hMainWnd
,
NULL
,
NULL
,
NULL
);
HDC
hdc
;
GetClientRect
(
hwndStatus
,
&
rc1
);
hFont
=
CreateFont
(
32
,
0
,
0
,
0
,
FW_DONTCARE
,
FALSE
,
FALSE
,
FALSE
,
ANSI_CHARSET
,
...
...
@@ -122,7 +166,7 @@ static void test_setfont()
ok
(
g_wmsize_count
>
0
,
"WM_SETFONT should issue WM_SIZE
\n
"
);
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
/* GetTextMetrics returns invalid tmInternalLeading for this font */
g_wmsize_count
=
0
;
SendMessage
(
hwndStatus
,
WM_SETFONT
,
(
WPARAM
)
hFont
,
TRUE
);
...
...
@@ -131,6 +175,14 @@ static void test_setfont()
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
/* test the height formula */
ZeroMemory
(
&
lf
,
sizeof
(
lf
));
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
0
,
0
);
hdc
=
GetDC
(
NULL
);
trace
(
"dpi=%d
\n
"
,
GetDeviceCaps
(
hdc
,
LOGPIXELSY
));
EnumFontFamiliesEx
(
hdc
,
&
lf
,
(
FONTENUMPROC
)
check_height_family_enumproc
,
(
LPARAM
)
hwndStatus
,
0
);
ReleaseDC
(
NULL
,
hdc
);
DestroyWindow
(
hwndStatus
);
DeleteObject
(
hFont
);
}
...
...
@@ -294,5 +346,5 @@ START_TEST(status)
test_status_control
();
test_create
();
test_
setfon
t
();
test_
heigh
t
();
}
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