TBGenWnd.cpp
上传用户:rundaa
上传日期:2009-05-24
资源大小:44k
文件大小:3k
源码类别:

CAD

开发平台:

Visual C++

  1. // TBGenWnd.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "StdArx.h"
  5. #include "TBGenWnd.h"
  6. #include "Resource.h"
  7. #include "WindoTypeDlg.h"
  8. #include "WindoInfoDlg.h"
  9. #include "rxmfcapi.h"
  10. #include "gepnt2d.h"
  11. #ifdef _DEBUG
  12. #define new DEBUG_NEW
  13. #undef THIS_FILE
  14. static char THIS_FILE[] = __FILE__;
  15. #endif
  16. extern CWindoTypeDlg* g_pWindoTypeDlg;
  17. //extern HINSTANCE hResource;
  18. extern void drawWindo();
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CTBGenWnd
  21. CTBGenWnd::CTBGenWnd()
  22. {
  23. }
  24. CTBGenWnd::~CTBGenWnd()
  25. {
  26. }
  27. BEGIN_MESSAGE_MAP(CTBGenWnd, CWnd)
  28. //{{AFX_MSG_MAP(CTBGenWnd)
  29. ON_COMMAND(ID_TBTN_WINDDLG, OnShowWindTypeDlg)
  30. ON_COMMAND(ID_TBTN_DRAW, OnDrawWindo)
  31. ON_COMMAND(ID_TBTN_INFO, OnWindInfoDlg)
  32. ON_WM_CLOSE()
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CTBGenWnd message handlers
  37. void CTBGenWnd::OnShowWindTypeDlg() 
  38. {
  39. if(g_pWindoTypeDlg != NULL && !g_pWindoTypeDlg->IsWindowVisible())
  40. {
  41. g_pWindoTypeDlg->ShowWindow(SW_SHOW);
  42. }
  43. else if(g_pWindoTypeDlg != NULL)
  44. {
  45. g_pWindoTypeDlg->ShowWindow(SW_SHOW);
  46. }
  47. else
  48. {
  49. CAcModuleResourceOverride resOverride;
  50. g_pWindoTypeDlg = new CWindoTypeDlg(acedGetAcadFrame());
  51. g_pWindoTypeDlg->Create(IDD_WINDOTYPE, acedGetAcadFrame());
  52. g_pWindoTypeDlg->CenterWindow();
  53. g_pWindoTypeDlg->ShowWindow(SW_SHOW);
  54. ((CButton*) g_pWindoTypeDlg->GetDlgItem(IDC_CHK_VISTB))->SetCheck(1);
  55. g_pWindoTypeDlg->GetDlgItem(IDC_BTN_HIDEDLG)->EnableWindow(TRUE);
  56. }
  57. }
  58. void CTBGenWnd::OnDrawWindo()
  59. {
  60. if(g_pWindoTypeDlg != NULL)
  61. {
  62. g_pWindoTypeDlg->UpdateData(TRUE);
  63. // Transfer the values in the dialog
  64. // back to the global variables
  65. windInfo.m_dWindHt = g_pWindoTypeDlg->m_dHeight;
  66. windInfo.m_dWindWt = g_pWindoTypeDlg->m_dWidth;
  67. windInfo.m_nCols = g_pWindoTypeDlg->m_nCols;
  68. windInfo.m_nRows = g_pWindoTypeDlg->m_nRows;
  69. windInfo.m_nWindType = g_pWindoTypeDlg->m_nWindType;
  70. windInfo.m_startPt.x = g_pWindoTypeDlg->m_dXVal;
  71. windInfo.m_startPt.y = g_pWindoTypeDlg->m_dYVal;
  72. }
  73. drawWindo();
  74. }
  75. void CTBGenWnd::OnWindInfoDlg() 
  76. {
  77. CAcModuleResourceOverride resOverride;
  78. CWindoInfoDlg dlg;
  79. dlg.DoModal();
  80. }
  81. void CTBGenWnd::OnClose() 
  82. {
  83. // TODO: Add your message handler code here and/or call default
  84. CWnd::OnClose();
  85. }
  86. void CTBGenWnd::PostNcDestroy() 
  87. {
  88. // TODO: Add your specialized code here and/or call the base class
  89. CWnd::PostNcDestroy();
  90. }