ChildMixedFrame.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // ChildMixedFrame.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "demo.h"
  5. #include "ChildMixedFrame.h"
  6. #include "DemoDoc.h"
  7. #include "DemoView.h"
  8. #include "PropertyFormView.h"
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CChildMixedFrame
  16. IMPLEMENT_DYNCREATE(CChildMixedFrame, CResizableMDIChild)
  17. CChildMixedFrame::CChildMixedFrame()
  18. {
  19. }
  20. CChildMixedFrame::~CChildMixedFrame()
  21. {
  22. }
  23. BEGIN_MESSAGE_MAP(CChildMixedFrame, CResizableMDIChild)
  24. //{{AFX_MSG_MAP(CChildMixedFrame)
  25. // NOTE - the ClassWizard will add and remove mapping macros here.
  26. //}}AFX_MSG_MAP
  27. END_MESSAGE_MAP()
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CChildMixedFrame message handlers
  30. BOOL CChildMixedFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/, CCreateContext* pContext)
  31. {
  32. // CG: The following block was added by the Splitter Bar component.
  33. {
  34. if (!m_wndSplitter.CreateStatic(this, 1, 2))
  35. {
  36. TRACE0("Failed to create splitter bar ");
  37. return FALSE; // failed to create
  38. }
  39. if (!m_wndSplitter.CreateView(0, 0,
  40. RUNTIME_CLASS(CEditView), CSize(0,100), pContext))
  41. {
  42. TRACE0("Failed to create splitter's first pane ");
  43. return FALSE; // failed to create
  44. }
  45. if (!m_wndSplitter.CreateView(0, 1,
  46. RUNTIME_CLASS(CPropertyFormView), CSize(0,0), pContext))
  47. {
  48. TRACE0("Failed to create splitter's second pane ");
  49. return FALSE; // failed to create
  50. }
  51. m_wndSplitter.SetColumnInfo(0, 100, 30);
  52. m_wndSplitter.SetColumnInfo(1, 100, 30);
  53. return TRUE;
  54. }
  55. }
  56. void CChildMixedFrame::ActivateFrame(int nCmdShow)
  57. {
  58. if ( EnableSaveRestore(_T("Demo MDI MixedFrame")) )
  59. {
  60. // if correctly restored, activate window and return
  61. MDIActivate();
  62. return;
  63. }
  64. CResizableMDIChild::ActivateFrame(nCmdShow);
  65. }