예제 #1
0
void CKofRichEditCtrl::OnNcPaint()
{
	const BOOL bHasScrollBars = ((GetStyle () & WS_VSCROLL) == WS_VSCROLL) || ((GetStyle () & WS_HSCROLL) == WS_HSCROLL);

	CWindowDC dc (this);
	CRect rectWindow;
	GetWindowRect (rectWindow);

	if ((!TRUE && !FALSE))
	{
		CRichEditCtrl::OnNcPaint ();
	}
	else
	{
		if (bHasScrollBars)
		{
			CRichEditCtrl::OnNcPaint ();
		}
		CRect rectBorder = rectWindow;
		rectBorder.bottom -= rectBorder.top;
		rectBorder.right -= rectBorder.left;
		rectBorder.left = rectBorder.top = 0;
		CKofStyleHelper::GetInstance()->OnDrawEditBorder(&dc, rectBorder, FALSE, FALSE, IsWindowEnabled());
		rectBorder.DeflateRect(1, 1);
		dc.Draw3dRect(rectBorder, afxGlobalData.clrWindow, afxGlobalData.clrWindow);
	}

	if (GetStyle () & WS_BORDER)
	{
		CMFCVisualManager::GetInstance()->OnDrawControlBorder (this);
	}
}
void CDittoWindow::DrawMinimizeBtn(CWindowDC &dc)
{
	if(m_bDrawMinimize == false)
	{
		return;
	}

	//rows first then columns
	int Points[5][6] =
	{
			0,0,0,0,0,0,
			0,0,0,0,0,0,
			0,0,0,0,0,0,
			1,1,1,1,1,0,
			1,1,1,1,1,0
	};

	CPoint ptShift = m_crMinimizeBT.TopLeft();
	ptShift.Offset(3, 3);

	if(m_bMouseDownOnMinimize)
	{
		dc.Draw3dRect(m_crMinimizeBT, RGB(255, 255, 255), RGB(255, 255, 255));
		CRect cr(m_crMinimizeBT);
		cr.DeflateRect(1, 1, 1, 1);
		dc.Draw3dRect(cr, RGB(255, 255, 255), RGB(255, 255, 255));
	}
	else if(m_bMouseOverMinimize)
	{
		dc.Draw3dRect(m_crMinimizeBT, RGB(255, 255, 255), RGB(255, 255, 255));
	}

	for (int iRow = 0; iRow < 5; iRow++)
	{
		for (int iCol = 0; iCol < 6; iCol++)
		{
			if (Points[iRow][iCol] == 1)
				dc.SetPixel(ptShift+CPoint(iCol, iRow), RGB(255, 255, 255));
		}
	}
}