home *** CD-ROM | disk | FTP | other *** search
/ Xentax forum attachments archive / xentax.7z / 8090 / ModelEdit.7z / CommandStringDlg.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2006-03-08  |  1.6 KB  |  67 lines

  1. // CommandStringDlg.cpp : implementation file
  2. //
  3.  
  4. #include "precompile.h"
  5. #include "modeledit.h"
  6. #include "commandstringdlg.h"
  7. #include "model_ops.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. // CCommandStringDlg dialog
  17.  
  18.  
  19. CCommandStringDlg::CCommandStringDlg(CWnd* pParent /*=NULL*/)
  20.     : CDialog(CCommandStringDlg::IDD, pParent)
  21. {
  22.     //{{AFX_DATA_INIT(CCommandStringDlg)
  23.         // NOTE: the ClassWizard will add member initialization here
  24.     //}}AFX_DATA_INIT
  25. }
  26.  
  27.  
  28. void CCommandStringDlg::DoDataExchange(CDataExchange* pDX)
  29. {
  30.     CDialog::DoDataExchange(pDX);
  31.     //{{AFX_DATA_MAP(CCommandStringDlg)
  32.     DDX_Control(pDX, IDC_COMMANDSTRING, m_CommandString);
  33.     //}}AFX_DATA_MAP
  34. }
  35.  
  36.  
  37. BEGIN_MESSAGE_MAP(CCommandStringDlg, CDialog)
  38.     //{{AFX_MSG_MAP(CCommandStringDlg)
  39.     //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CCommandStringDlg message handlers
  44.  
  45. void CCommandStringDlg::OnOK() 
  46. {
  47.     TCHAR theString[2000];
  48.  
  49.     m_CommandString.GetWindowText(theString, 2000);
  50.     m_pModel->m_CommandString = m_pModel->AddString(theString);
  51.     m_pModel->ParseCommandString();
  52.     
  53.     CDialog::OnOK();
  54. }
  55.  
  56. BOOL CCommandStringDlg::OnInitDialog() 
  57. {
  58.     CDialog::OnInitDialog();
  59.     
  60.     ASSERT(m_pModel);
  61.     if(m_pModel->m_CommandString)
  62.         m_CommandString.SetWindowText(m_pModel->m_CommandString);
  63.     
  64.     return TRUE;  // return TRUE unless you set the focus to a control
  65.                   // EXCEPTION: OCX Property Pages should return FALSE
  66. }
  67.