// ModifyDE.cpp : implementation file // #include "stdafx.h" #include "dicomapp.h" #include "ModifyDE.h" ///////////////////////////////////////////////////////////////////////////// // CDicomModifyElementDlg dialog CDicomModifyElementDlg::CDicomModifyElementDlg(CWnd* pParent /*=NULL*/) : CDialog(CDicomModifyElementDlg::IDD, pParent) { //{{AFX_DATA_INIT(CDicomModifyElementDlg) //}}AFX_DATA_INIT m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CDicomModifyElementDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDicomModifyElementDlg) DDX_Control(pDX, IDC_VALUE, m_Value); DDX_Control(pDX, ID_MODIFY, m_Modify); DDX_Control(pDX, ID_DELETE, m_Delete); DDX_Control(pDX, ID_INSERT_BEFORE, m_InsertBefore); DDX_Control(pDX, ID_INSERT_AFTER, m_InsertAfter); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDicomModifyElementDlg, CDialog) //{{AFX_MSG_MAP(CDicomModifyElementDlg) ON_BN_CLICKED(ID_DELETE, OnDelete) ON_BN_CLICKED(ID_MODIFY, OnModify) ON_BN_CLICKED(ID_INSERT_AFTER, OnInsertAfter) ON_BN_CLICKED(ID_INSERT_BEFORE, OnInsertBefore) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDicomModifyElementDlg message handlers BOOL CDicomModifyElementDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon CString strText; pDICOMVR pVR; L_BOOL bMulti=FALSE; strText = "Value Representation: "; pVR = LDicomVR::Find(m_nVR); if (pVR != NULL) { strText += pVR->pszName; if ((pVR->nRestrict & VR_BINARY) || (pVR->nRestrict & VR_STRING)) { bMulti = TRUE; } } else { m_nVR = VR_UN; bMulti = TRUE; } SetDlgItemText(IDC_VR, strText); switch (m_nVR) { case VR_OB: case VR_UN: strText = "Hexadecimal"; break; case VR_SS: case VR_US: case VR_OW: case VR_SL: case VR_IS: case VR_UL: strText = "Integer"; break; case VR_AT: strText = "Group:Element\r\n(Group and Element should be hexadecimal words)"; break; case VR_FD: case VR_FL: case VR_DS: strText = "Float"; break; case VR_CS: case VR_SH: case VR_LO: case VR_AE: case VR_LT: case VR_ST: case VR_UI: case VR_UT: case VR_PN: if (bMulti != FALSE) { strText = "String"; } else { strText = "Text"; } break; case VR_AS: strText = "Number Reference\r\n(Reference = 'days' or 'weeks' or 'months' or 'years')"; break; case VR_DA: strText = "MM/DD/YYYY\r\n(MM=Month, DD=Day, YYYY=Year)"; break; case VR_DT: strText = "MM/DD/YYYY HH:MM:SS.FFFFFF+OOOO\r\n(MM=Month, DD=Day, YYYY=Year)\r\n(HH=Hours, MM=Minutes, SS=Seconds, FFFFFF=Fractional Second, OOOO=Offset from Coordinated Universal Time)"; break; case VR_TM: strText = "HH:MM:SS.FFFF\r\n(HH=Hours, MM=Minutes, SS=Seconds, FFFFFF=Fractional Second)"; break; default: strText = ""; break; } SetDlgItemText(IDC_TEXT, strText); SetDlgItemText(IDC_VALUE, m_strValue); if (m_nCount == 0) { m_Modify.EnableWindow(FALSE); m_Delete.EnableWindow(FALSE); m_InsertBefore.EnableWindow(FALSE); } else if (bMulti == FALSE) { m_InsertAfter.EnableWindow(FALSE); m_InsertBefore.EnableWindow(FALSE); m_Delete.EnableWindow(FALSE); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDicomModifyElementDlg::OnDelete() { m_nOperation = OPERATION_DELETE; CDialog::OnOK(); } void CDicomModifyElementDlg::OnModify() { m_nOperation = OPERATION_MODIFY; GetDlgItemText(IDC_VALUE, m_strValue); CDialog::OnOK(); } void CDicomModifyElementDlg::OnOK() { } void CDicomModifyElementDlg::OnInsertAfter() { m_nOperation = OPERATION_INSERT_AFTER; GetDlgItemText(IDC_VALUE, m_strValue); CDialog::OnOK(); } void CDicomModifyElementDlg::OnInsertBefore() { m_nOperation = OPERATION_INSERT_BEFORE; GetDlgItemText(IDC_VALUE, m_strValue); CDialog::OnOK(); }