Example #1
0
	void CDuiWkeWebkit::onBufUpdated( const HDC hdc,int x, int y, int cx, int cy )
	{
		CRect rcClient;
		GetClient(&rcClient);
		CRect rcInvalid(CPoint(x,y),CSize(cx,cy));
		rcInvalid.OffsetRect(rcClient.TopLeft());
		NotifyInvalidateRect(rcInvalid);
	}
Example #2
0
void RWinColorPalette::EnableFlyovers( BOOLEAN fEnabled )
{
	CRect rcInvalid( m_rcColorChip );
	InvalidateRect( rcInvalid, FALSE );

	m_crHilited = (COLORREF) -1L;
	m_fFlyoversEnabled = fEnabled;
}
Example #3
0
//显示扑克
void CCardControl::ShowFirstCard(bool bShowFirst)
{
	//设置变量
	m_bShowFirst=bShowFirst;

	//刷新界面
	CRect rcInvalid(0,0,(m_CardDataArray.GetCount()==1)?CARD_WIDTH:CARD_SPACE,CARD_HEIGHT);
	InvalidateRect(rcInvalid,FALSE);
	
	return;
}
Example #4
0
//鼠标消息
void CCardControl::OnLButtonUp(UINT nFlags, CPoint point)
{
	__super::OnLButtonUp(nFlags, point);

	//状态判断
	if (m_bCaptureMouse==false) return;

	//释放捕获
	ReleaseCapture();
	m_bCaptureMouse=false;

	//刷新界面
	CRect rcInvalid(0,0,(m_CardDataArray.GetCount()==1)?CARD_WIDTH:CARD_SPACE,CARD_HEIGHT);
	InvalidateRect(rcInvalid,FALSE);

	return;
}
Example #5
0
void RWinColorPalette::OnSetFocus( CWnd* )
{
	CRect rcInvalid( -1, -1, kCellSize.m_dx + 1, kCellSize.m_dy + 1 );
	rcInvalid.OffsetRect( m_ptSelected.m_x, m_ptSelected.m_y );
	InvalidateRect( rcInvalid, FALSE );
}
Example #6
0
void RWinColorPalette::OnKeyDown( UINT nChar, UINT nRepCnt, UINT nFlags )
{
	RIntPoint ptNew( kPtFirstCol );

	if (m_ptSelected.m_x >= 0 && m_ptSelected.m_y >= 0)
	{
		RIntPoint ptTopLeft( (m_ptSelected.m_x < kPtLeftCol.m_x ? kPtFirstCol : kPtLeftCol) ) ;
		RIntPoint ptPoint( m_ptSelected.m_x - ptTopLeft.m_x, m_ptSelected.m_y - ptTopLeft.m_y );

		if (m_ptSelected.m_x >= kPtLeftCol.m_x)
			ptPoint.m_x += kCellDistance;

		int nCurRow = ptPoint.m_y / kCellDistance;
		int nCurCol = ptPoint.m_x / kCellDistance;

		switch (nChar)
		{
		case VK_UP:
			nCurRow -= nRepCnt;
			break;

		case VK_DOWN:
			nCurRow += nRepCnt;
			break;

		case VK_LEFT:
			nCurCol -= nRepCnt;
			break;

		case VK_RIGHT:
			nCurCol += nRepCnt;
			break;
		}

		RBitmapImage& biPalette	= GetPaletteBitmapImage();
		int cxCols = (biPalette.GetWidthInPixels() - 
			kPtLeftCol.m_x) / kCellDistance + 1;  // One is added for first column

		int cxRows = (biPalette.GetHeightInPixels() -
			kPtLeftCol.m_y) / kCellDistance;

		nCurRow %= cxRows;
		nCurCol %= cxCols;

		if (nCurCol < 0) nCurCol += cxCols;
		if (nCurRow < 0) nCurRow += cxRows;

		ptNew.m_x = (nCurCol ? (nCurCol - 1) * kCellDistance + kPtLeftCol.m_x : kPtFirstCol.m_x);
		ptNew.m_y = nCurRow * kCellDistance + kPtLeftCol.m_y;
	}

	CRect rcInvalid( -1, -1, kCellSize.m_dx + 1, kCellSize.m_dy + 1 );
	rcInvalid.OffsetRect( m_ptSelected.m_x, m_ptSelected.m_y );
	InvalidateRect( rcInvalid, FALSE );

	RIntPoint pt( ptNew.m_x + 1, ptNew.m_y + 1 );
	m_crSelected = ColorFromPoint( pt );
	m_ptSelected = ptNew;

	GetParent()->SendMessage( UM_COLOR_CHANGED, GetDlgCtrlID(), (LPARAM) m_crSelected ) ;

	CStatic::OnKeyDown( nChar, nRepCnt, nFlags );
}