// InEleDlg.cpp : implementation file // #include "stdafx.h" // #include "DICOM.h" // #include "InEleDlg.h" // #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CInsElementDlg dialog CInsElementDlg::CInsElementDlg(CWnd* pParent /*=NULL*/) : CDialog(CInsElementDlg::IDD, pParent) { //{{AFX_DATA_INIT(CInsElementDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT long m_lTagCode=0; BOOL m_bChild=TRUE; BOOL m_bSequence=FALSE; } void CInsElementDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CInsElementDlg) DDX_Control(pDX, IDC_COMBO1, m_Combo1); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CInsElementDlg, CDialog) //{{AFX_MSG_MAP(CInsElementDlg) ON_BN_CLICKED(IDC_CHECK1, OnCheck1) ON_BN_CLICKED(IDC_CHECK2, OnCheck2) ON_CBN_SELCHANGE(IDC_COMBO1, OnSelchangeCombo1) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CInsElementDlg message handlers BOOL CInsElementDlg::OnInitDialog() { CDialog::OnInitDialog(); long lCount; long x; CString szTag; CString szDisplay; CheckDlgButton(IDC_CHECK1, m_bChild ?TRUE:FALSE); CheckDlgButton(IDC_CHECK2, m_bSequence?TRUE:FALSE); m_pLEADDicomDS->EnableMethodErrors = FALSE; //init list boxes lCount = m_pLEADDicomDS->GetTagCount(); for(x=0; xFindIndexTag(x); pCurrentTag = m_pLEADDicomDS->GetCurrentTag(); szTag.Format("%04X:%04X", GETGROUP(pCurrentTag->GetCode()), GETELEMENT(pCurrentTag->GetCode())); CString cs = (LPCSTR)pCurrentTag->GetName(); szDisplay.Format("%s - %s", szTag, cs); m_Combo1.AddString(szDisplay); m_Combo1.SetItemData(m_Combo1.GetCount() - 1, pCurrentTag->GetCode()); } m_Combo1.SetCurSel(0); m_lTagCode = (long)m_Combo1.GetItemData(m_Combo1.GetCurSel()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CInsElementDlg::OnCheck1() { m_bChild = IsDlgButtonChecked(IDC_CHECK1); } void CInsElementDlg::OnCheck2() { m_bSequence = IsDlgButtonChecked(IDC_CHECK2); } void CInsElementDlg::OnSelchangeCombo1() { m_lTagCode = (long)m_Combo1.GetItemData(m_Combo1.GetCurSel()); }