a
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
// disptdrecsplinesgrapdlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "geomative.h"
|
||||
#include "disptdrecsplinesgrapdlg.h"
|
||||
|
||||
#include "disptdrecsplinesgrapview.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDispTdRecSplinesGrapDlg dialog
|
||||
|
||||
CDispTdRecSplinesGrapDlg::CDispTdRecSplinesGrapDlg(CStringArray &saOrgData, float fMaxAbsV, CWnd* pParent)
|
||||
: CDialog(CDispTdRecSplinesGrapDlg::IDD, pParent)
|
||||
{
|
||||
m_saOrgData.RemoveAll();
|
||||
m_saOrgData.Copy(saOrgData);
|
||||
m_fMaxAbsV = fMaxAbsV;
|
||||
}
|
||||
|
||||
CDispTdRecSplinesGrapDlg::CDispTdRecSplinesGrapDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CDispTdRecSplinesGrapDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CDispTdRecSplinesGrapDlg)
|
||||
// NOTE: the ClassWizard will add member initialization here
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CDispTdRecSplinesGrapDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CDispTdRecSplinesGrapDlg)
|
||||
DDX_Control(pDX, IDC_LIST_DISP_ORGDATA, m_orgList);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDispTdRecSplinesGrapDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CDispTdRecSplinesGrapDlg)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CDispTdRecSplinesGrapDlg message handlers
|
||||
|
||||
BOOL CDispTdRecSplinesGrapDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
CRect rectClient;
|
||||
DWORD dwStyle = AFX_WS_DEFAULT_VIEW;
|
||||
int iIndex = (int)VAL_ZERO;
|
||||
|
||||
CString strColTitle = _T("");
|
||||
CString szLabel = _T("");
|
||||
|
||||
m_orgList.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP
|
||||
| LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES);
|
||||
|
||||
// strColTitle.Empty();
|
||||
// strColTitle.LoadString(IDS_DB_SCON_CN);
|
||||
m_orgList.InsertColumn(0, strColTitle, LVCFMT_LEFT, 30);
|
||||
m_orgList.InsertColumn(1, strColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
iIndex = 4;
|
||||
|
||||
while (iIndex <= this->m_saOrgData.GetUpperBound())
|
||||
{
|
||||
szLabel.Empty();
|
||||
szLabel.Format(_T("%d"), iIndex - 3);
|
||||
|
||||
this->m_orgList.InsertItem(iIndex - 4, szLabel);
|
||||
this->m_orgList.SetItemText(iIndex - 4, 1, this->m_saOrgData.GetAt(iIndex));
|
||||
iIndex++;
|
||||
}
|
||||
|
||||
CWnd *pStatic = GetDlgItem(IDC_STATIC_FRAME);
|
||||
|
||||
pStatic->GetWindowRect(&rectClient);
|
||||
pStatic->DestroyWindow();
|
||||
|
||||
this->ScreenToClient(&rectClient);
|
||||
|
||||
CRuntimeClass* pClass = (CRuntimeClass*)RUNTIME_CLASS(CDispTdRecSplinesGrapView);
|
||||
|
||||
m_pDispTdRecSplinesGrapView = (CDispTdRecSplinesGrapView*)pClass->CreateObject();
|
||||
|
||||
m_pDispTdRecSplinesGrapView->Create(NULL, NULL, dwStyle, rectClient, this, CDispTdRecSplinesGrapDlg::IDD);
|
||||
|
||||
m_pDispTdRecSplinesGrapView->m_saOrgData.RemoveAll();
|
||||
m_pDispTdRecSplinesGrapView->m_saOrgData.Copy(this->m_saOrgData);
|
||||
m_pDispTdRecSplinesGrapView->m_fMaxAbsV = this->m_fMaxAbsV;
|
||||
|
||||
m_pDispTdRecSplinesGrapView->OnInitialUpdate();
|
||||
m_pDispTdRecSplinesGrapView->EnableWindow(TRUE);
|
||||
m_pDispTdRecSplinesGrapView->ShowWindow(SW_SHOW);
|
||||
m_pDispTdRecSplinesGrapView->Invalidate();
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// EXCEPTION: OCX Property Pages should return FALSE
|
||||
}
|
||||
|
||||
BOOL CDispTdRecSplinesGrapDlg::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);
|
||||
}
|
||||
Reference in New Issue
Block a user