ListSimilarStrDlg.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:2k
源码类别:
交通/航空行业
开发平台:
Visual C++
- // ListSimilarStrDlg.cpp : implementation file
- //
- #include "stdafx.h"
- #include "gpssc.h"
- #include "ListSimilarStrDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CListSimilarStrDlg dialog
- CListSimilarStrDlg::CListSimilarStrDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CListSimilarStrDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CListSimilarStrDlg)
- m_sCaption = _T("");
- //}}AFX_DATA_INIT
- }
- CListSimilarStrDlg::CListSimilarStrDlg(CString arrStr[],int Total,CWnd* pParent /*=NULL*/)
- : CDialog(CListSimilarStrDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CListSimilarStrDlg)
- m_sCaption = _T("");
- //}}AFX_DATA_INIT
- int i;
- for(i = 0; i < Total; i ++) {
- m_arrStr[i] = arrStr[i];
- if(i >= 100) {
- break; ;
- }
- }
- m_arrLen = i;
- }
- void CListSimilarStrDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CListSimilarStrDlg)
- DDX_Control(pDX, IDC_SIMILAR_STR, m_ctlSimilarStr);
- DDX_Text(pDX, IDC_CAPTION, m_sCaption);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CListSimilarStrDlg, CDialog)
- //{{AFX_MSG_MAP(CListSimilarStrDlg)
- ON_LBN_DBLCLK(IDC_SIMILAR_STR, OnDblclkSimilarStr)
- ON_BN_CLICKED(IDOK, OnOK)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CListSimilarStrDlg message handlers
- BOOL CListSimilarStrDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- int i;
- for(i = 0; i < m_arrLen; i++) {
- m_ctlSimilarStr.AddString(m_arrStr[i]);
- }
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CListSimilarStrDlg::OnOK()
- {
- // TODO: Add extra validation here
- OnDblclkSimilarStr();
- // CDialog::OnOK();
- }
- void CListSimilarStrDlg::GetParent(CGpsDrawMap *pDrawMap)
- {
- m_pDrawMap = pDrawMap;
- }
- void CListSimilarStrDlg::OnDblclkSimilarStr()
- {
- // TODO: Add your control notification handler code here
- CString StrName("");
- m_ctlSimilarStr.GetText(m_ctlSimilarStr.GetCurSel(),StrName);
- if(StrName.IsEmpty()) return;
- m_pDrawMap->DrawSignByName(StrName);
- }