www.pudn.com > JingXiang-Design-Jeff.rar > ForTimeSelect.cpp
// ForTimeSelect.cpp : implementation file
//
#include "stdafx.h"
#include "Design.h"
#include "ForTimeSelect.h"
#include "MainFrm.h"
#include "DesignDoc.h"
#include "DesignView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// ForTimeSelect dialog
ForTimeSelect::ForTimeSelect(CWnd* pParent /*=NULL*/)
: CDialog(ForTimeSelect::IDD, pParent)
{
//{{AFX_DATA_INIT(ForTimeSelect)
m_Times = 0;
//}}AFX_DATA_INIT
}
void ForTimeSelect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(ForTimeSelect)
DDX_Text(pDX, IDC_EDIT1, m_Times);
DDV_MinMaxInt(pDX, m_Times, 1, 10000);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(ForTimeSelect, CDialog)
//{{AFX_MSG_MAP(ForTimeSelect)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// ForTimeSelect message handlers
BOOL ForTimeSelect::OnInitDialog()
{
CDesignView *pDesignView;
CDesignDoc *pDoc;
CMainFrame* pMFrame=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
pDesignView=(CDesignView*)pMFrame->GetActiveView();
pDoc=pDesignView->GetDocument();
this->m_Times=pDesignView->pPara_Detect->DetectingTimes;
pSpin_=(CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2);
pSpin_->SetRange(1,10000);
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void ForTimeSelect::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if(pScrollBar->GetDlgCtrlID()==IDC_SPIN2)
{
m_Times=nPos;
UpdateData(FALSE);
}
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
void ForTimeSelect::OnOK()
{
CDesignView *pDesignView;
CDesignDoc *pDoc;
CMainFrame* pMFrame=(CMainFrame*)(AfxGetApp()->m_pMainWnd);
pDesignView=(CDesignView*)pMFrame->GetActiveView();
pDoc=pDesignView->GetDocument();
UpdateData(TRUE);
pDesignView->pPara_Detect->DetectingTimes=this->m_Times;
CDialog::OnOK();
}