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
72d4318c
Commit
72d4318c
authored
Jul 22, 2008
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Jul 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: statusbar: Test and fix SB_SETMINHEIGHT.
The minimal height should be saved so that it survives WM_SIZE or WM_SETFONT.
parent
a289bab1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
37 deletions
+35
-37
status.c
dlls/comctl32/status.c
+7
-36
status.c
dlls/comctl32/tests/status.c
+28
-1
No files found.
dlls/comctl32/status.c
View file @
72d4318c
...
...
@@ -72,6 +72,7 @@ typedef struct
HWND
Notify
;
WORD
numParts
;
UINT
height
;
UINT
minHeight
;
/* at least MIN_PANE_HEIGHT, can be increased by SB_SETMINHEIGHT */
BOOL
simple
;
HWND
hwndToolTip
;
HFONT
hFont
;
...
...
@@ -119,7 +120,7 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
COMCTL32_GetFontMetrics
(
infoPtr
->
hFont
?
infoPtr
->
hFont
:
infoPtr
->
hDefaultFont
,
&
tm
);
margin
=
(
tm
.
tmInternalLeading
?
tm
.
tmInternalLeading
:
2
);
height
=
max
(
tm
.
tmHeight
+
margin
+
2
*
GetSystemMetrics
(
SM_CYBORDER
),
MIN_PANE_HEIGHT
)
+
infoPtr
->
verticalBorder
;
height
=
max
(
tm
.
tmHeight
+
margin
+
2
*
GetSystemMetrics
(
SM_CYBORDER
),
infoPtr
->
minHeight
)
+
infoPtr
->
verticalBorder
;
if
((
theme
=
GetWindowTheme
(
infoPtr
->
Self
)))
{
...
...
@@ -128,7 +129,7 @@ STATUSBAR_ComputeHeight(STATUS_INFO *infoPtr)
HDC
hdc
=
GetDC
(
infoPtr
->
Self
);
RECT
r
;
memset
(
&
r
,
0
,
sizeof
(
r
));
r
.
bottom
=
tm
.
tmHeight
;
r
.
bottom
=
max
(
infoPtr
->
minHeight
,
tm
.
tmHeight
)
;
if
(
SUCCEEDED
(
GetThemeBackgroundExtent
(
theme
,
hdc
,
SP_PANE
,
0
,
&
r
,
&
r
)))
{
height
=
r
.
bottom
-
r
.
top
;
...
...
@@ -659,40 +660,9 @@ STATUSBAR_SetIcon (STATUS_INFO *infoPtr, INT nPart, HICON hIcon)
static
BOOL
STATUSBAR_SetMinHeight
(
STATUS_INFO
*
infoPtr
,
INT
height
)
{
TRACE
(
"(height=%d)
\n
"
,
height
);
if
(
IsWindowVisible
(
infoPtr
->
Self
))
{
INT
width
,
x
,
y
;
RECT
parent_rect
;
HTHEME
theme
;
infoPtr
->
height
=
height
+
infoPtr
->
verticalBorder
;
if
((
theme
=
GetWindowTheme
(
infoPtr
->
Self
)))
{
/* Determine bar height from theme such that the content area is
* 'height' pixels large */
HDC
hdc
=
GetDC
(
infoPtr
->
Self
);
RECT
r
;
memset
(
&
r
,
0
,
sizeof
(
r
));
r
.
bottom
=
height
;
if
(
SUCCEEDED
(
GetThemeBackgroundExtent
(
theme
,
hdc
,
SP_PANE
,
0
,
&
r
,
&
r
)))
{
infoPtr
->
height
=
r
.
bottom
-
r
.
top
;
}
ReleaseDC
(
infoPtr
->
Self
,
hdc
);
}
if
(
GetClientRect
(
infoPtr
->
Notify
,
&
parent_rect
))
{
width
=
parent_rect
.
right
-
parent_rect
.
left
;
x
=
parent_rect
.
left
;
y
=
parent_rect
.
bottom
-
infoPtr
->
height
;
MoveWindow
(
infoPtr
->
Self
,
x
,
y
,
width
,
infoPtr
->
height
,
TRUE
);
STATUSBAR_SetPartBounds
(
infoPtr
);
}
}
infoPtr
->
minHeight
=
max
(
height
,
MIN_PANE_HEIGHT
);
infoPtr
->
height
=
STATUSBAR_ComputeHeight
(
infoPtr
);
/* like native, don't resize the control */
return
TRUE
;
}
...
...
@@ -962,6 +932,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate)
infoPtr
->
horizontalBorder
=
HORZ_BORDER
;
infoPtr
->
verticalBorder
=
VERT_BORDER
;
infoPtr
->
horizontalGap
=
HORZ_GAP
;
infoPtr
->
minHeight
=
MIN_PANE_HEIGHT
;
STATUSBAR_NotifyFormat
(
infoPtr
,
infoPtr
->
Notify
,
NF_REQUERY
);
...
...
dlls/comctl32/tests/status.c
View file @
72d4318c
...
...
@@ -151,7 +151,7 @@ static int CALLBACK check_height_family_enumproc(ENUMLOGFONTEX *enumlf, NEWTEXTM
static
void
test_height
(
void
)
{
LOGFONT
lf
;
HFONT
hFont
;
HFONT
hFont
,
hFontSm
;
RECT
rc1
,
rc2
;
HWND
hwndStatus
=
CreateWindow
(
SUBCLASS_NAME
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
300
,
20
,
g_hMainWnd
,
NULL
,
NULL
,
NULL
);
...
...
@@ -175,6 +175,32 @@ static void test_height(void)
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
/* minheight < fontsize - no effects*/
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
12
,
0
);
SendMessage
(
hwndStatus
,
WM_SIZE
,
0
,
0
);
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
/* minheight > fontsize - has an effect after WM_SIZE */
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
60
,
0
);
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
SendMessage
(
hwndStatus
,
WM_SIZE
,
0
,
0
);
GetClientRect
(
hwndStatus
,
&
rc2
);
expect_rect
(
0
,
0
,
672
,
62
,
rc2
);
/* font changed to smaller than minheight - has an effect */
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
30
,
0
);
expect_rect
(
0
,
0
,
672
,
62
,
rc2
);
SendMessage
(
hwndStatus
,
WM_SIZE
,
0
,
0
);
GetClientRect
(
hwndStatus
,
&
rc2
);
todo_wine
expect_rect
(
0
,
0
,
672
,
42
,
rc2
);
hFontSm
=
CreateFont
(
9
,
0
,
0
,
0
,
FW_DONTCARE
,
FALSE
,
FALSE
,
FALSE
,
ANSI_CHARSET
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
DEFAULT_QUALITY
,
FF_DONTCARE
,
"Tahoma"
);
SendMessage
(
hwndStatus
,
WM_SETFONT
,
(
WPARAM
)
hFontSm
,
TRUE
);
GetClientRect
(
hwndStatus
,
&
rc2
);
expect_rect
(
0
,
0
,
672
,
32
,
rc2
);
/* test the height formula */
ZeroMemory
(
&
lf
,
sizeof
(
lf
));
SendMessage
(
hwndStatus
,
SB_SETMINHEIGHT
,
0
,
0
);
...
...
@@ -185,6 +211,7 @@ static void test_height(void)
DestroyWindow
(
hwndStatus
);
DeleteObject
(
hFont
);
DeleteObject
(
hFontSm
);
}
static
void
test_status_control
(
void
)
...
...
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