Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa_test / FormFiller_Test / ChildFrm.cpp
1 // ChildFrm.cpp : implementation of the CChildFrame class\r
2 //\r
3 \r
4 #include "stdafx.h"\r
5 #include "ReaderVC.h"\r
6 \r
7 #include "ChildFrm.h"\r
8 #include "FX_SplitterWnd.h"\r
9 #include "BookmarkView.h"\r
10 #include "ReaderVCView.h"\r
11 #ifdef _DEBUG\r
12 #define new DEBUG_NEW\r
13 #undef THIS_FILE\r
14 static char THIS_FILE[] = __FILE__;\r
15 #endif\r
16 \r
17 /////////////////////////////////////////////////////////////////////////////\r
18 // CChildFrame\r
19 \r
20 IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)\r
21 \r
22 BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)\r
23         //{{AFX_MSG_MAP(CChildFrame)\r
24         ON_WM_SIZE()\r
25         //}}AFX_MSG_MAP\r
26 END_MESSAGE_MAP()\r
27 \r
28 /////////////////////////////////////////////////////////////////////////////\r
29 // CChildFrame construction/destruction\r
30 \r
31 CChildFrame::CChildFrame()\r
32 {\r
33         // TODO: add member initialization code here\r
34         //m_nPosH = m_nPosV = 0;\r
35 //      m_pBkView = NULL;\r
36         m_pView = NULL;\r
37 //      m_bBookmark = FALSE;\r
38 }\r
39 \r
40 CChildFrame::~CChildFrame()\r
41 {\r
42 /*      if (m_pBkView != NULL)\r
43         {\r
44                 delete m_pBkView;\r
45                 m_pBkView = NULL;\r
46         }\r
47         if (m_pView != NULL)\r
48         {\r
49                 delete m_pView;\r
50                 m_pView = NULL;\r
51         }*/\r
52 }\r
53 \r
54 BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)\r
55 {\r
56 \r
57         if( !CMDIChildWnd::PreCreateWindow(cs) )\r
58                 return FALSE;\r
59         cs.style |= WS_MAXIMIZE | WS_VISIBLE;\r
60         return TRUE;\r
61 }\r
62 \r
63 \r
64 \r
65 /////////////////////////////////////////////////////////////////////////////\r
66 // CChildFrame diagnostics\r
67 \r
68 #ifdef _DEBUG\r
69 void CChildFrame::AssertValid() const\r
70 {\r
71         CMDIChildWnd::AssertValid();\r
72 }\r
73 \r
74 void CChildFrame::Dump(CDumpContext& dc) const\r
75 {\r
76         CMDIChildWnd::Dump(dc);\r
77 }\r
78 \r
79 #endif //_DEBUG\r
80 \r
81 /////////////////////////////////////////////////////////////////////////////\r
82 // CChildFrame message handlers\r
83 \r
84 \r
85 \r
86 \r
87 \r
88 void CChildFrame::OnSize(UINT nType, int cx, int cy) \r
89 {\r
90         CMDIChildWnd::OnSize(nType, cx, cy);\r
91 \r
92         \r
93 }\r
94 \r
95 BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) \r
96 {\r
97         if ( !m_wndSplitter.CreateStatic( this, 1, 2 ) ||\r
98                 !m_wndSplitter.CreateView( 0,0,RUNTIME_CLASS(CBookMarkView),CSize(180,0),pContext )|| \r
99                  !m_wndSplitter.CreateView( 0,1,pContext->m_pNewViewClass,CSize(0,0),pContext )) \r
100                 {\r
101                         return FALSE;\r
102                 }\r
103         m_pBkView = (CBookMarkView *)(m_wndSplitter.GetPane(0,0));\r
104         m_pBkView->m_pFram = this;\r
105         m_pView = (CReaderVCView*)(m_wndSplitter.GetPane(0,1));\r
106         m_pView->m_pFram = this;\r
107         this->SetActiveView( (CView*)m_wndSplitter.GetPane(0,1) );\r
108         \r
109         return TRUE;\r
110         \r
111         //return CMDIChildWnd::OnCreateClient(lpcs, pContext);\r
112 }\r