TaskingView.cpp
上传用户:z_mail1980
上传日期:2007-06-01
资源大小:647k
文件大小:3k
- // TaskingView.cpp : implementation of the CTaskingView class
- //
- #include "stdafx.h"
- #include "Tasking.h"
- #include "TaskingDoc.h"
- #include "TaskingView.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CTaskingView
- IMPLEMENT_DYNCREATE(CTaskingView, CFormView)
- BEGIN_MESSAGE_MAP(CTaskingView, CFormView)
- //{{AFX_MSG_MAP(CTaskingView)
- ON_BN_CLICKED(IDC_CBONIDLE1, OnCbonidle)
- ON_BN_CLICKED(IDC_CBTHREAD1, OnCbthread1)
- ON_BN_CLICKED(IDC_CBONIDLE2, OnCbonidle)
- ON_BN_CLICKED(IDC_CBTHREAD2, OnCbthread2)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CTaskingView construction/destruction
- CTaskingView::CTaskingView()
- : CFormView(CTaskingView::IDD)
- {
- //{{AFX_DATA_INIT(CTaskingView)
- m_bOnIdle2 = FALSE;
- m_bOnIdle1 = FALSE;
- m_bThread1 = FALSE;
- m_bThread2 = FALSE;
- //}}AFX_DATA_INIT
- // TODO: add construction code here
- }
- CTaskingView::~CTaskingView()
- {
- }
- void CTaskingView::DoDataExchange(CDataExchange* pDX)
- {
- CFormView::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CTaskingView)
- DDX_Check(pDX, IDC_CBONIDLE2, m_bOnIdle2);
- DDX_Check(pDX, IDC_CBONIDLE1, m_bOnIdle1);
- DDX_Check(pDX, IDC_CBTHREAD1, m_bThread1);
- DDX_Check(pDX, IDC_CBTHREAD2, m_bThread2);
- //}}AFX_DATA_MAP
- }
- BOOL CTaskingView::PreCreateWindow(CREATESTRUCT& cs)
- {
- // TODO: Modify the Window class or styles here by modifying
- // the CREATESTRUCT cs
- return CFormView::PreCreateWindow(cs);
- }
- void CTaskingView::OnInitialUpdate()
- {
- CFormView::OnInitialUpdate();
- GetParentFrame()->RecalcLayout();
- ResizeParentToFit();
- }
- /////////////////////////////////////////////////////////////////////////////
- // CTaskingView diagnostics
- #ifdef _DEBUG
- void CTaskingView::AssertValid() const
- {
- CFormView::AssertValid();
- }
- void CTaskingView::Dump(CDumpContext& dc) const
- {
- CFormView::Dump(dc);
- }
- CTaskingDoc* CTaskingView::GetDocument() // non-debug version is inline
- {
- ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTaskingDoc)));
- return (CTaskingDoc*)m_pDocument;
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CTaskingView message handlers
- void CTaskingView::OnCbonidle()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- }
- void CTaskingView::OnCbthread1()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- CTaskingDoc *pDocWnd=(CTaskingDoc*)GetDocument();
- ASSERT_VALID(pDocWnd);
- pDocWnd->SuspendSpinner(0,m_bThread1);
- }
- void CTaskingView::OnCbthread2()
- {
- // TODO: Add your control notification handler code here
- UpdateData(TRUE);
- CTaskingDoc *pDocWnd=(CTaskingDoc*)GetDocument();
- ASSERT_VALID(pDocWnd);
- pDocWnd->SuspendSpinner(1,m_bThread2);
- }