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
8909419b
Commit
8909419b
authored
Feb 04, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Feb 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: rebar: Add some tests for rebar and change the way the header size is fixed.
parent
30577c25
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
181 additions
and
1 deletion
+181
-1
rebar.c
dlls/comctl32/rebar.c
+5
-1
Makefile.in
dlls/comctl32/tests/Makefile.in
+1
-0
rebar.c
dlls/comctl32/tests/rebar.c
+175
-0
No files found.
dlls/comctl32/rebar.c
View file @
8909419b
...
...
@@ -216,6 +216,9 @@ typedef struct
#define BAND_NEEDS_REDRAW 0x00000020
#define CREATE_RUNNING 0x00000040
/* used by Windows to mark that the header size has been set by the user and shouldn't be changed */
#define RBBS_UNDOC_FIXEDHEADER 0x40000000
/* ---- REBAR layout constants. Mostly determined by ---- */
/* ---- experiment on WIN 98. ---- */
...
...
@@ -2049,7 +2052,7 @@ REBAR_ValidateBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
}
/* check if user overrode the header value */
if
(
!
(
lpBand
->
f
Mask
&
RBBIM_HEADERSIZE
))
if
(
!
(
lpBand
->
f
Style
&
RBBS_UNDOC_FIXEDHEADER
))
lpBand
->
cxHeader
=
header
;
...
...
@@ -2210,6 +2213,7 @@ REBAR_CommonSetupBand (HWND hwnd, LPREBARBANDINFOA lprbbi, REBAR_BAND *lpBand)
(
lpBand
->
cxHeader
!=
lprbbi
->
cxHeader
)
)
{
lpBand
->
cxHeader
=
lprbbi
->
cxHeader
;
lpBand
->
fStyle
|=
RBBS_UNDOC_FIXEDHEADER
;
bChanged
=
TRUE
;
}
}
...
...
dlls/comctl32/tests/Makefile.in
View file @
8909419b
...
...
@@ -15,6 +15,7 @@ CTESTS = \
mru.c
\
progress.c
\
propsheet.c
\
rebar.c
\
status.c
\
string.c
\
subclass.c
\
...
...
dlls/comctl32/tests/rebar.c
0 → 100644
View file @
8909419b
/* Unit tests for rebar.
*
* Copyright 2007 Mikolaj Zalewski
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include <stdarg.h>
#include <windows.h>
#include <commctrl.h>
#include <uxtheme.h>
#include "wine/test.h"
static
HWND
hMainWnd
;
static
HWND
hRebar
;
#define expect_eq(expr, value, type, format) { type ret = expr; ok((value) == ret, #expr " expected " format " got " format "\n", (value), (ret)); }
static
void
rebuild_rebar
(
HWND
*
hRebar
)
{
if
(
hRebar
)
DestroyWindow
(
*
hRebar
);
*
hRebar
=
CreateWindow
(
REBARCLASSNAME
,
NULL
,
WS_CHILD
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
hMainWnd
,
(
HMENU
)
17
,
GetModuleHandle
(
NULL
),
NULL
);
SendMessageA
(
*
hRebar
,
WM_SETFONT
,
(
WPARAM
)
GetStockObject
(
SYSTEM_FONT
),
0
);
}
static
LRESULT
CALLBACK
MyWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
return
DefWindowProcA
(
hWnd
,
msg
,
wParam
,
lParam
);
}
static
void
expect_band_content
(
UINT
uBand
,
UINT
fStyle
,
COLORREF
clrFore
,
COLORREF
clrBack
,
LPCSTR
lpText
,
int
iImage
,
HWND
hwndChild
,
UINT
cxMinChild
,
UINT
cyMinChild
,
UINT
cx
,
HBITMAP
hbmBack
,
UINT
wID
,
/*UINT cyChild, UINT cyMaxChild, UINT cyIntegral,*/
UINT
cxIdeal
,
LPARAM
lParam
,
UINT
cxHeader
)
{
CHAR
buf
[
MAX_PATH
]
=
"abc"
;
REBARBANDINFO
rb
;
memset
(
&
rb
,
0xdd
,
sizeof
(
rb
));
rb
.
cbSize
=
sizeof
(
rb
);
rb
.
fMask
=
RBBIM_BACKGROUND
|
RBBIM_CHILD
|
RBBIM_CHILDSIZE
|
RBBIM_COLORS
|
RBBIM_HEADERSIZE
|
RBBIM_ID
|
RBBIM_IDEALSIZE
|
RBBIM_IMAGE
|
RBBIM_LPARAM
|
RBBIM_SIZE
|
RBBIM_STYLE
|
RBBIM_TEXT
;
rb
.
lpText
=
buf
;
rb
.
cch
=
MAX_PATH
;
ok
(
SendMessageA
(
hRebar
,
RB_GETBANDINFOA
,
uBand
,
(
LPARAM
)
&
rb
),
"RB_GETBANDINFO failed
\n
"
);
expect_eq
(
rb
.
fStyle
,
fStyle
,
int
,
"%x"
);
todo_wine
expect_eq
(
rb
.
clrFore
,
clrFore
,
COLORREF
,
"%x"
);
todo_wine
expect_eq
(
rb
.
clrBack
,
clrBack
,
int
,
"%x"
);
expect_eq
(
strcmp
(
rb
.
lpText
,
lpText
),
0
,
int
,
"%d"
);
expect_eq
(
rb
.
iImage
,
iImage
,
int
,
"%x"
);
expect_eq
(
rb
.
hwndChild
,
hwndChild
,
HWND
,
"%p"
);
expect_eq
(
rb
.
cxMinChild
,
cxMinChild
,
int
,
"%d"
);
expect_eq
(
rb
.
cyMinChild
,
cyMinChild
,
int
,
"%d"
);
expect_eq
(
rb
.
cx
,
cx
,
int
,
"%d"
);
expect_eq
(
rb
.
hbmBack
,
hbmBack
,
HBITMAP
,
"%p"
);
expect_eq
(
rb
.
wID
,
wID
,
int
,
"%d"
);
/* in Windows the values of cyChild, cyMaxChild and cyIntegral can't be read */
todo_wine
expect_eq
(
rb
.
cyChild
,
0xdddddddd
,
int
,
"%x"
);
todo_wine
expect_eq
(
rb
.
cyMaxChild
,
0xdddddddd
,
int
,
"%x"
);
todo_wine
expect_eq
(
rb
.
cyIntegral
,
0xdddddddd
,
int
,
"%x"
);
expect_eq
(
rb
.
cxIdeal
,
cxIdeal
,
int
,
"%d"
);
expect_eq
(
rb
.
lParam
,
lParam
,
LPARAM
,
"%lx"
);
expect_eq
(
rb
.
cxHeader
,
cxHeader
,
int
,
"%d"
);
}
static
void
bandinfo_test
()
{
REBARBANDINFOA
rb
;
CHAR
szABC
[]
=
"ABC"
;
CHAR
szABCD
[]
=
"ABCD"
;
rebuild_rebar
(
&
hRebar
);
rb
.
cbSize
=
sizeof
(
REBARBANDINFO
);
rb
.
fMask
=
0
;
ok
(
SendMessageA
(
hRebar
,
RB_INSERTBANDA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
""
,
-
1
,
NULL
,
0
,
0
,
0
,
NULL
,
0
,
0
,
0
,
0
);
rb
.
fMask
=
RBBIM_CHILDSIZE
;
rb
.
cxMinChild
=
15
;
rb
.
cyMinChild
=
20
;
rb
.
cyChild
=
30
;
rb
.
cyMaxChild
=
20
;
rb
.
cyIntegral
=
10
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
""
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
0
);
rb
.
fMask
=
RBBIM_TEXT
;
rb
.
lpText
=
szABC
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
35
);
rb
.
cbSize
=
sizeof
(
REBARBANDINFO
);
rb
.
fMask
=
0
;
ok
(
SendMessageA
(
hRebar
,
RB_INSERTBANDA
,
1
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
1
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
""
,
-
1
,
NULL
,
0
,
0
,
0
,
NULL
,
0
,
0
,
0
,
9
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
40
);
rb
.
fMask
=
RBBIM_HEADERSIZE
;
rb
.
cxHeader
=
50
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0x40000000
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
50
);
rb
.
cxHeader
=
5
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0x40000000
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
5
);
rb
.
fMask
=
RBBIM_TEXT
;
rb
.
lpText
=
szABCD
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0x40000000
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABCD"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
5
);
rb
.
fMask
=
RBBIM_STYLE
|
RBBIM_TEXT
;
rb
.
fStyle
=
0
;
rb
.
lpText
=
szABC
;
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0
,
0
,
40
);
DestroyWindow
(
hRebar
);
}
START_TEST
(
rebar
)
{
INITCOMMONCONTROLSEX
icc
;
WNDCLASSA
wc
;
MSG
msg
;
RECT
rc
;
icc
.
dwSize
=
sizeof
(
icc
);
icc
.
dwICC
=
ICC_COOL_CLASSES
;
InitCommonControlsEx
(
&
icc
);
wc
.
style
=
CS_HREDRAW
|
CS_VREDRAW
;
wc
.
cbClsExtra
=
0
;
wc
.
cbWndExtra
=
0
;
wc
.
hInstance
=
GetModuleHandleA
(
NULL
);
wc
.
hIcon
=
NULL
;
wc
.
hCursor
=
LoadCursorA
(
NULL
,
MAKEINTRESOURCEA
(
IDC_IBEAM
));
wc
.
hbrBackground
=
GetSysColorBrush
(
COLOR_WINDOW
);
wc
.
lpszMenuName
=
NULL
;
wc
.
lpszClassName
=
"MyTestWnd"
;
wc
.
lpfnWndProc
=
MyWndProc
;
RegisterClassA
(
&
wc
);
hMainWnd
=
CreateWindowExA
(
0
,
"MyTestWnd"
,
"Blah"
,
WS_OVERLAPPEDWINDOW
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
680
,
260
,
NULL
,
NULL
,
GetModuleHandleA
(
NULL
),
0
);
GetClientRect
(
hMainWnd
,
&
rc
);
ShowWindow
(
hMainWnd
,
SW_SHOW
);
bandinfo_test
();
PostQuitMessage
(
0
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageA
(
&
msg
);
}
DestroyWindow
(
hMainWnd
);
}
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