in setupgui/windows/TabCtrl.cpp [177:279]
BOOL OnKeyDown(LPARAM lParam)
{
BOOL verticalTabs;
TC_KEYDOWN *tk=(TC_KEYDOWN *)lParam;
int itemCount=TabCtrl_GetItemCount(tk->hdr.hwndFrom);
int currentSel=TabCtrl_GetCurSel(tk->hdr.hwndFrom);
if(itemCount <= 1) return FALSE; // Ignore if only one TabPage
verticalTabs= GetWindowLongPtr(This->hTab, GWL_STYLE) & TCS_VERTICAL;
if(verticalTabs)
{
switch (tk->wVKey)
{
case VK_PRIOR: //select the previous page
{
if(0==currentSel) return TRUE;
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel-1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom,currentSel-1);
}
return TRUE;
case VK_UP: //select the previous page
{
if(0==currentSel) return TRUE;
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel-1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom, currentSel);
}
return TRUE;
case VK_NEXT: //select the next page
{
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel+1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom, currentSel+1);
}
return TRUE;
case VK_DOWN: //select the next page
{
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel+1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom,currentSel);
}
return TRUE;
case VK_LEFT: //navagate within selected child tab page
{
SetFocus(This->hTabPages[currentSel]); // focus to child tab page
TabPageMessageLoop (This->hTabPages[currentSel]); //start message loop
}
return TRUE;
case VK_RIGHT: //navagate within selected child tab page
{
SetFocus(This->hTabPages[currentSel]);
TabPageMessageLoop (This->hTabPages[currentSel]);
}
return TRUE;
default: return FALSE;
}
} // if(verticalTabs)
else // horizontal Tabs
{
switch (tk->wVKey)
{
case VK_NEXT: //select the previous page
{
if(0==currentSel) return TRUE;
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel-1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom, currentSel-1);
}
return TRUE;
case VK_LEFT: //select the previous page
{
if(0==currentSel) return TRUE;
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel-1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom, currentSel);
}
return TRUE;
case VK_PRIOR: //select the next page
{
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel+1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom,currentSel+1);
}
return TRUE;
case VK_RIGHT: //select the next page
{
TabCtrl_SetCurSel(tk->hdr.hwndFrom, currentSel+1);
TabCtrl_SetCurFocus(tk->hdr.hwndFrom,currentSel);
}
return TRUE;
case VK_UP: //navagate within selected child tab page
{
SetFocus(This->hTabPages[currentSel]);
TabPageMessageLoop (This->hTabPages[currentSel]);
}
return TRUE;
case VK_DOWN: //navagate within selected child tab page
{
SetFocus(This->hTabPages[currentSel]);
TabPageMessageLoop (This->hTabPages[currentSel]);
}
return TRUE;
default: return FALSE;
}
} //else // horizontal Tabs
}