MainFrm.cpp
上传用户:ayqaqa
上传日期:2007-01-02
资源大小:37k
文件大小:2k
- // MainFrm.cpp : implementation of the CMainFrame class
- //
- #include "stdafx.h"
- #include "ListViewDemo.h"
- #include "MyListView.h"
- #include "MainFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- static UINT indicators[] =
- {
- ID_SEPARATOR, // status line indicator
- ID_INDICATOR_CAPS,
- ID_INDICATOR_NUM,
- ID_INDICATOR_SCRL,
- };
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
- CMainFrame::CMainFrame()
- {
- }
- CMainFrame::~CMainFrame()
- {
- }
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
- return 0;
- }
- BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
- CCreateContext* pContext)
- {
- m_wndSplitter.CreateStatic( this, 2, 1 );
-
- m_wndSplitter.CreateView( 0, 0, RUNTIME_CLASS( CMyListView ),
- CSize( 0, 200 ), pContext );
- m_wndSplitter.CreateView( 1, 0, RUNTIME_CLASS( CMyListView ),
- CSize( 0, 200 ), pContext );
-
- CMyListView *pView = (CMyListView *) m_wndSplitter.GetPane( 0, 0 );
- pView->SetUniqueName( "MYVIEW1" );
- pView = (CMyListView *) m_wndSplitter.GetPane( 1, 0 );
- pView->SetUniqueName( "MYVIEW2" );
- return true;
- }
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- cs.style &= ~FWS_ADDTOTITLE;
- return CFrameWnd::PreCreateWindow(cs);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers