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
637a6116
Commit
637a6116
authored
Mar 17, 2007
by
Hagop Hagopian
Committed by
Alexandre Julliard
Mar 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: tab: Minor bug fixes in the curSel and curFocus getters and setters.
parent
62d3be77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
35 deletions
+26
-35
tab.c
dlls/comctl32/tab.c
+25
-29
tab.c
dlls/comctl32/tests/tab.c
+1
-6
No files found.
dlls/comctl32/tab.c
View file @
637a6116
...
...
@@ -231,19 +231,10 @@ static inline LRESULT TAB_GetCurSel (const TAB_INFO *infoPtr)
}
/* RETURNS
* the index of the tab item that has the focus
* NOTE
* we have not to return negative value
* TODO
* test for windows */
* the index of the tab item that has the focus. */
static
inline
LRESULT
TAB_GetCurFocus
(
const
TAB_INFO
*
infoPtr
)
{
if
(
infoPtr
->
uFocus
<
0
)
{
FIXME
(
"we have not to return negative value
\n
"
);
return
0
;
}
return
infoPtr
->
uFocus
;
}
...
...
@@ -255,10 +246,13 @@ static inline LRESULT TAB_GetToolTips (const TAB_INFO *infoPtr)
static
inline
LRESULT
TAB_SetCurSel
(
TAB_INFO
*
infoPtr
,
INT
iItem
)
{
INT
prevItem
=
-
1
;
INT
prevItem
=
infoPtr
->
iSelected
;
if
(
iItem
>=
0
&&
iItem
<
infoPtr
->
uNumItem
)
{
prevItem
=
infoPtr
->
iSelected
;
if
(
iItem
<
0
)
infoPtr
->
iSelected
=-
1
;
else
if
(
iItem
>=
infoPtr
->
uNumItem
)
return
-
1
;
else
{
if
(
infoPtr
->
iSelected
!=
iItem
)
{
infoPtr
->
iSelected
=
iItem
;
TAB_EnsureSelectionVisible
(
infoPtr
);
...
...
@@ -270,23 +264,25 @@ static inline LRESULT TAB_SetCurSel (TAB_INFO *infoPtr, INT iItem)
static
LRESULT
TAB_SetCurFocus
(
TAB_INFO
*
infoPtr
,
INT
iItem
)
{
if
(
iItem
<
0
||
iItem
>=
infoPtr
->
uNumItem
)
return
0
;
if
(
GetWindowLongW
(
infoPtr
->
hwnd
,
GWL_STYLE
)
&
TCS_BUTTONS
)
{
FIXME
(
"Should set input focus
\n
"
);
}
else
{
int
oldFocus
=
infoPtr
->
uFocus
;
if
(
infoPtr
->
iSelected
!=
iItem
||
oldFocus
==
-
1
)
{
infoPtr
->
uFocus
=
iItem
;
if
(
oldFocus
!=
-
1
)
{
if
(
!
TAB_SendSimpleNotify
(
infoPtr
,
TCN_SELCHANGING
))
{
infoPtr
->
iSelected
=
iItem
;
TAB_SendSimpleNotify
(
infoPtr
,
TCN_SELCHANGE
);
if
(
iItem
<
0
)
infoPtr
->
uFocus
=
-
1
;
else
if
(
iItem
<
infoPtr
->
uNumItem
)
{
if
(
GetWindowLongW
(
infoPtr
->
hwnd
,
GWL_STYLE
)
&
TCS_BUTTONS
)
{
FIXME
(
"Should set input focus
\n
"
);
}
else
{
int
oldFocus
=
infoPtr
->
uFocus
;
if
(
infoPtr
->
iSelected
!=
iItem
||
oldFocus
==
-
1
)
{
infoPtr
->
uFocus
=
iItem
;
if
(
oldFocus
!=
-
1
)
{
if
(
!
TAB_SendSimpleNotify
(
infoPtr
,
TCN_SELCHANGING
))
{
infoPtr
->
iSelected
=
iItem
;
TAB_SendSimpleNotify
(
infoPtr
,
TCN_SELCHANGE
);
}
else
infoPtr
->
iSelected
=
iItem
;
TAB_EnsureSelectionVisible
(
infoPtr
);
TAB_InvalidateTabArea
(
infoPtr
);
}
else
infoPtr
->
iSelected
=
iItem
;
TAB_EnsureSelectionVisible
(
infoPtr
);
TAB_InvalidateTabArea
(
infoPtr
);
}
}
}
...
...
dlls/comctl32/tests/tab.c
View file @
637a6116
...
...
@@ -663,9 +663,7 @@ static void test_getters_setters(INT nTabs)
/* Testing CurFocus with negative value */
SendMessage
(
hTab
,
TCM_SETCURFOCUS
,
-
10
,
0
);
focusIndex
=
SendMessage
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
todo_wine
{
expect
(
-
1
,
focusIndex
);
}
/* Testing CurFocus with value larger than number of tabs */
focusIndex
=
SendMessage
(
hTab
,
TCM_SETCURSEL
,
1
,
0
);
...
...
@@ -697,15 +695,12 @@ static void test_getters_setters(INT nTabs)
/* Testing CurSel with negative value */
SendMessage
(
hTab
,
TCM_SETCURSEL
,
-
10
,
0
);
selectionIndex
=
SendMessage
(
hTab
,
TCM_GETCURSEL
,
0
,
0
);
todo_wine
{
expect
(
-
1
,
selectionIndex
);
}
/* Testing CurSel with value larger than number of tabs */
selectionIndex
=
SendMessage
(
hTab
,
TCM_SETCURSEL
,
1
,
0
);
todo_wine
{
expect
(
-
1
,
selectionIndex
);
}
selectionIndex
=
SendMessage
(
hTab
,
TCM_SETCURSEL
,
nTabs
+
1
,
0
);
expect
(
-
1
,
selectionIndex
);
selectionIndex
=
SendMessage
(
hTab
,
TCM_GETCURFOCUS
,
0
,
0
);
...
...
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