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.

239 lines
5.6 KiB

  1. // splitter.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. #include "stdafx.h"
  13. #include "viewex.h"
  14. #include "schemavw.h"
  15. #include "bwsview.h"
  16. //#include "queryvw.h"
  17. #include "splitter.h"
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char BASED_CODE THIS_FILE[] = __FILE__;
  21. #endif
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CSplitterFrame
  24. // Create a splitter window which splits an output text view and an input view
  25. // |
  26. // TEXT VIEW (CTextView) | INPUT VIEW (CInputView)
  27. // |
  28. IMPLEMENT_DYNCREATE(CSplitterFrame, CMDIChildWnd)
  29. /***********************************************************
  30. Function:
  31. Arguments:
  32. Return:
  33. Purpose:
  34. Author(s):
  35. Revision:
  36. Date:
  37. ***********************************************************/
  38. CSplitterFrame::CSplitterFrame()
  39. {
  40. }
  41. /***********************************************************
  42. Function:
  43. Arguments:
  44. Return:
  45. Purpose:
  46. Author(s):
  47. Revision:
  48. Date:
  49. ***********************************************************/
  50. CSplitterFrame::~CSplitterFrame()
  51. {
  52. }
  53. /***********************************************************
  54. Function:
  55. Arguments:
  56. Return:
  57. Purpose:
  58. Author(s):
  59. Revision:
  60. Date:
  61. ***********************************************************/
  62. BOOL CSplitterFrame::OnCreateClient(LPCREATESTRUCT,
  63. CCreateContext* pContext)
  64. {
  65. // create a splitter with 1 row, 2 columns
  66. if (!m_wndSplitter.CreateStatic(this, 1, 2))
  67. {
  68. TRACE0("Failed to CreateStaticSplitter\n");
  69. return FALSE;
  70. }
  71. // add the first splitter pane - the default view in column 0
  72. if (!m_wndSplitter.CreateView(0, 0,
  73. pContext->m_pNewViewClass, CSize(150, 180), pContext))
  74. {
  75. TRACE0("Failed to create first pane\n");
  76. return FALSE;
  77. }
  78. // add the second splitter pane - an input view in column 1
  79. if (!m_wndSplitter.CreateView(0, 1,
  80. RUNTIME_CLASS(CSchemaView), CSize(0, 0), pContext))
  81. {
  82. TRACE0("Failed to create second pane\n");
  83. return FALSE;
  84. }
  85. // activate the input view
  86. SetActiveView((CView*)m_wndSplitter.GetPane(0,1));
  87. return TRUE;
  88. }
  89. /***********************************************************
  90. Function:
  91. Arguments:
  92. Return:
  93. Purpose:
  94. Author(s):
  95. Revision:
  96. Date:
  97. ***********************************************************/
  98. int CSplitterFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  99. {
  100. if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
  101. return -1;
  102. // TODO: Add your specialized creation code here
  103. //ShowWindow( SW_MAXIMIZE );
  104. return 0;
  105. }
  106. BEGIN_MESSAGE_MAP(CSplitterFrame, CMDIChildWnd)
  107. //{{AFX_MSG_MAP(CSplitterFrame)
  108. ON_WM_CREATE()
  109. //}}AFX_MSG_MAP
  110. END_MESSAGE_MAP()
  111. /////////////////////////////////////////////////////////////////////////////
  112. // CQuerySplitterFrame
  113. // Create a splitter window which splits an output text view and an input view
  114. // |
  115. // TEXT VIEW (CTextView) | INPUT VIEW (CInputView)
  116. // |
  117. IMPLEMENT_DYNCREATE(CQuerySplitterFrame, CMDIChildWnd)
  118. /***********************************************************
  119. Function:
  120. Arguments:
  121. Return:
  122. Purpose:
  123. Author(s):
  124. Revision:
  125. Date:
  126. ***********************************************************/
  127. CQuerySplitterFrame::CQuerySplitterFrame()
  128. {
  129. }
  130. /***********************************************************
  131. Function:
  132. Arguments:
  133. Return:
  134. Purpose:
  135. Author(s):
  136. Revision:
  137. Date:
  138. ***********************************************************/
  139. CQuerySplitterFrame::~CQuerySplitterFrame()
  140. {
  141. }
  142. /***********************************************************
  143. Function:
  144. Arguments:
  145. Return:
  146. Purpose:
  147. Author(s):
  148. Revision:
  149. Date:
  150. ***********************************************************/
  151. BOOL CQuerySplitterFrame::OnCreateClient(LPCREATESTRUCT,
  152. CCreateContext* pContext)
  153. {
  154. // create a splitter with 1 row, 2 columns
  155. if (!m_wndSplitter.CreateStatic(this, 1, 2))
  156. {
  157. TRACE0("Failed to CreateStaticSplitter\n");
  158. return FALSE;
  159. }
  160. // add the first splitter pane - the default view in column 0
  161. if (!m_wndSplitter.CreateView(0, 0,
  162. pContext->m_pNewViewClass, CSize(150, 180), pContext))
  163. {
  164. TRACE0("Failed to create first pane\n");
  165. return FALSE;
  166. }
  167. // add the second splitter pane - an input view in column 1
  168. //#ifdef TRIAL
  169. // if (!m_wndSplitter.CreateView(0, 1,
  170. // RUNTIME_CLASS(CQueryView), CSize(0, 0), pContext))
  171. // {
  172. // TRACE0("Failed to create second pane\n");
  173. // return FALSE;
  174. // }
  175. //#endif
  176. // activate the input view
  177. SetActiveView((CView*)m_wndSplitter.GetPane(0,1));
  178. return TRUE;
  179. }
  180. /***********************************************************
  181. Function:
  182. Arguments:
  183. Return:
  184. Purpose:
  185. Author(s):
  186. Revision:
  187. Date:
  188. ***********************************************************/
  189. int CQuerySplitterFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  190. {
  191. if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
  192. return -1;
  193. // TODO: Add your specialized creation code here
  194. //ShowWindow( SW_MAXIMIZE );
  195. return 0;
  196. }
  197. BEGIN_MESSAGE_MAP(CQuerySplitterFrame, CMDIChildWnd)
  198. //{{AFX_MSG_MAP(CQuerySplitterFrame)
  199. ON_WM_CREATE()
  200. //}}AFX_MSG_MAP
  201. END_MESSAGE_MAP()