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

📄 diagview.cpp

📁 一个网络监视的程序
💻 CPP
字号:
// DiagView.cpp : implementation file
//

#include "stdafx.h"
#include "CCAMS.h"
#include "DiagView.h"
#include "MainFrm.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDiagView

IMPLEMENT_DYNCREATE(CDiagView, CFormView)

CDiagView::CDiagView()
	: CFormView(CDiagView::IDD)
{
	//{{AFX_DATA_INIT(CDiagView)
	//}}AFX_DATA_INIT
}

CDiagView::~CDiagView()
{
}

void CDiagView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDiagView)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDiagView, CFormView)
	//{{AFX_MSG_MAP(CDiagView)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDiagView diagnostics

#ifdef _DEBUG
void CDiagView::AssertValid() const
{
	CFormView::AssertValid();
}

void CDiagView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}

CCCAMSDoc* CDiagView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CCCAMSDoc)));
	return (CCCAMSDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CDiagView message handlers

void CDiagView::OnInitialUpdate() 
{
//	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CRect Rect;
	GetDlgItem(IDC_CLPLOT)->GetClientRect(&Rect); 

	m_Plot.Create(WS_CHILD|WS_VISIBLE, Rect, GetDlgItem(IDC_CLPLOT), 12000);
	m_Plot.SetSerie(0, PS_SOLID, RGB(255,0,0), 0.0, 900.0, "Chenhuan");
	m_Plot.SetLegend(0, PS_SOLID, RGB(255,0,0), "Temperature");

	m_Plot.m_bAutoScrollX = TRUE;

//	MessageBox("CDiagView::OnInitialUpdate()");

//	m_spinRefTime.SetRange(0, 30);
//	m_spinRefTime.SetBuddy(pEdit);

}

void CDiagView::OnSize(UINT nType, int cx, int cy) 
{
//	CFormView::OnSize(nType, cx, cy);
	
	// TODO: Add your message handler code here
	this->ShowWindow(SW_MAXIMIZE);
	
	// 列表列表控件必须是第一个控件
	CWnd *pchild = this->GetWindow(GW_CHILD); //Identifies the CWnd first child window
	if (pchild != NULL)
	{
		CRect rect;
		this->GetClientRect(&rect);
		pchild->ScreenToClient(&rect);
		pchild->SetWindowPos(NULL, 0, 0, rect.Width(), rect.Height(),
							SWP_NOZORDER | SWP_NOACTIVATE);
	}
	
}

void CDiagView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint) 
{
	// TODO: Add your specialized code here and/or call the base class
	CMainFrame *pWnd = (CMainFrame *)AfxGetMainWnd( );
	CString strContent;
	pWnd->m_wndCategory.GetWindowText(strContent);
//	AfxMessageBox(strContent);
	
}

⌨️ 快捷键说明

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