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
364c3aa4
Commit
364c3aa4
authored
Oct 21, 2005
by
Krzysztof Foltman
Committed by
Alexandre Julliard
Oct 21, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Separators with group style set don't separate toolbar radio groups
anymore (which broke tool selection in Front Panel Designer).
parent
b26ae86b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
2 deletions
+141
-2
.cvsignore
dlls/comctl32/tests/.cvsignore
+1
-0
Makefile.in
dlls/comctl32/tests/Makefile.in
+1
-0
toolbar.c
dlls/comctl32/tests/toolbar.c
+137
-0
toolbar.c
dlls/comctl32/toolbar.c
+2
-2
No files found.
dlls/comctl32/tests/.cvsignore
View file @
364c3aa4
...
...
@@ -7,5 +7,6 @@ progress.ok
subclass.ok
tab.ok
testlist.c
toolbar.ok
treeview.ok
updown.ok
dlls/comctl32/tests/Makefile.in
View file @
364c3aa4
...
...
@@ -13,6 +13,7 @@ CTESTS = \
progress.c
\
subclass.c
\
tab.c
\
toolbar.c
\
treeview.c
\
updown.c
...
...
dlls/comctl32/tests/toolbar.c
0 → 100644
View file @
364c3aa4
/* Unit tests for treeview.
*
* Copyright 2005 Krzysztof Foltman
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <assert.h>
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "winreg.h"
#include "commctrl.h"
#include "wine/test.h"
static
void
MakeButton
(
TBBUTTON
*
p
,
int
idCommand
,
int
fsStyle
,
int
nString
)
{
p
->
iBitmap
=
-
2
;
p
->
idCommand
=
idCommand
;
p
->
fsState
=
TBSTATE_ENABLED
;
p
->
fsStyle
=
fsStyle
;
p
->
iString
=
nString
;
}
static
LRESULT
CALLBACK
MyWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
switch
(
msg
)
{
case
WM_CREATE
:
{
TBBUTTON
buttons
[
9
];
int
i
;
HWND
hToolbar
;
for
(
i
=
0
;
i
<
9
;
i
++
)
MakeButton
(
buttons
+
i
,
1000
+
i
,
TBSTYLE_CHECKGROUP
,
0
);
MakeButton
(
buttons
+
3
,
1003
,
TBSTYLE_SEP
|
TBSTYLE_GROUP
,
0
);
MakeButton
(
buttons
+
6
,
1006
,
TBSTYLE_SEP
,
0
);
hToolbar
=
CreateToolbarEx
(
hWnd
,
WS_VISIBLE
|
WS_CLIPCHILDREN
|
CCS_TOP
|
WS_CHILD
|
TBSTYLE_LIST
,
100
,
0
,
NULL
,
(
UINT
)
0
,
buttons
,
sizeof
(
buttons
)
/
sizeof
(
buttons
[
0
]),
0
,
0
,
20
,
16
,
sizeof
(
TBBUTTON
));
ok
(
hToolbar
!=
NULL
,
"Toolbar creation"
);
SendMessage
(
hToolbar
,
TB_ADDSTRINGA
,
0
,
(
LPARAM
)
"test
\000
"
);
/* test for exclusion working inside a separator-separated :-) group */
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1000
,
1
);
/* press A1 */
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 pressed
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1001
,
0
),
"A2 not pressed
\n
"
);
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1004
,
1
);
/* press A5, release A1 */
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1004
,
0
),
"A5 pressed
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 not pressed anymore
\n
"
);
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1005
,
1
);
/* press A6, release A5 */
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1005
,
0
),
"A6 pressed
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1004
,
0
),
"A5 not pressed anymore
\n
"
);
/* test for inter-group crosstalk, ie. two radio groups interfering with each other */
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1007
,
1
);
/* press B2 */
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1005
,
0
),
"A6 still pressed, no inter-group crosstalk
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 still not pressed
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1007
,
0
),
"B2 pressed
\n
"
);
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1000
,
1
);
/* press A1 and ensure B group didn't suffer */
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1005
,
0
),
"A6 not pressed anymore
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 pressed
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1007
,
0
),
"B2 still pressed
\n
"
);
SendMessage
(
hToolbar
,
TB_CHECKBUTTON
,
1008
,
1
);
/* press B3, and ensure A group didn't suffer */
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1005
,
0
),
"A6 pressed
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1000
,
0
),
"A1 pressed
\n
"
);
ok
(
!
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1007
,
0
),
"B2 not pressed
\n
"
);
ok
(
SendMessage
(
hToolbar
,
TB_ISBUTTONCHECKED
,
1008
,
0
),
"B3 pressed
\n
"
);
PostMessage
(
hWnd
,
WM_CLOSE
,
0
,
0
);
return
0
;
}
case
WM_DESTROY
:
PostQuitMessage
(
0
);
break
;
default:
return
DefWindowProcA
(
hWnd
,
msg
,
wParam
,
lParam
);
}
return
0L
;
}
START_TEST
(
toolbar
)
{
WNDCLASSA
wc
;
MSG
msg
;
RECT
rc
;
HWND
hMainWnd
;
InitCommonControls
();
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
);
while
(
GetMessageA
(
&
msg
,
0
,
0
,
0
))
{
TranslateMessage
(
&
msg
);
DispatchMessageA
(
&
msg
);
}
}
dlls/comctl32/toolbar.c
View file @
364c3aa4
...
...
@@ -1854,7 +1854,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
nRunIndex
=
nIndex
-
1
;
while
(
nRunIndex
>=
0
)
{
btnPtr
=
&
infoPtr
->
buttons
[
nRunIndex
];
if
((
btnPtr
->
fsStyle
&
BTNS_
CHECKGROUP
)
==
BTNS_CHECK
GROUP
)
{
if
((
btnPtr
->
fsStyle
&
BTNS_
GROUP
)
==
BTNS_
GROUP
)
{
if
(
btnPtr
->
fsState
&
TBSTATE_CHECKED
)
return
nRunIndex
;
}
...
...
@@ -1867,7 +1867,7 @@ TOOLBAR_GetCheckedGroupButtonIndex (TOOLBAR_INFO *infoPtr, INT nIndex)
nRunIndex
=
nIndex
+
1
;
while
(
nRunIndex
<
infoPtr
->
nNumButtons
)
{
btnPtr
=
&
infoPtr
->
buttons
[
nRunIndex
];
if
((
btnPtr
->
fsStyle
&
BTNS_
CHECKGROUP
)
==
BTNS_CHECK
GROUP
)
{
if
((
btnPtr
->
fsStyle
&
BTNS_
GROUP
)
==
BTNS_
GROUP
)
{
if
(
btnPtr
->
fsState
&
TBSTATE_CHECKED
)
return
nRunIndex
;
}
...
...
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