// PSPDlg.cpp : implementation file // #include "stdafx.h" #include "cldprn32.h" #include "PSPDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPullStoredPrintParametersDlg dialog CPullStoredPrintParametersDlg::CPullStoredPrintParametersDlg(CWnd* pParent /*=NULL*/) : CDialog(CPullStoredPrintParametersDlg::IDD, pParent), m_iIllumination(-1), m_iReflectedAmbientLight(-1), m_ColorImagePrintingFlagChkBox(IDC_COMBO_COLORIMAGEPRINTINGFLAG), m_CollationFlagChkBox(IDC_COMBO_COLLATIONFLAG), m_AnnotationFlagChkBox(IDC_COMBO_ANNOTATIONFLAG), m_ImageOverlayFlagChkBox(IDC_COMBO_IMAGEOVERLAYFLAG), m_PresentationLUTFlagChkBox(IDC_COMBO_PRESENTATIONLUTFLAG), m_ImageBoxPresentationLUTFlagChkBox(IDC_COMBO_IMAGEBOXPRESENTATIONLUTFLAG), m_ConfigurationInformationChkBox(IDC_EDIT_CONFIGURATIONINFORMATION), m_IlluminationChkBox(IDC_EDIT_ILLUMINATION), m_ReflectedAmbientLightChkBox(IDC_EDIT_REFLECTEDAMBIENTLIGHT) { //{{AFX_DATA_INIT(CPullStoredPrintParametersDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CPullStoredPrintParametersDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPullStoredPrintParametersDlg) DDX_Control(pDX, IDC_COMBO_IMAGEBOXPRESENTATIONLUTFLAG, m_ImageBoxPresentationLUTFlagCombo); DDX_Control(pDX, IDC_COMBO_PRESENTATIONLUTFLAG, m_PresentationLUTFlagCombo); DDX_Control(pDX, IDC_COMBO_IMAGEOVERLAYFLAG, m_ImageOverlayFlagCombo); DDX_Control(pDX, IDC_COMBO_ANNOTATIONFLAG, m_AnnotationFlagCombo); DDX_Control(pDX, IDC_COMBO_COLLATIONFLAG, m_CollationFlagCombo); DDX_Control(pDX, IDC_COMBO_COLORIMAGEPRINTINGFLAG, m_ColorImagePrintingFlagCombo); DDX_Control(pDX, IDC_CHECK_COLORIMAGEPRINTINGFLAG, m_ColorImagePrintingFlagChkBox); DDX_Control(pDX, IDC_CHECK_COLLATIONFLAG, m_CollationFlagChkBox); DDX_Control(pDX, IDC_CHECK_ANNOTATIONFLAG, m_AnnotationFlagChkBox); DDX_Control(pDX, IDC_CHECK_IMAGEOVERLAYFLAG, m_ImageOverlayFlagChkBox); DDX_Control(pDX, IDC_CHECK_PRESENTATIONLUTFLAG, m_PresentationLUTFlagChkBox); DDX_Control(pDX, IDC_CHECK_IMAGEBOXPRESENTATIONLUTFLAG, m_ImageBoxPresentationLUTFlagChkBox); DDX_Control(pDX, IDC_CHECK_CONFIGURATIONINFORMATION, m_ConfigurationInformationChkBox); DDX_Control(pDX, IDC_CHECK_ILLUMINATION, m_IlluminationChkBox); DDX_Control(pDX, IDC_CHECK_REFLECTEDAMBIENTLIGHT, m_ReflectedAmbientLightChkBox); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPullStoredPrintParametersDlg, CDialog) //{{AFX_MSG_MAP(CPullStoredPrintParametersDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() void CPullStoredPrintParametersDlg::InitializeFields() { // Color Image Printing Flag m_ColorImagePrintingFlagCombo.AddString(TEXT("BESTFIT")); m_ColorImagePrintingFlagCombo.AddString(TEXT("REJECT")); m_ColorImagePrintingFlagCombo.SetCurSel(0); m_ColorImagePrintingFlagCombo.SelectString(-1, m_sColorImagePrintingFlag); // Collation Flag m_CollationFlagCombo.AddString(TEXT("YES")); m_CollationFlagCombo.AddString(TEXT("NO")); m_CollationFlagCombo.SetCurSel(0); m_CollationFlagCombo.SelectString(-1, m_sCollationFlag); // Annotation Flag m_AnnotationFlagCombo.AddString(TEXT("BESTFIT")); m_AnnotationFlagCombo.AddString(TEXT("REJECT")); m_AnnotationFlagCombo.SetCurSel(0); m_AnnotationFlagCombo.SelectString(-1, m_sAnnotationFlag); // Image Overlay Flag m_ImageOverlayFlagCombo.AddString(TEXT("BESTFIT")); m_ImageOverlayFlagCombo.AddString(TEXT("REJECT")); m_ImageOverlayFlagCombo.SetCurSel(0); m_ImageOverlayFlagCombo.SelectString(-1, m_sImageOverlayFlag); // Presentation LUT Flag m_PresentationLUTFlagCombo.AddString(TEXT("BESTFIT")); m_PresentationLUTFlagCombo.AddString(TEXT("REJECT")); m_PresentationLUTFlagCombo.SetCurSel(0); m_PresentationLUTFlagCombo.SelectString(-1, m_sPresentationLUTFlag); // Image Box Presentation LUT Flag m_ImageBoxPresentationLUTFlagCombo.AddString(TEXT("BESTFIT")); m_ImageBoxPresentationLUTFlagCombo.AddString(TEXT("REJECT")); m_ImageBoxPresentationLUTFlagCombo.SetCurSel(0); m_ImageBoxPresentationLUTFlagCombo.SelectString(-1, m_sImageBoxPresentationLUTFlag); // Configuration Information SetDlgItemText(IDC_EDIT_CONFIGURATIONINFORMATION, m_sConfigurationInformation); // Illumination if (m_iIllumination >= 0) { SetDlgItemInt(IDC_EDIT_ILLUMINATION, m_iIllumination, FALSE); } // Reflected Ambient Light if (m_iReflectedAmbientLight >= 0) { SetDlgItemInt(IDC_EDIT_REFLECTEDAMBIENTLIGHT, m_iReflectedAmbientLight, FALSE); } } ///////////////////////////////////////////////////////////////////////////// // CPullStoredPrintParametersDlg message handlers BOOL CPullStoredPrintParametersDlg::OnInitDialog() { CDialog::OnInitDialog(); m_ColorImagePrintingFlagChkBox.Initialize(); m_CollationFlagChkBox.Initialize(); m_AnnotationFlagChkBox.Initialize(); m_ImageOverlayFlagChkBox.Initialize(); m_PresentationLUTFlagChkBox.Initialize(); m_ImageBoxPresentationLUTFlagChkBox.Initialize(); m_ConfigurationInformationChkBox.Initialize(); m_IlluminationChkBox.Initialize(); m_ReflectedAmbientLightChkBox.Initialize(); InitializeFields(); return TRUE; } void CPullStoredPrintParametersDlg::OnOK() { CString sValue; // Color Image Printing Flag m_ColorImagePrintingFlagCombo.GetWindowText(m_sColorImagePrintingFlag); // Collation Flag m_CollationFlagCombo.GetWindowText(m_sCollationFlag); // Annotation Flag m_AnnotationFlagCombo.GetWindowText(m_sAnnotationFlag); // Image Overlay Flag m_ImageOverlayFlagCombo.GetWindowText(m_sImageOverlayFlag); // Presentation LUT Flag m_PresentationLUTFlagCombo.GetWindowText(m_sPresentationLUTFlag); // Image Box Presentation LUT Flag m_ImageBoxPresentationLUTFlagCombo.GetWindowText(m_sImageBoxPresentationLUTFlag); // Configuration Information GetDlgItemText(IDC_EDIT_CONFIGURATIONINFORMATION, m_sConfigurationInformation); // Illumination GetDlgItemText(IDC_EDIT_ILLUMINATION, sValue); if (!m_IlluminationChkBox.m_bChecked && sValue.IsEmpty()) { m_iIllumination = -1; } else { m_iIllumination = atoi(sValue); } // Reflected Ambient Light GetDlgItemText(IDC_EDIT_REFLECTEDAMBIENTLIGHT, sValue); if (!m_ReflectedAmbientLightChkBox.m_bChecked && sValue.IsEmpty()) { m_iReflectedAmbientLight = -1; } else { m_iReflectedAmbientLight = atoi(sValue); } CDialog::OnOK(); } void CPullStoredPrintParametersDlg::OnCancel() { m_ColorImagePrintingFlagChkBox.m_bChecked = m_ColorImagePrintingFlagChkBox.m_bInitiallyChecked; m_CollationFlagChkBox.m_bChecked = m_CollationFlagChkBox.m_bInitiallyChecked; m_AnnotationFlagChkBox.m_bChecked = m_AnnotationFlagChkBox.m_bInitiallyChecked; m_ImageOverlayFlagChkBox.m_bChecked = m_ImageOverlayFlagChkBox.m_bInitiallyChecked; m_PresentationLUTFlagChkBox.m_bChecked = m_PresentationLUTFlagChkBox.m_bInitiallyChecked; m_ImageBoxPresentationLUTFlagChkBox.m_bChecked = m_ImageBoxPresentationLUTFlagChkBox.m_bInitiallyChecked; m_ConfigurationInformationChkBox.m_bChecked = m_ConfigurationInformationChkBox.m_bInitiallyChecked; m_IlluminationChkBox.m_bChecked = m_IlluminationChkBox.m_bInitiallyChecked; m_ReflectedAmbientLightChkBox.m_bChecked = m_ReflectedAmbientLightChkBox.m_bInitiallyChecked; CDialog::OnCancel(); }