Commit 6971e1d7 authored by Vitaly Lipatov's avatar Vitaly Lipatov Committed by Alexandre Julliard

Add comments, fix negative value from GetCurFocus.

parent 8b4ff101
...@@ -201,6 +201,8 @@ TAB_DumpItemInternal(TAB_INFO *infoPtr, UINT iItem) ...@@ -201,6 +201,8 @@ TAB_DumpItemInternal(TAB_INFO *infoPtr, UINT iItem)
} }
} }
/* RETURNS
* the index of the selected tab, or -1 if no tab is selected. */
static LRESULT static LRESULT
TAB_GetCurSel (HWND hwnd) TAB_GetCurSel (HWND hwnd)
{ {
...@@ -209,11 +211,21 @@ TAB_GetCurSel (HWND hwnd) ...@@ -209,11 +211,21 @@ TAB_GetCurSel (HWND hwnd)
return infoPtr->iSelected; return infoPtr->iSelected;
} }
/* RETURNS
* the index of the tab item that has the focus
* NOTE
* we have not to return negative value
* TODO
* test for windows */
static LRESULT static LRESULT
TAB_GetCurFocus (HWND hwnd) TAB_GetCurFocus (HWND hwnd)
{ {
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd); TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
if (infoPtr->uFocus<0)
{
FIXME("we have not to return negative value");
return 0;
}
return infoPtr->uFocus; return infoPtr->uFocus;
} }
...@@ -255,7 +267,7 @@ TAB_SetCurFocus (HWND hwnd,WPARAM wParam) ...@@ -255,7 +267,7 @@ TAB_SetCurFocus (HWND hwnd,WPARAM wParam)
FIXME("Should set input focus\n"); FIXME("Should set input focus\n");
} else { } else {
int oldFocus = infoPtr->uFocus; int oldFocus = infoPtr->uFocus;
if (infoPtr->iSelected != iItem || infoPtr->uFocus == -1 ) { if (infoPtr->iSelected != iItem || oldFocus == -1 ) {
infoPtr->uFocus = iItem; infoPtr->uFocus = iItem;
if (oldFocus != -1) { if (oldFocus != -1) {
if (!TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)) { if (!TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment