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
2910b90c
Commit
2910b90c
authored
Oct 14, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Fix tests to not depend on 96 dpi, make it pass in Wine.
parent
680b5df5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
tab.c
dlls/comctl32/tab.c
+1
-2
tab.c
dlls/comctl32/tests/tab.c
+18
-6
No files found.
dlls/comctl32/tab.c
View file @
2910b90c
...
...
@@ -142,7 +142,6 @@ typedef struct
#define BUTTON_SPACINGY 3
#define FLAT_BTN_SPACINGX 8
#define DEFAULT_MIN_TAB_WIDTH 54
#define DEFAULT_TAB_WIDTH_FIXED 96
#define DEFAULT_PADDING_X 6
#define EXTRA_ICON_PADDING 3
...
...
@@ -3019,7 +3018,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
/* Initialize the width of a tab. */
if
(
dwStyle
&
TCS_FIXEDWIDTH
)
infoPtr
->
tabWidth
=
DEFAULT_TAB_WIDTH_FIXED
;
infoPtr
->
tabWidth
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
)
;
infoPtr
->
tabMinWidth
=
-
1
;
...
...
dlls/comctl32/tests/tab.c
View file @
2910b90c
...
...
@@ -27,7 +27,6 @@
#include "msg.h"
#define DEFAULT_MIN_TAB_WIDTH 54
#define TAB_DEFAULT_WIDTH 96
#define TAB_PADDING_X 6
#define EXTRA_ICON_PADDING 3
#define MAX_TABLEN 32
...
...
@@ -506,12 +505,13 @@ static void test_tab(INT nMinTabWidth)
SIZE
size
;
HDC
hdc
;
HFONT
hOldFont
;
INT
i
;
INT
i
,
dpi
;
hwTab
=
create_tabcontrol
(
TCS_FIXEDWIDTH
,
TCIF_TEXT
|
TCIF_IMAGE
);
SendMessage
(
hwTab
,
TCM_SETMINTABWIDTH
,
0
,
nMinTabWidth
);
hdc
=
GetDC
(
hwTab
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
hOldFont
=
SelectObject
(
hdc
,
(
HFONT
)
SendMessage
(
hwTab
,
WM_GETFONT
,
0
,
0
));
GetTextExtentPoint32A
(
hdc
,
"Tab 1"
,
strlen
(
"Tab 1"
),
&
size
);
trace
(
"Tab1 text size: size.cx=%d size.cy=%d
\n
"
,
size
.
cx
,
size
.
cy
);
...
...
@@ -519,7 +519,7 @@ static void test_tab(INT nMinTabWidth)
ReleaseDC
(
hwTab
,
hdc
);
trace
(
" TCS_FIXEDWIDTH tabs no icon...
\n
"
);
CheckSize
(
hwTab
,
TAB_DEFAULT_WIDTH
,
-
1
,
"default width"
);
CheckSize
(
hwTab
,
dpi
,
-
1
,
"default width"
);
TabCheckSetSize
(
hwTab
,
50
,
20
,
50
,
20
,
"set size"
);
TabCheckSetSize
(
hwTab
,
0
,
1
,
0
,
1
,
"min size"
);
...
...
@@ -535,8 +535,11 @@ static void test_tab(INT nMinTabWidth)
hwTab
=
create_tabcontrol
(
TCS_FIXEDWIDTH
|
TCS_BUTTONS
,
TCIF_TEXT
|
TCIF_IMAGE
);
SendMessage
(
hwTab
,
TCM_SETMINTABWIDTH
,
0
,
nMinTabWidth
);
hdc
=
GetDC
(
hwTab
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
ReleaseDC
(
hwTab
,
hdc
);
trace
(
" TCS_FIXEDWIDTH buttons no icon...
\n
"
);
CheckSize
(
hwTab
,
TAB_DEFAULT_WIDTH
,
-
1
,
"default width"
);
CheckSize
(
hwTab
,
dpi
,
-
1
,
"default width"
);
TabCheckSetSize
(
hwTab
,
20
,
20
,
20
,
20
,
"set size 1"
);
TabCheckSetSize
(
hwTab
,
10
,
50
,
10
,
50
,
"set size 2"
);
TabCheckSetSize
(
hwTab
,
0
,
1
,
0
,
1
,
"min size"
);
...
...
@@ -555,8 +558,11 @@ static void test_tab(INT nMinTabWidth)
hwTab
=
create_tabcontrol
(
TCS_FIXEDWIDTH
|
TCS_BOTTOM
,
TCIF_TEXT
|
TCIF_IMAGE
);
SendMessage
(
hwTab
,
TCM_SETMINTABWIDTH
,
0
,
nMinTabWidth
);
hdc
=
GetDC
(
hwTab
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
ReleaseDC
(
hwTab
,
hdc
);
trace
(
" TCS_FIXEDWIDTH | TCS_BOTTOM tabs...
\n
"
);
CheckSize
(
hwTab
,
TAB_DEFAULT_WIDTH
,
-
1
,
"no icon, default width"
);
CheckSize
(
hwTab
,
dpi
,
-
1
,
"no icon, default width"
);
TabCheckSetSize
(
hwTab
,
20
,
20
,
20
,
20
,
"no icon, set size 1"
);
TabCheckSetSize
(
hwTab
,
10
,
50
,
10
,
50
,
"no icon, set size 2"
);
...
...
@@ -633,6 +639,8 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
RECT
rTab
;
INT
nTabsRetrieved
;
INT
rowCount
;
INT
dpi
;
HDC
hdc
;
ok
(
parent_wnd
!=
NULL
,
"no parent window!
\n
"
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
...
...
@@ -678,7 +686,11 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
/* Testing GetItemRect */
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
ok
(
SendMessage
(
hTab
,
TCM_GETITEMRECT
,
0
,
(
LPARAM
)
&
rTab
),
"GetItemRect failed.
\n
"
);
CheckSize
(
hTab
,
TAB_DEFAULT_WIDTH
,
-
1
,
"Default Width"
);
hdc
=
GetDC
(
hTab
);
dpi
=
GetDeviceCaps
(
hdc
,
LOGPIXELSX
);
ReleaseDC
(
hTab
,
hdc
);
CheckSize
(
hTab
,
dpi
,
-
1
,
"Default Width"
);
ok_sequence
(
sequences
,
TAB_SEQ_INDEX
,
get_item_rect_seq
,
"Get itemRect test sequence"
,
FALSE
);
ok_sequence
(
sequences
,
PARENT_SEQ_INDEX
,
empty_sequence
,
"Get itemRect test parent sequence"
,
FALSE
);
...
...
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