BlockNameDlg.cpp
上传用户:mica555
上传日期:2014-05-08
资源大小:68k
文件大小:3k
源码类别:

CAD

开发平台:

Visual C++

  1. //-----------------------------------------------------------------------------
  2. //----- BlockNameDlg.cpp : implementation file
  3. #include "StdAfx.h"
  4. #include "StdArx.h"
  5. #include "resource.h"
  6. #include "BlockNameDlg.h"
  7. //-----------------------------------------------------------------------------
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. //-----------------------------------------------------------------------------
  14. IMPLEMENT_DYNAMIC (BlockNameDlg, CAcUiDialog)
  15. BEGIN_MESSAGE_MAP(BlockNameDlg, CAcUiDialog)
  16. //{{AFX_MSG_MAP(BlockNameDlg)
  17. ON_MESSAGE(WM_ACAD_KEEPFOCUS, OnAcadKeepFocus)    // Needed for modeless dialog.
  18. ON_EN_KILLFOCUS(IDC_NEW_NAME, OnKillfocusNewName)
  19. ON_EN_SETFOCUS(IDC_NEW_NAME, OnSetfocusNewName)
  20. ON_EN_CHANGE(IDC_NEW_NAME, OnChangeNewName)
  21. //}}AFX_MSG_MAP
  22. END_MESSAGE_MAP()
  23. //-----------------------------------------------------------------------------
  24. BlockNameDlg::BlockNameDlg (CWnd* pParent /*=NULL*/, HINSTANCE hInstance /*=NULL*/) 
  25.     : CAcUiDialog (BlockNameDlg::IDD, pParent, hInstance)
  26. {
  27. //{{AFX_DATA_INIT(BlockNameDlg)
  28. //}}AFX_DATA_INIT
  29. }
  30. void BlockNameDlg::DoDataExchange (CDataExchange *pDX) {
  31. CAcUiDialog::DoDataExchange (pDX) ;
  32. //{{AFX_DATA_MAP(BlockNameDlg)
  33. DDX_Control(pDX, IDC_NEW_NAME, m_ctrl_new_name);
  34. DDX_Control(pDX, IDC_OLD_NAME, m_ctrl_old_name);
  35. //}}AFX_DATA_MAP
  36. }
  37. // Needed for modeless dialogs to keep focus.
  38. // Return FALSE to not keep the focus, return TRUE to keep the focus
  39. LONG BlockNameDlg::OnAcadKeepFocus(UINT, UINT)
  40. {
  41.   return TRUE;
  42. }
  43. //-----------------------------------------------------------------------------
  44. BOOL BlockNameDlg::OnInitDialog() 
  45. {
  46. CAcUiDialog::OnInitDialog();
  47. m_ctrl_old_name.SetWindowText(LPCTSTR(g_Info.str));
  48.     m_ctrl_new_name.SetWindowText(LPCTSTR(g_Info.str));
  49.     GetDlgItem(IDC_OLD_NAME)->EnableWindow(0);
  50.     GetDlgItem(IDC_NEW_NAME)->EnableWindow(1);
  51.     
  52.     
  53. // TODO: Add extra initialization here
  54. return TRUE;  // return TRUE unless you set the focus to a control
  55.               // EXCEPTION: OCX Property Pages should return FALSE
  56. }
  57. void BlockNameDlg::OnKillfocusNewName() 
  58. {
  59. // TODO: Add your control notification handler code here
  60. }
  61. void BlockNameDlg::OnOK() 
  62. {
  63. // TODO: Add extra validation here
  64. CAcUiDialog::OnOK();
  65. }
  66. void BlockNameDlg::OnSetfocusNewName() 
  67. {
  68. // TODO: Add your control notification handler code here
  69. m_ctrl_new_name.SetSel(0,-1);
  70. }
  71. void BlockNameDlg::OnChangeNewName() 
  72. {
  73. // TODO: If this is a RICHEDIT control, the control will not
  74. // send this notification unless you override the CAcUiDialog::OnInitDialog()
  75. // function and call CRichEditCtrl().SetEventMask()
  76. // with the ENM_CHANGE flag ORed into the mask.
  77. // TODO: Add your control notification handler code here
  78. }