home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / DOCJET.ZIP / data.z / Settings.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-20  |  2.8 KB  |  116 lines

  1. // Settings.cpp : implementation file
  2. //
  3.  
  4. #include <afxwin.h>
  5. #undef IDC_STATIC
  6. #include "resource.h"
  7. #include "Settings.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CMfcdllApp
  17.  
  18. class CMfcdllApp : public CWinApp
  19. {
  20. public:
  21.     CMfcdllApp();
  22.  
  23. // Overrides
  24.     // ClassWizard generated virtual function overrides
  25.     //{{AFX_VIRTUAL(CMfcdllApp)
  26.     //}}AFX_VIRTUAL
  27.  
  28.     //{{AFX_MSG(CMfcdllApp)
  29.         // NOTE - the ClassWizard will add and remove member functions here.
  30.         //    DO NOT EDIT what you see in these blocks of generated code !
  31.     //}}AFX_MSG
  32.     DECLARE_MESSAGE_MAP()
  33. };
  34.  
  35. BEGIN_MESSAGE_MAP(CMfcdllApp, CWinApp)
  36.     //{{AFX_MSG_MAP(CMfcdllApp)
  37.         // NOTE - the ClassWizard will add and remove mapping macros here.
  38.         //    DO NOT EDIT what you see in these blocks of generated code!
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CMfcdllApp construction
  44.  
  45. CMfcdllApp::CMfcdllApp()
  46. {
  47.     // TODO: add construction code here,
  48.     // Place all significant initialization in InitInstance
  49. }
  50.  
  51. /////////////////////////////////////////////////////////////////////////////
  52. // The one and only CMfcdllApp object
  53.  
  54. CMfcdllApp theApp;
  55.  
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CSettings dialog
  58.  
  59.  
  60. CSettings::CSettings(CWnd* pParent /*=NULL*/)
  61.     : CDialog(CSettings::IDD, pParent)
  62. {
  63.     //{{AFX_DATA_INIT(CSettings)
  64.     m_arg_sections = _T("");
  65.     m_other_sections = _T("");
  66.     m_input_arg_sections = _T("");
  67.     m_output_arg_sections = _T("");
  68.     //}}AFX_DATA_INIT
  69. }
  70.  
  71.  
  72. void CSettings::DoDataExchange(CDataExchange* pDX)
  73. {
  74.     CDialog::DoDataExchange(pDX);
  75.     //{{AFX_DATA_MAP(CSettings)
  76.     DDX_Text(pDX, IDC_ARGS, m_arg_sections);
  77.     DDX_Text(pDX, IDC_OTHERS, m_other_sections);
  78.     DDX_Text(pDX, IDC_INPUT_ARGS, m_input_arg_sections);
  79.     DDX_Text(pDX, IDC_OUTPUT_ARGS, m_output_arg_sections);
  80.     //}}AFX_DATA_MAP
  81. }
  82.  
  83.  
  84. BEGIN_MESSAGE_MAP(CSettings, CDialog)
  85.     //{{AFX_MSG_MAP(CSettings)
  86.     //}}AFX_MSG_MAP
  87. END_MESSAGE_MAP()
  88.  
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CSettings message handlers
  91.  
  92. void CSettings::OnOK() 
  93. {
  94.     UpdateData();
  95.  
  96.     if ( strspn( m_other_sections, "\r\n ," ) == (unsigned)m_other_sections.GetLength() ) {
  97.         MessageBox( "You must enter at least one non-argument section header",
  98.                 "Error", MB_ICONERROR | MB_OK );
  99.         return;
  100.     }
  101.  
  102.     // TODO: Verify that a section isn't listed in more than one section.
  103.  
  104.     CDialog::OnOK();
  105. }
  106.  
  107. BOOL CSettings::OnInitDialog() 
  108. {
  109.     CDialog::OnInitDialog();
  110.     
  111.     UpdateData( FALSE );
  112.  
  113.     return TRUE;  // return TRUE unless you set the focus to a control
  114.                   // EXCEPTION: OCX Property Pages should return FALSE
  115. }
  116.