Пример #1
0
void TabView_CalculateNextTab(HWND hWndTabView)
{
    struct TabViewInfo *pTabViewInfo = GetTabViewInfo(hWndTabView);

    // at most loop once through all options
    for (int i = 0; i < pTabViewInfo->nTabCount; i++)
    {
        int nCurrentTab = TabView_GetCurrentTab(hWndTabView);
        TabView_SetCurrentTab(hWndTabView, (nCurrentTab + 1) % pTabViewInfo->nTabCount);
        nCurrentTab = TabView_GetCurrentTab(hWndTabView);

        if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(nCurrentTab))
            // this tab is being shown, so we're all set
            return;
    }
}
Пример #2
0
static void SoftwareTabView_OnSelectionChanged(void)
{
	int nTab = 0;
	HWND hwndSoftwarePicker;
	HWND hwndSoftwareDevView;
	HWND hwndSoftwareList;

	hwndSoftwarePicker = GetDlgItem(GetMainWindow(), IDC_SWLIST);
	hwndSoftwareDevView = GetDlgItem(GetMainWindow(), IDC_SWDEVVIEW);
	hwndSoftwareList = GetDlgItem(GetMainWindow(), IDC_SOFTLIST);

	nTab = TabView_GetCurrentTab(GetDlgItem(GetMainWindow(), IDC_SWTAB));

	switch(nTab)
	{
		case 0:
			ShowWindow(hwndSoftwarePicker, SW_SHOW);
			ShowWindow(hwndSoftwareDevView, SW_HIDE);
			ShowWindow(hwndSoftwareList, SW_HIDE);
			break;

		case 1:
			ShowWindow(hwndSoftwarePicker, SW_HIDE);
			ShowWindow(hwndSoftwareDevView, SW_SHOW);
			ShowWindow(hwndSoftwareList, SW_HIDE);
			break;
		case 2:
			ShowWindow(hwndSoftwarePicker, SW_HIDE);
			ShowWindow(hwndSoftwareDevView, SW_HIDE);
			ShowWindow(hwndSoftwareList, SW_SHOW);
			break;
	}
}
Пример #3
0
static int TabView_GetCurrentTabIndex(HWND hWndTabView)
{
    int shown_tabs = 0;
    int nCurrentTab = TabView_GetCurrentTab(hWndTabView);
    struct TabViewInfo *pTabViewInfo = GetTabViewInfo(hWndTabView);

    for (int i = 0; i < pTabViewInfo->nTabCount; i++)
    {
        if (i == nCurrentTab)
            break;

        if (!pTabViewInfo->pCallbacks->pfnGetShowTab || pTabViewInfo->pCallbacks->pfnGetShowTab(i))
            shown_tabs++;
    }

    return shown_tabs;
}