⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configpage1.cpp

📁 MPEG4网络视频服务器客户端图象监控软件
💻 CPP
字号:
// ConfigPage1.cpp : implementation file
//

#include "stdafx.h"
#include "DvsUser.h"
#include "ConfigPage1.h"

#include "DvsUserDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

extern CDvsUserDlg*	g_User;
/////////////////////////////////////////////////////////////////////////////
// CConfigPage1 property page
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
IMPLEMENT_DYNCREATE(CConfigPage1, CPropertyPage)
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
CConfigPage1::CConfigPage1() : CPropertyPage(CConfigPage1::IDD)
{
	//{{AFX_DATA_INIT(CConfigPage1)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
CConfigPage1::~CConfigPage1()
{
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
void CConfigPage1::DoDataExchange(CDataExchange* pDX)
{
	CPropertyPage::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConfigPage1)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
BEGIN_MESSAGE_MAP(CConfigPage1, CPropertyPage)
	//{{AFX_MSG_MAP(CConfigPage1)
	ON_WM_CTLCOLOR()
	ON_BN_CLICKED(IDC_CONFIG_ALTER_COLOR, OnConfigAlterColor)
	ON_BN_CLICKED(IDC_CONFIG_NORMAL_COLOR, OnConfigNormalColor)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CConfigPage1 message handlers
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
HBRUSH CConfigPage1::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

	if(pWnd->GetDlgCtrlID() == IDC_CONFIG_NORMAL_COLOR)
	{
		HBRUSH hBkColor = ::CreateSolidBrush(m_crNormal);
		return hBkColor;
	}		

	if(pWnd->GetDlgCtrlID() == IDC_CONFIG_ALTER_COLOR)
	{
		HBRUSH hBkColor = ::CreateSolidBrush(m_crAlert);
		return hBkColor;
	}		

	return hbr;
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
void CConfigPage1::SetStaticColor(COLORREF crNormal, COLORREF crAlert)
{
	m_crNormal	= crNormal;
	m_crAlert	= crAlert;
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
BOOL CConfigPage1::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	m_crNormal	= g_User->m_view1_bar.GetNormal();
	m_crAlert	= g_User->m_view1_bar.GetAlert();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
void CConfigPage1::OnConfigAlterColor() 
{
	CColorDialog dlg(0, CC_FULLOPEN, this);
	if(IDOK == dlg.DoModal())
	{
		m_crAlert = dlg.GetColor();
		Invalidate();

		g_User->m_view1_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view2_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view3_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view4_bar.ChangeColor(m_crNormal, m_crAlert);
	}
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------
void CConfigPage1::OnConfigNormalColor() 
{
	CColorDialog dlg(0, CC_FULLOPEN, this);
	if(IDOK == dlg.DoModal())
	{
		m_crNormal = dlg.GetColor();
		Invalidate();

		g_User->m_view1_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view2_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view3_bar.ChangeColor(m_crNormal, m_crAlert);
		g_User->m_view4_bar.ChangeColor(m_crNormal, m_crAlert);
	}
	
}
//-------------------------------------------------------------------------
//
//
//
//-------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -