?? dlgbarview.cpp
字號(hào):
// DlgBarView.cpp : implementation of the CDlgBarView class
//
#include "stdafx.h"
#include "DlgBar.h"
#include "DlgBarDoc.h"
#include "DlgBarView.h"
#include "MainFrm.h" //必須位于前兩頭文件之后
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView
IMPLEMENT_DYNCREATE(CDlgBarView, CView)
BEGIN_MESSAGE_MAP(CDlgBarView, CView)
//{{AFX_MSG_MAP(CDlgBarView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}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)
ON_EN_CHANGE(IDC_EDIT1,OnChangeDlgEdit)
ON_LBN_SELCHANGE(IDC_COMBO1,OnChanngeDlgCom)
ON_BN_CLICKED(IDC_BUTTON1,OnButton)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView construction/destruction
CDlgBarView::CDlgBarView()
{
// TODO: add construction code here
}
CDlgBarView::~CDlgBarView()
{
}
BOOL CDlgBarView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView drawing
void CDlgBarView::OnDraw(CDC* pDC)
{
CDlgBarDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView printing
BOOL CDlgBarView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CDlgBarView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CDlgBarView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView diagnostics
#ifdef _DEBUG
void CDlgBarView::AssertValid() const
{
CView::AssertValid();
}
void CDlgBarView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CDlgBarDoc* CDlgBarView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CDlgBarDoc)));
return (CDlgBarDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDlgBarView message handlers
void CDlgBarView::OnChangeDlgEdit()
{
AfxMessageBox("編輯內(nèi)容改變");
}
void CDlgBarView::OnChanngeDlgCom()
{ CString ss;
CMainFrame *p_Wnd=(CMainFrame *)(AfxGetApp()->m_pMainWnd);
CComboBox *p_com=(CComboBox *)p_Wnd->m_wndDlgBar.GetDlgItem(IDC_COMBO1);
p_com->GetLBText(p_com->GetCurSel(),ss);
AfxMessageBox(ss);
}
void CDlgBarView::OnButton()
{ CClientDC dc(this);
dc.TextOut(100,100,"按下按鈕");
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -