// splitter.cpp : implementation file // // This is a part of the Microsoft Foundation Classes C++ library. // Copyright (C) 1992-1995 Microsoft Corporation // All rights reserved. // // This source code is only intended as a supplement to the // Microsoft Foundation Classes Reference and related // electronic documentation provided with the library. // See these sources for detailed information regarding the // Microsoft Foundation Classes product. #include "stdafx.h" #include "viewex.h" #include "schemavw.h" #include "bwsview.h" //#include "queryvw.h" #include "splitter.h" #ifdef _DEBUG #undef THIS_FILE static char BASED_CODE THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSplitterFrame // Create a splitter window which splits an output text view and an input view // | // TEXT VIEW (CTextView) | INPUT VIEW (CInputView) // | IMPLEMENT_DYNCREATE(CSplitterFrame, CMDIChildWnd) /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ CSplitterFrame::CSplitterFrame() { } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ CSplitterFrame::~CSplitterFrame() { } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ BOOL CSplitterFrame::OnCreateClient(LPCREATESTRUCT, CCreateContext* pContext) { // create a splitter with 1 row, 2 columns if (!m_wndSplitter.CreateStatic(this, 1, 2)) { TRACE0("Failed to CreateStaticSplitter\n"); return FALSE; } // add the first splitter pane - the default view in column 0 if (!m_wndSplitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(150, 180), pContext)) { TRACE0("Failed to create first pane\n"); return FALSE; } // add the second splitter pane - an input view in column 1 if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CSchemaView), CSize(0, 0), pContext)) { TRACE0("Failed to create second pane\n"); return FALSE; } // activate the input view SetActiveView((CView*)m_wndSplitter.GetPane(0,1)); return TRUE; } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ int CSplitterFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here //ShowWindow( SW_MAXIMIZE ); return 0; } BEGIN_MESSAGE_MAP(CSplitterFrame, CMDIChildWnd) //{{AFX_MSG_MAP(CSplitterFrame) ON_WM_CREATE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CQuerySplitterFrame // Create a splitter window which splits an output text view and an input view // | // TEXT VIEW (CTextView) | INPUT VIEW (CInputView) // | IMPLEMENT_DYNCREATE(CQuerySplitterFrame, CMDIChildWnd) /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ CQuerySplitterFrame::CQuerySplitterFrame() { } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ CQuerySplitterFrame::~CQuerySplitterFrame() { } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ BOOL CQuerySplitterFrame::OnCreateClient(LPCREATESTRUCT, CCreateContext* pContext) { // create a splitter with 1 row, 2 columns if (!m_wndSplitter.CreateStatic(this, 1, 2)) { TRACE0("Failed to CreateStaticSplitter\n"); return FALSE; } // add the first splitter pane - the default view in column 0 if (!m_wndSplitter.CreateView(0, 0, pContext->m_pNewViewClass, CSize(150, 180), pContext)) { TRACE0("Failed to create first pane\n"); return FALSE; } // add the second splitter pane - an input view in column 1 //#ifdef TRIAL // if (!m_wndSplitter.CreateView(0, 1, // RUNTIME_CLASS(CQueryView), CSize(0, 0), pContext)) // { // TRACE0("Failed to create second pane\n"); // return FALSE; // } //#endif // activate the input view SetActiveView((CView*)m_wndSplitter.GetPane(0,1)); return TRUE; } /*********************************************************** Function: Arguments: Return: Purpose: Author(s): Revision: Date: ***********************************************************/ int CQuerySplitterFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1) return -1; // TODO: Add your specialized creation code here //ShowWindow( SW_MAXIMIZE ); return 0; } BEGIN_MESSAGE_MAP(CQuerySplitterFrame, CMDIChildWnd) //{{AFX_MSG_MAP(CQuerySplitterFrame) ON_WM_CREATE() //}}AFX_MSG_MAP END_MESSAGE_MAP()