📄 testnetview.cpp
字号:
// testnetView.cpp : implementation of the CTestnetView class
//
#include "stdafx.h"
#include "testnet.h"
#include "ClientDlg.h"
#include "testnetDoc.h"
#include "testnetView.h"
#include "ServerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTestnetView
IMPLEMENT_DYNCREATE(CTestnetView, CView)
BEGIN_MESSAGE_MAP(CTestnetView, CView)
//{{AFX_MSG_MAP(CTestnetView)
ON_COMMAND(ID_LISTEN, OnListen)
ON_COMMAND(IDC_CONNECT, OnConnect)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestnetView construction/destruction
CTestnetView::CTestnetView()
{
// TODO: add construction code here
}
CTestnetView::~CTestnetView()
{
}
BOOL CTestnetView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CTestnetView drawing
void CTestnetView::OnDraw(CDC* pDC)
{
CTestnetDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CTestnetView printing
BOOL CTestnetView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CTestnetView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CTestnetView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CTestnetView diagnostics
#ifdef _DEBUG
void CTestnetView::AssertValid() const
{
CView::AssertValid();
}
void CTestnetView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CTestnetDoc* CTestnetView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTestnetDoc)));
return (CTestnetDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CTestnetView message handlers
void CTestnetView::OnListen()
{
//CServerDlg dlg;
//dlg.DoModal ();
CServerDlg *Sdlg=new CServerDlg;
Sdlg->Create (IDD_DIALOG1,NULL);
Sdlg->ShowWindow (SW_SHOW);
}
void CTestnetView::OnConnect()
{
//CClientDlg dlg;
//dlg.DoModal ();
CClientDlg *Cdlg=new CClientDlg;
Cdlg->Create(IDD_DIALOG2,NULL);
Cdlg->ShowWindow(SW_SHOW);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -