Exemplo n.º 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();
		}
	}
}
Exemplo n.º 2
0
void CCaptureWindow::ShowStatusBar(bool fShow)
{
    if (m_fShowStatusBar!=fShow) {
        m_fShowStatusBar=fShow;
        if (m_hwnd!=NULL) {
            SendSizeMessage();
            m_Status.SetVisible(fShow);
        }
    }
}
Exemplo n.º 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());
	}
}
Exemplo n.º 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;
}
Exemplo n.º 5
0
bool CInformationPanel::SetProgramInfoRichEdit(bool fRichEdit)
{
	if (fRichEdit!=m_fUseRichEdit) {
		if (m_hwndProgramInfo!=NULL) {
			::DestroyWindow(m_hwndProgramInfo);
			m_hwndProgramInfo=NULL;
		}
		m_fUseRichEdit=fRichEdit;
		if (m_hwnd!=NULL) {
			CreateProgramInfoEdit();
			SendSizeMessage();
			if (IsItemVisible(ITEM_PROGRAMINFO))
				::ShowWindow(m_hwndProgramInfo,SW_SHOW);
		}
	}

	return true;
}
Exemplo n.º 6
0
void CSideBar::RealizeStyle()
{
	if (m_hwnd!=NULL) {
		RECT rc;
		GetPosition(&rc);
		const int OldBarWidth=m_fVertical ? rc.right-rc.left : rc.bottom-rc.top;
		SendSizeMessage();
		Invalidate();

		if (m_Tooltip.IsCreated())
			SetTooltipFont();

		if (m_pEventHandler!=NULL) {
			m_pEventHandler->OnStyleChanged();
			const int NewBarWidth=GetBarWidth();
			if (OldBarWidth!=NewBarWidth)
				m_pEventHandler->OnBarWidthChanged(NewBarWidth);
		}
	}
}
Exemplo n.º 7
0
bool CInformationPanel::SetItemVisible(int Item,bool fVisible)
{
	CItem *pItem=GetItem(Item);

	if (pItem==NULL)
		return false;

	if (pItem->IsVisible()!=fVisible) {
		pItem->SetVisible(fVisible);

		if (m_hwnd!=NULL) {
			if (IsItemVisible(ITEM_PROGRAMINFO))
				SendSizeMessage();
			if (Item==ITEM_PROGRAMINFO)
				::ShowWindow(m_hwndProgramInfo,fVisible?SW_SHOW:SW_HIDE);
			::InvalidateRect(m_hwnd,NULL,TRUE);
		}
	}

	return true;
}