118 lines
3.6 KiB
C++
118 lines
3.6 KiB
C++
// AppDataSP3DTdView.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "geomative.h"
|
|
#include "AppDataSP3DTdView.h"
|
|
|
|
#include "appdatatddetaillistview.h"
|
|
#include "appdatatdgrlistview.h"
|
|
#include "AppDataSP3DTdConListView.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppDataSP3DTdView
|
|
|
|
IMPLEMENT_DYNCREATE(CAppDataSP3DTdView, CView)
|
|
|
|
CAppDataSP3DTdView::CAppDataSP3DTdView()
|
|
{
|
|
m_pGrListView = NULL;
|
|
m_pContentListView = NULL;
|
|
m_pDetailListView = NULL;
|
|
m_pMngFrm = NULL;
|
|
}
|
|
|
|
CAppDataSP3DTdView::~CAppDataSP3DTdView()
|
|
{
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CAppDataSP3DTdView, CView)
|
|
//{{AFX_MSG_MAP(CAppDataSP3DTdView)
|
|
ON_WM_SIZE()
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppDataSP3DTdView drawing
|
|
|
|
void CAppDataSP3DTdView::OnDraw(CDC* pDC)
|
|
{
|
|
CDocument* pDoc = GetDocument();
|
|
// TODO: add draw code here
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppDataSP3DTdView diagnostics
|
|
|
|
#ifdef _DEBUG
|
|
void CAppDataSP3DTdView::AssertValid() const
|
|
{
|
|
CView::AssertValid();
|
|
}
|
|
|
|
void CAppDataSP3DTdView::Dump(CDumpContext& dc) const
|
|
{
|
|
CView::Dump(dc);
|
|
}
|
|
#endif //_DEBUG
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CAppDataSP3DTdView message handlers
|
|
|
|
BOOL CAppDataSP3DTdView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
|
|
{
|
|
// TODO: Add your specialized code here and/or call the base class
|
|
CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
|
|
// TODO: Add your specialized code here and/or call the base class
|
|
if (VAL_ZERO == m_firstSplitter.GetSafeHwnd())
|
|
{
|
|
m_firstSplitter.CreateStatic(this, 1, 2);
|
|
|
|
|
|
VERIFY(m_firstSplitter.CreateView(SPL_VIEW_ROW_0, SPL_VIEW_COL_0, RUNTIME_CLASS(CAppDataTdDetailListView),
|
|
CSize(SPL_VIEW_APP_DETAIL_WIDTH, rect.bottom-rect.top), pContext));
|
|
m_pDetailListView = static_cast<CView*>(m_firstSplitter.GetPane(SPL_VIEW_ROW_0, SPL_VIEW_COL_0));
|
|
ASSERT(m_pDetailListView != NULL);
|
|
m_pDetailListView->OnInitialUpdate();
|
|
|
|
m_secondSplitter.CreateStatic(&m_firstSplitter, 2, 1, WS_CHILD | WS_VISIBLE, m_firstSplitter.IdFromRowCol(SPL_VIEW_ROW_0, SPL_VIEW_COL_1));
|
|
|
|
VERIFY(m_secondSplitter.CreateView(SPL_VIEW_ROW_0, SPL_VIEW_COL_0, RUNTIME_CLASS(CAppDataSP3DTdConListView), CSize(0, (rect.bottom-rect.top)/2), pContext));
|
|
m_pContentListView = static_cast<CView*>(m_secondSplitter.GetPane(SPL_VIEW_ROW_0, SPL_VIEW_COL_0));
|
|
ASSERT(m_pContentListView != NULL);
|
|
m_pContentListView->OnInitialUpdate();
|
|
|
|
VERIFY(m_secondSplitter.CreateView(SPL_VIEW_ROW_1, SPL_VIEW_COL_0, RUNTIME_CLASS(CAppDataTdGrListView), CSize(0, (rect.bottom-rect.top)/2), pContext));
|
|
m_pGrListView = static_cast<CView*>(m_secondSplitter.GetPane(SPL_VIEW_ROW_1, SPL_VIEW_COL_0));
|
|
ASSERT(m_pGrListView != NULL);
|
|
m_pGrListView->OnInitialUpdate();
|
|
|
|
m_secondSplitter.RecalcLayout();
|
|
m_firstSplitter.RecalcLayout();
|
|
}
|
|
|
|
m_pMngFrm = (CMDIChildWnd*)GetParentFrame();
|
|
return TRUE;
|
|
}
|
|
|
|
void CAppDataSP3DTdView::OnSize(UINT nType, int cx, int cy)
|
|
{
|
|
CView::OnSize(nType, cx, cy);
|
|
|
|
// TODO: Add your message handler code here
|
|
if (VAL_ZERO != m_firstSplitter.GetSafeHwnd())
|
|
{
|
|
m_firstSplitter.MoveWindow((int)VAL_ZERO, (int)VAL_ZERO, cx, cy);
|
|
m_firstSplitter.RecalcLayout();
|
|
m_secondSplitter.SetRowInfo((int)SPL_VIEW_ROW_0 , (int)cy/2, (int)VAL_ZERO);
|
|
m_secondSplitter.RecalcLayout();
|
|
}
|
|
}
|