📄 selestationdlg.cpp
字号:
// Written by JHCC, 1997
// SeleStationDlg.cpp : implementation file
//
#include "stdafx.h"
#include "JHHB.h"
#include "SeleStationDlg.h"
#include "JHHBDoc.h"
#include "JHHBView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSeleStationDlg dialog
CSeleStationDlg::CSeleStationDlg(CCtrlInfoArray* pCtrlInfoArray, CWnd* pParent /*=NULL*/)
: CDialog(CSeleStationDlg::IDD, pParent)
{
m_pCtrlInfoArray = pCtrlInfoArray;
//{{AFX_DATA_INIT(CSeleStationDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CSeleStationDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSeleStationDlg)
DDX_Control(pDX, IDC_STATIONLIST, m_stationList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSeleStationDlg, CDialog)
//{{AFX_MSG_MAP(CSeleStationDlg)
ON_CBN_DBLCLK(IDC_STATIONLIST, OnOK)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSeleStationDlg message handlers
//#include "CtrlInfo.h"
BOOL CSeleStationDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// CDocument* pActiveDoc = GetParentFrame()->GetActiveDocument();
// POSITION pos = pActiveDoc->GetFirstViewPosition();
// CJHHBView* pView = (CJHHBView*)(pActiveDoc->GetNextView(pos));
// CCtrlInfoArray* pCtrlInfoArray = &(pView->m_ctrlInfoArray);
m_stationList.ResetContent();
for (int n = 0; n < m_pCtrlInfoArray->GetSize(); ++ n)
{
if (m_pCtrlInfoArray->GetAt(n)->m_bActive == TRUE)
m_stationList.AddString(m_pCtrlInfoArray->GetAt(n)->GetStationName());
}
m_stationList.SetCurSel(0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSeleStationDlg::OnOK()
{
// CDocument* pActiveDoc = GetParentFrame()->GetActiveDocument();
// POSITION pos = pActiveDoc->GetFirstViewPosition();
// CJHHBView* pView = (CJHHBView*)(pActiveDoc->GetNextView(pos));
// CCtrlInfoArray* pCtrlInfoArray = &(pView->m_ctrlInfoArray);
m_nSeleStation = m_pCtrlInfoArray->GetAt(m_pCtrlInfoArray->GetAt(m_stationList.GetCurSel())->m_nMapIndex)->m_NO;
CDialog::OnOK();
}
void CSeleStationDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -