?? framesview.cpp
字號:
// FramesView.cpp : implementation file
//
#include "stdafx.h"
#include "VCStyle.h"
#include "FramesView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include "sja\\sjamacro.h"
#include "data.h"
/////////////////////////////////////////////////////////////////////////////
// CFramesView
IMPLEMENT_DYNCREATE(CFramesView, CEditView)
CFramesView::CFramesView()
{
m_nCount = 0;
}
CFramesView::~CFramesView()
{
}
BEGIN_MESSAGE_MAP(CFramesView, CEditView)
//{{AFX_MSG_MAP(CFramesView)
ON_MESSAGE(WM_RECEIVEFRAME,OnReceiveFrame)
ON_WM_CTLCOLOR_REFLECT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFramesView drawing
void CFramesView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CFramesView diagnostics
#ifdef _DEBUG
void CFramesView::AssertValid() const
{
CEditView::AssertValid();
}
void CFramesView::Dump(CDumpContext& dc) const
{
CEditView::Dump(dc);
}
CFramesDoc *CFramesView::GetDocument () // non-debug version is inline
{
ASSERT (m_pDocument->IsKindOf (RUNTIME_CLASS (CFramesDoc)));
return (CFramesDoc *) m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFramesView message handlers
LRESULT CFramesView::OnReceiveFrame(WPARAM w,LPARAM l)
{
int i;
CString tmp;
CFramesDoc* pDoc=GetDocument();
m_nCount++;
if(m_nCount>500){
pDoc->m_frames="";//太長了
m_nCount = 1;
}
for(i=0;i<FRAMELEN;i++){
tmp.Format("%2x ",RC_BUF[i]);
pDoc->m_frames += tmp;
}
CTime tm;
tm = CTime::GetCurrentTime();
tmp = tm.Format("\t\t%H小時,%M分,%S秒\r\n");
pDoc->m_frames += tmp;
SetWindowText(pDoc->m_frames);
GetEditCtrl().SetSel(pDoc->m_frames.GetLength()-1,pDoc->m_frames.GetLength()-1);
return 1;
}
void CFramesView::OnInitialUpdate()
{
CEditView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
GetEditCtrl().SetReadOnly();
CFramesDoc* pDoc=GetDocument();
ASSERT(pDoc);
SetWindowText(pDoc->m_frames);
GetEditCtrl().SetSel(pDoc->m_frames.GetLength()-1,pDoc->m_frames.GetLength()-1);
m_bkbrush.CreateSolidBrush(RGB(235,240,245));
}
HBRUSH CFramesView::CtlColor(CDC* pDC, UINT nCtlColor)
{
// TODO: Change any attributes of the DC here
return (HBRUSH)m_bkbrush;
// TODO: Return a non-NULL brush if the parent's handler should not be called
// return NULL;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -