Пример #1
0
void CInformationPanel::SetTheme(const TVTest::Theme::CThemeManager *pThemeManager)
{
	pThemeManager->GetStyle(TVTest::Theme::CThemeManager::STYLE_PANEL_CONTENT,
							&m_Theme.Style);
	pThemeManager->GetStyle(TVTest::Theme::CThemeManager::STYLE_INFORMATIONPANEL_EVENTINFO,
							&m_Theme.ProgramInfoStyle);
	pThemeManager->GetStyle(TVTest::Theme::CThemeManager::STYLE_INFORMATIONPANEL_BUTTON,
							&m_Theme.ButtonStyle);
	pThemeManager->GetStyle(TVTest::Theme::CThemeManager::STYLE_INFORMATIONPANEL_BUTTON_HOT,
							&m_Theme.ButtonHotStyle);

	if (m_hwnd!=NULL) {
		m_BackBrush.Create(m_Theme.Style.Back.Fill.GetSolidColor());
		m_ProgramInfoBackBrush.Create(m_Theme.ProgramInfoStyle.Back.Fill.GetSolidColor());

		Invalidate();

		if (m_hwndProgramInfo!=NULL) {
			if (m_fUseRichEdit) {
				::SendMessage(m_hwndProgramInfo,EM_SETBKGNDCOLOR,0,
							  (COLORREF)m_Theme.ProgramInfoStyle.Back.Fill.GetSolidColor());
				POINT ptScroll;
				::SendMessage(m_hwndProgramInfo,EM_GETSCROLLPOS,0,reinterpret_cast<LPARAM>(&ptScroll));
				UpdateProgramInfoText();
				::SendMessage(m_hwndProgramInfo,EM_SETSCROLLPOS,0,reinterpret_cast<LPARAM>(&ptScroll));
			}
			::InvalidateRect(m_hwndProgramInfo,NULL,TRUE);

			if (IsItemVisible(ITEM_PROGRAMINFO))
				SendSizeMessage();
		}
	}
}
Пример #2
0
bool CInformationPanel::CreateProgramInfoEdit()
{
	if (m_hwnd==NULL || m_hwndProgramInfo!=NULL)
		return false;

	if (m_fUseRichEdit) {
		m_RichEditUtil.LoadRichEditLib();
		m_hwndProgramInfo=::CreateWindowEx(0,m_RichEditUtil.GetWindowClassName(),TEXT(""),
			WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL
				| ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL | ES_NOHIDESEL,
			0,0,0,0,m_hwnd,reinterpret_cast<HMENU>(IDC_PROGRAMINFO),m_hinst,NULL);
		if (m_hwndProgramInfo==NULL)
			return false;
		::SendMessage(m_hwndProgramInfo,EM_SETEVENTMASK,0,ENM_MOUSEEVENTS | ENM_LINK);
		::SendMessage(m_hwndProgramInfo,EM_SETBKGNDCOLOR,0,
					  (COLORREF)m_Theme.ProgramInfoStyle.Back.Fill.GetSolidColor());
		m_fProgramInfoCursorOverLink=false;
	} else {
		m_hwndProgramInfo=::CreateWindowEx(0,TEXT("EDIT"),TEXT(""),
			WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL
				| ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL,
			0,0,0,0,m_hwnd,reinterpret_cast<HMENU>(IDC_PROGRAMINFO),m_hinst,NULL);
		if (m_hwndProgramInfo==NULL)
			return false;
		m_ProgramInfoSubclass.SetSubclass(m_hwndProgramInfo);
	}
	SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE);
	UpdateProgramInfoText();

	return true;
}
Пример #3
0
void CInformationPanel::RealizeStyle()
{
	if (m_hwnd!=NULL) {
		if (m_fUseRichEdit) {
			SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE);
			UpdateProgramInfoText();
		} else {
			SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),TRUE);
		}
		SendSizeMessage();
		Invalidate();
		m_Tooltip.SetFont(m_Font.GetHandle());
	}
}
Пример #4
0
bool CInformationPanel::SetFont(const LOGFONT *pFont)
{
	if (!m_Font.Create(pFont))
		return false;
	if (m_hwnd!=NULL) {
		CalcFontHeight();
		if (m_fUseRichEdit) {
			SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),FALSE);
			UpdateProgramInfoText();
		} else {
			SetWindowFont(m_hwndProgramInfo,m_Font.GetHandle(),TRUE);
		}
		SendSizeMessage();
		Invalidate();
	}
	return true;
}