コード例 #1
1
void CXTPSkinObjectTab::OnMouseMove(UINT /*nFlags*/, CPoint point)
{
	int nHotItem = -1;
	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	for (int iItem = 0; iItem < pTabCtrl->GetItemCount(); ++iItem)
	{
		CRect rcItem;
		pTabCtrl->GetItemRect(iItem, &rcItem);
		if (rcItem.PtInRect(point))
		{
			nHotItem = iItem;
			break;
		}
	}

	if (nHotItem != m_nHotItem)
	{
		m_nHotItem = nHotItem;
		InvalidateRect(GetHeaderRect(), FALSE);

		if (m_nHotItem != -1)
		{
			TRACKMOUSEEVENT tme = {sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, HOVER_DEFAULT};
			_TrackMouseEvent(&tme);
		}
	}
}
コード例 #2
0
void CXTPSkinObjectTab::FillClient(CDC* pDC, CRect rc)
{
	FillBackground(pDC, rc);

	if (GetStyle() & TCS_BUTTONS)
		return;

	CXTPSkinManagerClass* pClass = GetSkinClass();

	CRect rcClient(rc);
	CRect rcHeader = GetHeaderRect();

	DWORD dwStyle = GetStyle();

	if (IsRight(dwStyle))
	{
		rcClient.right = rcHeader.left;
	}
	else if (IsLeft(dwStyle))
	{
		rcClient.left = rcHeader.right;
	}
	else if (IsBottom(dwStyle))
	{
		rcClient.bottom = rcHeader.top;
	}
	else
	{
		rcClient.top = rcHeader.bottom;
	}

	pClass->DrawThemeBackground(pDC, TABP_PANE, 0, &rcClient);
}
コード例 #3
0
void CXTPSkinObjectTab::OnDraw(CDC* pDC)
{
	CRect rc = GetHeaderRect();
	DWORD dwStyle = GetStyle();

	if (IsRight(dwStyle))
	{
		rc.left -= 2;
	}
	else if (IsLeft(dwStyle))
	{
		rc.right += 2;
	}
	else if (IsBottom(dwStyle))
	{
		rc.top -= 2;
	}
	else
	{
		rc.bottom += 2;
	}

	CXTPBufferDC dcMem(*pDC, rc);
	FillClient(&dcMem, CXTPClientRect(this));

	if (m_bActiveX)
	{
		m_bPaint = TRUE;
		CXTPBufferDC dcMem2(*pDC, rc);
		DefWindowProc(WM_PAINT, (WPARAM)dcMem2.GetSafeHdc(), 0);
		dcMem2.Discard();
		m_bPaint = FALSE;
	}

	CTabCtrl* pTabCtrl = (CTabCtrl*)this;

	CXTPFontDC font(&dcMem, GetFont());
	dcMem.SetBkMode(TRANSPARENT);

	for (int iItem = 0; iItem < pTabCtrl->GetItemCount(); ++iItem)
	{
		DrawTab(&dcMem, iItem);
	}

	DrawTab(&dcMem, pTabCtrl->GetCurSel());
}
コード例 #4
0
BOOL CResizableSheetEx::OnEraseBkgnd(CDC* pDC) 
{
	if (ClipChildren(pDC, FALSE))
	{
		// when clipping, remove header from clipping area
		if (IsWizard97())
		{
			// clip header area out
			CRect rect;
			GetHeaderRect(rect);
			pDC->ExcludeClipRect(rect);
		}
	}

	BOOL bRet = CPropertySheetEx::OnEraseBkgnd(pDC);

	ClipChildren(pDC, TRUE);

	return bRet;
}
コード例 #5
0
void CResizableSheetEx::OnSize(UINT nType, int cx, int cy) 
{
	CWnd::OnSize(nType, cx, cy);
	
	if (nType == SIZE_MAXHIDE || nType == SIZE_MAXSHOW)
		return;		// arrangement not needed

	if (nType == SIZE_MAXIMIZED)
		HideSizeGrip(&m_dwGripTempState);
	else
		ShowSizeGrip(&m_dwGripTempState);

	// update grip and layout
	UpdateSizeGrip();
	ArrangeLayout();

	if (IsWizard97())
	{
		// refresh header area
		CRect rect;
		GetHeaderRect(rect);
		InvalidateRect(rect, FALSE);
	}
}