1 //*******************************************************************************
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.
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
19 #include "UIExplorerFrameWnd.h"
25 static char THIS_FILE[] = __FILE__;
28 IMPLEMENT_DYNAMIC(CUIExplorerFrameWnd, CUIFrameWnd)
30 CUIExplorerFrameWnd::CUIExplorerFrameWnd()
32 m_pExplorerView = NULL;
35 CUIExplorerFrameWnd::~CUIExplorerFrameWnd()
39 BOOL CUIExplorerFrameWnd::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
41 // TODO: Add your specialized code here and/or call the base class
42 // create a splitter with 1 row, 2 columns
44 // if this asserts you forgot to call SetExplorerView
45 ASSERT(m_pExplorerView);
46 if (m_pExplorerView == NULL)
47 return CUIFrameWnd::OnCreateClient(lpcs,pContext);
49 m_wndSplitter.SetSection(A2CT(GetRuntimeClass()->m_lpszClassName));
50 if (!m_wndSplitter.CreateStatic(this, 1, 2))
52 TRACE0("Failed to CreateStatic Splitter\n");
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))
60 TRACE0("Failed to create first pane\n");
62 TRACE1("Created %s view1\n",m_pExplorerView->m_lpszClassName);
66 pContext->m_pNewViewClass = m_pExplorerView;
67 if (!m_wndSplitter.CreateView(0, 1, pContext->m_pNewViewClass, CSize(0, 0), pContext))
69 TRACE0("Failed to create second pane\n");
72 TRACE1("Created %s view2\n",m_pExplorerView->m_lpszClassName);
74 // activate the input view
75 SetActiveView((CView*)m_wndSplitter.GetPane(0,0));
80 /////////////////////////////////////////////////////////////////////////////
81 // CUIExplorerFrameWnd message handlers
82 BEGIN_MESSAGE_MAP(CUIExplorerFrameWnd, CUIFrameWnd)
83 //{{AFX_MSG_MAP(CUIExplorerFrameWnd)