Exemplo n.º 1
0
void CNavPaneWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
	CSize szClient = ::GetClientSize(this);
	if (szClient.cx > 70)
	{
		if (m_rcClose.PtInRect(point))
		{
			m_bDragging = true;
			UpdateButtons();
			SetCapture();
			return;
		}
		else if (m_rcSettings.PtInRect(point))
		{
			m_bSettingsPressed = true;
			InvalidateRect(m_rcSettings);
			UpdateWindow();

			CRect rcButton = m_rcSettings;
			ClientToScreen(rcButton);
			if (m_nActiveTab != -1)
				m_tabs[m_nActiveTab].pWnd->SendMessage(WM_SHOW_SETTINGS, 0, (LPARAM)(LPRECT) rcButton);

			// Eat mouse messages during popupmenu
			MSG msg;
			if (::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE))
			{
				if (rcButton.PtInRect(msg.pt))
					::PeekMessage(&msg, m_hWnd, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_REMOVE);
			}

			m_bSettingsPressed = false;
			m_bSettingsActive = false;
			InvalidateRect(m_rcSettings);
			UpdateWindow();
			return;
		}
	}

	int nTabClicked = GetTabFromPoint(point);
	if (nTabClicked != -1)
	{
		if (GetParent()->SendMessage(WM_CLICKED_NAV_TAB, 0, (LPARAM) m_tabs[nTabClicked].pWnd))
			ActivateTab(nTabClicked, true);
	}

	UpdateButtons();
	CWnd::OnLButtonDown(nFlags, point);
}
Exemplo n.º 2
0
//*******************************************************************************
void CShopTabWnd::OnLButtonDown (UINT nFlags, CPoint point)
{
    if (IsPtInMenuArea (point))
    {
        return;
    }
    if (GetTabFromPoint (point) < 0)
    {
        CBCGPTabbedControlBar* pParent = DYNAMIC_DOWNCAST(CBCGPTabbedControlBar, GetParent ());
        if (pParent)
        {
            pParent->SendMessage(WM_LBUTTONDOWN, (WPARAM)nFlags, MAKELPARAM (point.x, point.y));
            return;
        }
    }
    CBCGPTabWnd::OnLButtonDown(nFlags, point);
}
Exemplo n.º 3
0
// -2 - out of control, -1 - out of tab-labels, 0+ - tab index 0-based
int CTabBarClass::ActivateTabByPoint(LPPOINT pptCur, bool bScreen /*= true*/, bool bOverTabHitTest /*= true*/)
{
	int iHoverTab = GetTabFromPoint(NULL);
	if (iHoverTab < 0)
		return iHoverTab;
	if (iHoverTab == GetCurSel())
		return iHoverTab;

	if (!CanActivateTab(iHoverTab))
	{
		iHoverTab = -2;
	}
	else
	{
		if (!mp_Rebar->FarSendChangeTab(iHoverTab))
			iHoverTab = -2;
	}

	return iHoverTab;
}
Exemplo n.º 4
0
LRESULT CTabPanelWin::TabHitTest(bool abForce /*= false*/, int* pnOverTabHit /*= NULL*/)
{
	if (pnOverTabHit)
		*pnOverTabHit = -1;

	if (gpSet->isTabs && (abForce || gpSet->isCaptionHidden()))
	{
		if (mp_Owner->IsTabsShown())
		{
			POINT ptCur = {}; GetCursorPos(&ptCur);
			int nTabIdx = GetTabFromPoint(ptCur);
			// -2 - out of control, -1 - out of tab-labels, 0+ - tab index 0-based
			if (nTabIdx == -1)
				return HTCAPTION;
			if (pnOverTabHit)
				*pnOverTabHit = nTabIdx;
		}
	}

	return HTNOWHERE;
}