Exemplo n.º 1
0
void CXTPMDIWndTab::InitializeFont()
{
	HGDIOBJ hFont = XTPAuxData().font.GetSafeHandle();

	// if the tabs are vertical, use the vertical menu font.
	if ((GetStyle() & TCS_VERTICAL) == TCS_VERTICAL)
		hFont = XTPAuxData().fontVert.GetSafeHandle();

	if (hFont != NULL)
	{
		if (XTPSystemVersion()->IsWin95())
			PostMessage(WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
		else
			SendMessage(WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
	}
}
Exemplo n.º 2
0
void CXTPEditListBoxToolBar::Initialize(bool bAutoFont/*= true*/)
{
	// Create the ToolTip control.
	m_tooltip.Create(this);
	m_tooltip.Activate(TRUE);

	CImageList imageList;
	imageList.Create(14, 12, ILC_COLOR8 | ILC_MASK, 0, 1);

	CBitmap bmp;
	CXTPResourceManager::AssertValid(XTPResourceManager()->LoadBitmap(&bmp, XTP_IDB_LISTEDIT));
	imageList.Add(&bmp, RGB(255, 0, 255));

	for (int i = 0; i < _countof(m_arButton); ++i)
	{
		if ((!m_bShowNewDeleteButtons) && ((i==0) || (i==1)))
			continue;

		if ((!m_bShowUpDownButtons) && ((i==2) || (i==3)))
			continue;

		if (!m_arButton[i].Create(NULL, WS_CHILD | WS_VISIBLE | BS_ICON | BS_CENTER | BS_VCENTER,
			CRect(0, 0, 0, 0), this, _arButtonID[i]))
		{
			TRACE0("Unable to create edit button.\n");
			continue;
		}

		m_arIcon[i] = imageList.ExtractIcon(i);
		m_arButton[i].SetIcon(CSize(0), m_arIcon[i]);

		CString strToolTip;
		CXTPResourceManager::AssertValid(XTPResourceManager()->LoadString(&strToolTip, _arButtonID[i]));
		// Add tooltips to group buttons.
		m_tooltip.AddTool(&m_arButton[i], strToolTip);

		// make sure the button is Windows XP theme compatible using
		// the toolbar button theme.
		if (m_arButton[i].SetTheme(xtpControlThemeFlat))
		{
			CXTPButtonTheme* pTheme = m_arButton[i].GetTheme();
			if (pTheme)
			{
				pTheme->EnableToolbarStyle(TRUE);
			}
			m_arButton[i].SetUseVisualStyle(TRUE);
		}
	}

	// Move the buttons to their correct location.
	MoveButtons();

	// Set the font for this window.
	if (bAutoFont)
	{
		SetFont(&XTPAuxData().font);
	}
}
int CXTFlatComboBoxTheme::GetDropArrowWidth() const
{
	TEXTMETRIC tm;

	CWindowDC dc(NULL);
	CXTPFontDC fontDC(&dc, &XTPAuxData().font);
	dc.GetTextMetrics(&tm);

	int nThumbWidth = __max(15, tm.tmAveCharWidth * 2 + 4);

	return min(nThumbWidth, GetSystemMetrics(SM_CXVSCROLL) + 1);

}
Exemplo n.º 4
0
void CXTPPropertyPageStaticCaption::OnPaint()
{
	CPaintDC dcPaint(this);
	CXTPBufferDC dc(dcPaint);
	CXTPClientRect rc(this);

	dc.FillSolidRect(rc, RGB(221, 231, 238));
	dc.FillSolidRect(rc.left, rc.bottom - 1, rc.Width(), 1, RGB(197, 197, 197));
	rc.DeflateRect(7, 0);

	CString strText;
	GetWindowText(strText);

	dc.SetBkMode(TRANSPARENT);
	dc.SetTextColor(RGB(0, 21, 110));
	CXTPFontDC font(&dc, &XTPAuxData().fontBold);
	dc.DrawText(strText, rc, DT_VCENTER | DT_SINGLELINE);
}
Exemplo n.º 5
0
void CXTPHeaderCtrl::SetFontBold(BOOL bBoldFont)
{
	ASSERT(::IsWindow(m_hWnd));
	SetFont(bBoldFont ? &XTPAuxData().fontBold : &XTPAuxData().font);
}
Exemplo n.º 6
0
void CXTPHeaderCtrl::InitializeHeader(BOOL bBoldFont)
{
	SetFont(bBoldFont ? &XTPAuxData().fontBold : &XTPAuxData().font);
	RedrawWindow();
}