int PBTabPanel::GetTabPointer(int x, int y) { int tabx = m_X, taby = m_Y; int i; if (m_LeftViewTab > 3) { if (ClickTab(x, y, tabx, taby)) { return 1; } tabx += m_ShiftX; taby += m_ShiftY; if (ClickTab(x, y, tabx, taby)) { return m_LeftViewTab - 1; } tabx += m_ShiftX; taby += m_ShiftY; } for (i = m_LeftViewTab; i <= m_RightViewTab; i++) { if (ClickTab(x, y, tabx, taby)) { return i; } tabx += m_ShiftX; taby += m_ShiftY; } if (m_RightViewTab + 1 < m_TabsCount) { if (ClickTab(x, y, tabx, taby)) { return m_RightViewTab + 1; } tabx += m_ShiftX; taby += m_ShiftY; if (ClickTab(x, y, tabx, taby)) { return m_TabsCount; } } return 0; }
void CAnotherView::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult) { // TODO: Add your control notification handler code here ClickTab(true); *pResult = 0; }