예제 #1
0
//*******************************************************************************
void CBCGPTextGaugeImpl::SetText(const CString& str, const CBCGPColor& clrText, BOOL bRedraw)
{
	m_strText = str;
	CreateResources(clrText == CBCGPColor() ? CBCGPBrush() : CBCGPBrush(clrText), FALSE);

	SetDirty();

	if (bRedraw)
	{
		Redraw();
	}
}
CBCGPDiagramVisualContainer::CBCGPDiagramVisualContainer(CWnd* pWndOwner) 
	: CBCGPVisualContainer (pWndOwner)
{
	m_nLastID = 0;

	m_bIsEditAnchorMode = FALSE;

	m_bEnableInplaceEdit = FALSE;
	m_pInplaceEditItem = NULL;

	m_brAnchorFill = CBCGPBrush(CBCGPColor::DarkOrange, .5);
	m_brAnchorOutline = CBCGPBrush(CBCGPColor::Firebrick);

	m_bInsideUpdateItems = FALSE;
}
예제 #3
0
//*******************************************************************************
void CBCGPTextGaugeImpl::OnDraw(CBCGPGraphicsManager* pGM, const CBCGPRect& /*rectClip*/, DWORD dwFlags)
{
	ASSERT_VALID(pGM);

	if (m_rect.IsRectEmpty() || !m_bIsVisible || m_strText.IsEmpty())
	{
		return;
	}

	if ((dwFlags & m_DefaultDrawFlags) == 0)
	{
		return;
	}

	CBCGPRect rect = m_rect;
	if (m_bIsSubGauge)
	{
		rect.OffsetRect(-m_ptScrollOffset);
	}

	pGM->FillRectangle(rect, GetFillBrush ());

	const CBCGPBrush& br = m_bOff ? m_brTextLight : m_brText;

	CreateResources(CBCGPBrush(), FALSE);
	pGM->DrawText(m_strText, rect, m_textFormat, br);

	pGM->DrawRectangle(rect, GetOutlineBrush (), GetScaleRatioMid());
	
	SetDirty(FALSE);
}
예제 #4
0
//*******************************************************************************
CBCGPSize CBCGPTextGaugeImpl::GetDefaultSize(CBCGPGraphicsManager* pGM, const CBCGPBaseVisualObject* /*pParentGauge*/)
{
	ASSERT_VALID(pGM);

	CreateResources(CBCGPBrush(), FALSE);
	return pGM->GetTextSize(m_strText, m_textFormat);
}
예제 #5
0
CBCGPTreeMap::CBCGPTreeMap()
{
	m_LayoutType = Squarified;
	m_Root.m_pOwner = this;
	m_Root.m_bIsRoot = TRUE;
	m_Root.m_sizeMargin = CBCGPSize(1, 1);
	m_brFill = CBCGPBrush(CBCGPColor::DarkGray);
	
	m_pClicked = NULL;
}
//*******************************************************************************
void CBCGPAnalogClock::EnableDate(BOOL bEnable, BCGP_SUB_GAUGE_POS pos)
{
	if (bEnable)
	{
		if (m_pDate != NULL)
		{
			return;
		}

		m_pDate = new CBCGPNumericIndicatorImpl;
		m_pDate->SetCells(2);
		m_pDate->SetDecimals(0);
		m_pDate->SetSeparatorWidth(0);

		CBCGPNumericIndicatorColors colors;
		colors.m_brFill = CBCGPBrush(CBCGPColor::White, CBCGPColor::LightGray, CBCGPBrush::BCGP_GRADIENT_HORIZONTAL);
		colors.m_brDigit = CBCGPBrush(CBCGPColor::Gray);

		m_pDate->SetColors(colors);

		AddSubGauge(m_pDate, pos, CBCGPSize(20, 15), CBCGPPoint(-5, 0));
	}
	else
	{
		if (m_pDate == NULL)
		{
			return;
		}

		ASSERT_VALID(m_pDate);
		
		RemoveSubGauge(m_pDate);
		m_pDate = NULL;
	}

	OnSetClockTime(TRUE);
}
예제 #7
0
void CBCGPBaseTreeMapNode::DrawTextWidthShadow(CBCGPGraphicsManager* pGM, const CString& str, const CBCGPRect& rect, const CBCGPBrush& br, const CBCGPTextFormat& tf)
{
	ASSERT_VALID(pGM);

	CBCGPSize sizeText = pGM->GetTextSize(str, tf);

	if (sizeText.cx > rect.Width() || sizeText.cy > rect.Height())
	{
		return;
	}

	CBCGPRect rectShadow = rect;
	rectShadow.OffsetRect(1, 1);

	pGM->DrawText(str, rectShadow, tf, CBCGPBrush(CBCGPColor::Black));
	pGM->DrawText(str, rect, tf, br);
}
예제 #8
0
//*******************************************************************************
void CBCGPTextGaugeImpl::SetTextColor(const CBCGPColor& color)
{
	CreateResources(CBCGPBrush(color), FALSE);
	SetDirty();
}