update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / UIExplorerFrameWnd.cpp
1 //*******************************************************************************
2 // COPYRIGHT NOTES
3 // ---------------
4 // You may use this source code, compile or redistribute it as part of your application 
5 // for free. You cannot redistribute it as a part of a software development 
6 // library without the agreement of the author. If the sources are 
7 // distributed along with the application, you should leave the original 
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
10 // 
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com 
13 // after Sept 2000
14 // 
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
17
18 #include "stdafx.h"
19 #include "UIExplorerFrameWnd.h"
20 #include "UIres.h"
21
22 #ifdef _DEBUG
23 #define new DEBUG_NEW
24 #undef THIS_FILE
25 static char THIS_FILE[] = __FILE__;
26 #endif
27
28 IMPLEMENT_DYNAMIC(CUIExplorerFrameWnd, CUIFrameWnd)
29
30 CUIExplorerFrameWnd::CUIExplorerFrameWnd() 
31 {
32         m_pExplorerView = NULL;
33 }
34
35 CUIExplorerFrameWnd::~CUIExplorerFrameWnd()
36 {
37 }
38
39 BOOL CUIExplorerFrameWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
40 {
41         // TODO: Add your specialized code here and/or call the base class
42         // create a splitter with 1 row, 2 columns
43
44         // if this asserts you forgot to call SetExplorerView
45         ASSERT(m_pExplorerView);
46         if (m_pExplorerView == NULL)
47                 return CUIFrameWnd::OnCreateClient(lpcs,pContext); 
48 USES_CONVERSION;
49         m_wndSplitter.SetSection(A2CT(GetRuntimeClass()->m_lpszClassName));
50         if (!m_wndSplitter.CreateStatic(this, 1, 2))
51         {
52                 TRACE0("Failed to CreateStatic Splitter\n");
53                 return FALSE;
54         }
55         CSize sizeSplitter(200,0);
56         // add the second splitter pane - a tab view in column 1
57         // add the first splitter pane - the default view in column 0
58         if (!m_wndSplitter.CreateView(0, 0,     pContext->m_pNewViewClass, sizeSplitter, pContext))
59         {
60                 TRACE0("Failed to create first pane\n");
61                 return FALSE;
62                 TRACE1("Created %s view1\n",m_pExplorerView->m_lpszClassName);
63         }
64         if (m_pExplorerView)
65         {
66                 pContext->m_pNewViewClass = m_pExplorerView;
67                 if (!m_wndSplitter.CreateView(0, 1,     pContext->m_pNewViewClass, CSize(0, 0), pContext))
68                 {
69                         TRACE0("Failed to create second pane\n");
70                         return FALSE;
71                 }
72                 TRACE1("Created %s view2\n",m_pExplorerView->m_lpszClassName);
73         }
74         // activate the input view
75         SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
76         
77         return TRUE;
78 }
79
80 /////////////////////////////////////////////////////////////////////////////
81 // CUIExplorerFrameWnd message handlers
82 BEGIN_MESSAGE_MAP(CUIExplorerFrameWnd, CUIFrameWnd)
83         //{{AFX_MSG_MAP(CUIExplorerFrameWnd)
84         //}}AFX_MSG_MAP
85 END_MESSAGE_MAP()
86
87