// Disp2DRSPGrapDlg.cpp : implementation file // #include "stdafx.h" #include "geomative.h" #include "Disp2DRSPGrapDlg.h" #include "TdChannel.h" #include "Rsp2DTd.h" #include "Rsp2DTdRecord.h" #include "dispgrap2drsptdview.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern int g_iUILanguage; ///////////////////////////////////////////////////////////////////////////// // CDisp2DRSPGrapDlg dialog CDisp2DRSPGrapDlg::CDisp2DRSPGrapDlg(CRsp2DTd* const pRsp2DTd, CWnd* pParent /*= NULL*/) : CDialog(CDisp2DRSPGrapDlg::IDD, pParent) { m_pRsp2DTd = pRsp2DTd; m_pDispGrap2DRSPTdView = NULL; } CDisp2DRSPGrapDlg::CDisp2DRSPGrapDlg(CWnd* pParent /*=NULL*/) : CDialog(CDisp2DRSPGrapDlg::IDD, pParent) { //{{AFX_DATA_INIT(CDisp2DRSPGrapDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_pDispGrap2DRSPTdView = NULL; } void CDisp2DRSPGrapDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDisp2DRSPGrapDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDisp2DRSPGrapDlg, CDialog) //{{AFX_MSG_MAP(CDisp2DRSPGrapDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDisp2DRSPGrapDlg message handlers BOOL CDisp2DRSPGrapDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here int iChIndex = (int)VAL_ZERO; int iIndex = (int)VAL_ZERO; CTdChannel* pTdChannel = NULL; CRect rectClient; DWORD dwStyle = AFX_WS_DEFAULT_VIEW; iChIndex = (int)VAL_ZERO; while (iChIndex < m_pRsp2DTd->m_tdChaList.GetCount()) { pTdChannel = NULL; pTdChannel = (CTdChannel*)(m_pRsp2DTd->m_tdChaList.GetAt(m_pRsp2DTd->m_tdChaList.FindIndex(iChIndex))); if (pTdChannel != NULL) { pTdChannel->SetColorToTd(); } iChIndex++; } //如果是边缘梯度则不支持剖面图显示 if (AR_EDGE_GARDIENT == pTdChannel->m_pMedium->m_iAR || AR_BIPOLE_HOLE_SPT == pTdChannel->m_pMedium->m_iAR || AR_DOUBLE_SIZE_3P == pTdChannel->m_pMedium->m_iAR || AR_CUSTOM_2D_TYPE == pTdChannel->m_pMedium->m_iAR || AR_MID_GARDIENT_SCAN == pTdChannel->m_pMedium->m_iAR) { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("不支持.")); else MessageBoxEx(NULL, _T("Not support."), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); SendMessage(WM_CLOSE); return FALSE; } CRuntimeClass* pClass = (CRuntimeClass*)RUNTIME_CLASS(CDispGrap2DRSPTdView); m_pDispGrap2DRSPTdView = (CDispGrap2DRSPTdView*)pClass->CreateObject(); rectClient.SetRectEmpty(); this->GetClientRect(rectClient); m_pDispGrap2DRSPTdView->m_pTdChannel = pTdChannel; m_pDispGrap2DRSPTdView->SetValidPole(m_pRsp2DTd->m_iStartPole,m_pRsp2DTd->m_iEndPole); m_pDispGrap2DRSPTdView->Create(NULL, NULL, dwStyle, rectClient, this, CDisp2DRSPGrapDlg::IDD); m_pDispGrap2DRSPTdView->OnInitialUpdate(); m_pDispGrap2DRSPTdView->EnableWindow(TRUE); m_pDispGrap2DRSPTdView->ShowWindow(SW_SHOW); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } BOOL CDisp2DRSPGrapDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN) { return TRUE; } if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ESCAPE) { return TRUE; } return CDialog::PreTranslateMessage(pMsg); }