Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
4.7 KiB

  1. /*******************************************************************************
  2. *
  3. * msgview.cpp
  4. *
  5. * implementation of the CMessageView class
  6. *
  7. * copyright notice: Copyright 1997, Citrix Systems Inc.
  8. * Copyright (c) 1998 - 1999 Microsoft Corporation
  9. *
  10. * $Author: donm $ Don Messerli
  11. *
  12. * $Log: N:\nt\private\utils\citrix\winutils\winadmin\VCS\msgview.cpp $
  13. *
  14. * Rev 1.2 03 Nov 1997 15:27:18 donm
  15. * update
  16. *
  17. * Rev 1.1 15 Oct 1997 21:47:22 donm
  18. * update
  19. *
  20. *******************************************************************************/
  21. #include "stdafx.h"
  22. #include "resource.h"
  23. #include "msgview.h"
  24. #include "admindoc.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. //////////////////////////
  31. // MESSAGE MAP: CMessageView
  32. //
  33. IMPLEMENT_DYNCREATE(CMessageView, CView)
  34. BEGIN_MESSAGE_MAP(CMessageView, CView)
  35. //{{AFX_MSG_MAP(CMessageView)
  36. ON_WM_SIZE()
  37. ON_WM_CREATE()
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. ///////////////////////
  41. // F'N: CMessageView ctor
  42. //
  43. CMessageView::CMessageView()
  44. {
  45. m_pMessagePage = NULL;
  46. } // end CMessageView ctor
  47. ///////////////////////
  48. // F'N: CMessageView dtor
  49. //
  50. CMessageView::~CMessageView()
  51. {
  52. } // end CMessageView dtor
  53. #ifdef _DEBUG
  54. ///////////////////////////////
  55. // F'N: CMessageView::AssertValid
  56. //
  57. void CMessageView::AssertValid() const
  58. {
  59. CView::AssertValid();
  60. } // end CMessageView::AssertValid
  61. ////////////////////////
  62. // F'N: CMessageView::Dump
  63. //
  64. void CMessageView::Dump(CDumpContext& dc) const
  65. {
  66. CView::Dump(dc);
  67. } // end CMessageView::Dump
  68. #endif //_DEBUG
  69. ////////////////////////////
  70. // F'N: CMessageView::OnCreate
  71. //
  72. int CMessageView::OnCreate(LPCREATESTRUCT lpCreateStruct)
  73. {
  74. if (CView::OnCreate(lpCreateStruct) == -1)
  75. return -1;
  76. return 0;
  77. } // end CMessageView::OnCreate
  78. ///////////////////////////////////
  79. // F'N: CMessageView::OnInitialUpdate
  80. //
  81. //
  82. void CMessageView::OnInitialUpdate()
  83. {
  84. m_pMessagePage = new CMessagePage;
  85. if(!m_pMessagePage) return;
  86. m_pMessagePage->Create(NULL, NULL, WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), this, 0, NULL);
  87. GetDocument()->AddView(m_pMessagePage);
  88. } // end CMessageView::OnInitialUpdate
  89. //////////////////////////
  90. // F'N: CMessageView::OnSize
  91. //
  92. // - size the pages to fill the entire view
  93. //
  94. void CMessageView::OnSize(UINT nType, int cx, int cy)
  95. {
  96. RECT rect;
  97. GetClientRect(&rect);
  98. if(m_pMessagePage && m_pMessagePage->GetSafeHwnd())
  99. m_pMessagePage->MoveWindow(&rect, TRUE);
  100. } // end CMessageView::OnSize
  101. //////////////////////////
  102. // F'N: CMessageView::OnDraw
  103. //
  104. //
  105. void CMessageView::OnDraw(CDC* pDC)
  106. {
  107. CDocument* pDoc = GetDocument();
  108. // TODO: add draw code here
  109. } // end CMessageView::OnDraw
  110. /////////////////////////
  111. // F'N: CMessageView::Reset
  112. //
  113. //
  114. void CMessageView::Reset(void *p)
  115. {
  116. if(m_pMessagePage) m_pMessagePage->Reset(p);
  117. // ((CWinAdminDoc*)GetDocument())->SetCurrentPage(m_CurrPage);
  118. } // end CMessageView::Reset
  119. ////////////////////////////////
  120. // MESSAGE MAP: CMessagePage
  121. //
  122. IMPLEMENT_DYNCREATE(CMessagePage, CFormView)
  123. BEGIN_MESSAGE_MAP(CMessagePage, CFormView)
  124. //{{AFX_MSG_MAP(CMessagePage)
  125. ON_WM_SIZE()
  126. //}}AFX_MSG_MAP
  127. END_MESSAGE_MAP()
  128. /////////////////////////////
  129. // F'N: CMessagePage ctor
  130. //
  131. CMessagePage::CMessagePage()
  132. : CAdminPage(CMessagePage::IDD)
  133. {
  134. //{{AFX_DATA_INIT(CMessagePage)
  135. //}}AFX_DATA_INIT
  136. } // end CMessagePage ctor
  137. /////////////////////////////
  138. // F'N: CMessagePage dtor
  139. //
  140. CMessagePage::~CMessagePage()
  141. {
  142. } // end CMessagePage dtor
  143. ////////////////////////////////////////
  144. // F'N: CMessagePage::DoDataExchange
  145. //
  146. void CMessagePage::DoDataExchange(CDataExchange* pDX)
  147. {
  148. CFormView::DoDataExchange(pDX);
  149. //{{AFX_DATA_MAP(CMessagePage)
  150. //}}AFX_DATA_MAP
  151. } // end CMessagePage::DoDataExchange
  152. #ifdef _DEBUG
  153. /////////////////////////////////////
  154. // F'N: CMessagePage::AssertValid
  155. //
  156. void CMessagePage::AssertValid() const
  157. {
  158. CFormView::AssertValid();
  159. } // end CMessagePage::AssertValid
  160. //////////////////////////////
  161. // F'N: CMessagePage::Dump
  162. //
  163. void CMessagePage::Dump(CDumpContext& dc) const
  164. {
  165. CFormView::Dump(dc);
  166. } // end CMessagePage::Dump
  167. #endif //_DEBUG
  168. //////////////////////////////
  169. // F'N: CMessagePage::OnInitialUpdate
  170. //
  171. void CMessagePage::OnInitialUpdate()
  172. {
  173. CFormView::OnInitialUpdate();
  174. } // end CMessagePage::OnInitialUpdate
  175. //////////////////////////////
  176. // F'N: CMessagePage::OnSize
  177. //
  178. void CMessagePage::OnSize(UINT nType, int cx, int cy)
  179. {
  180. RECT rect;
  181. GetClientRect(&rect);
  182. MoveWindow(&rect, TRUE);
  183. // CFormView::OnSize(nType, cx, cy);
  184. } // end CMessagePage::OnSize
  185. //////////////////////////////
  186. // F'N: CMessagePage::Reset
  187. //
  188. void CMessagePage::Reset(void *p)
  189. {
  190. CString string;
  191. string.LoadString((WORD)p);
  192. SetDlgItemText(IDC_MESSAGE, string);
  193. } // end CMessagePage::Reset