- // AVIStatusView.cpp : implementation of the CAVIStatusView class
- //
- #include "stdafx.h"
- #include "AVIStatus.h"
- #include "AVIStatusDoc.h"
- #include "AVIStatusView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView
- IMPLEMENT_DYNCREATE(CAVIStatusView, CView)
- BEGIN_MESSAGE_MAP(CAVIStatusView, CView)
- //{{AFX_MSG_MAP(CAVIStatusView)
- ON_COMMAND(ID_VIEWSTATUSBAR, OnViewStatusBar)
- //}}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()
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView construction/destruction
- CAVIStatusView::CAVIStatusView()
- {
- // TODO: add construction code here
- }
- CAVIStatusView::~CAVIStatusView()
- {
- }
- BOOL CAVIStatusView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CView::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView drawing
- void CAVIStatusView::OnDraw(CDC* pDC)
- {
- CAVIStatusDoc* pDoc = GetDocument();
- ASSERT_VALID(pDoc);
- // TODO: add draw code for native data here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView printing
- BOOL CAVIStatusView::OnPreparePrinting(CPrintInfo* pInfo)
- {
- // default preparation
- return DoPreparePrinting(pInfo);
- }
- void CAVIStatusView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add extra initialization before printing
- }
- void CAVIStatusView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
- {
- // TODO: add cleanup after printing
- }
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView diagnostics
- #ifdef _DEBUG
- void CAVIStatusView::AssertValid() const
- {
- CView::AssertValid();
- }
- void CAVIStatusView::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- CAVIStatusDoc* CAVIStatusView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAVIStatusDoc)));
- return (CAVIStatusDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CAVIStatusView message handlers
- #include "mainfrm.h"
- void CAVIStatusView::OnViewStatusBar()
- {
- //得到父窗口框架
- CMainFrame *mainfrm=(CMainFrame *)GetParentFrame();
- //得到组合列表框当前选项
- int cursel=mainfrm->m_wndStatusBar.m_ComboBox.GetCurSel();
- CString sel;
- mainfrm->m_wndStatusBar.m_ComboBox.GetLBText(cursel, sel);
- AfxMessageBox( sel);
- }