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 //*******************************************************************************
18 // TabClientView.cpp : implementation file
22 #include "UIListView.h"
27 static char THIS_FILE[] = __FILE__;
30 /////////////////////////////////////////////////////////////////////////////
33 IMPLEMENT_DYNAMIC(CUIListView, CView)
35 CUIListView::CUIListView(UINT nID) : m_nID(nID), m_pListCtrl(NULL)
37 m_Style = WS_VISIBLE | WS_CHILD | LVS_REPORT | LVS_SHOWSELALWAYS;
41 CUIListView::~CUIListView()
46 CUIODListCtrl &CUIListView::GetListCtrl()
52 void CUIListView::CreateListCtrl()
54 m_pListCtrl = new CUIODListCtrl;
55 GetListCtrl().SetDragDrop(m_bDragDrop);
58 BEGIN_MESSAGE_MAP(CUIListView, CView)
59 //{{AFX_MSG_MAP(CUIListView)
64 ON_MESSAGE(WM_APP_UPDATE_ALL_VIEWS, OnAppUpdateAllViews)
67 /////////////////////////////////////////////////////////////////////////////
68 // CUIListView drawing
70 void CUIListView::OnDraw(CDC* pDC)
72 CDocument* pDoc = GetDocument();
73 // TODO: add draw code here
76 /////////////////////////////////////////////////////////////////////////////
77 // CUIListView diagnostics
80 void CUIListView::AssertValid() const
85 void CUIListView::Dump(CDumpContext& dc) const
91 /////////////////////////////////////////////////////////////////////////////
92 // CUIListView message handlers
94 int CUIListView::OnCreate(LPCREATESTRUCT lpCreateStruct)
96 if (CView::OnCreate(lpCreateStruct) == -1)
101 // TODO: Add your specialized creation code here
103 GetListCtrl().SetSection(A2CT(GetRuntimeClass()->m_lpszClassName));
104 GetListCtrl().ChangeStyle(m_Style);
105 if (GetListCtrl().Create(m_Style,CRect(0,0,0,0),this,m_nID) == -1)
108 GetListCtrl().Init();
113 void CUIListView::OnSetFocus(CWnd* pOldWnd)
115 CView::OnSetFocus(pOldWnd);
117 // TODO: Add your message handler code here
118 GetListCtrl().SetFocus();
121 void CUIListView::OnSize(UINT nType, int cx, int cy)
123 CView::OnSize(nType, cx, cy);
125 // TODO: Add your message handler code here
126 if (GetListCtrl().GetSafeHwnd())
127 GetListCtrl().MoveWindow(0,0,cx,cy);
130 LRESULT CUIListView::OnAppUpdateAllViews( WPARAM wParam, LPARAM lParam )
133 GetDocument()->UpdateAllViews(NULL,wParam,(CObject*)lParam);
137 BOOL CUIListView::PreCreateWindow(CREATESTRUCT& cs)
139 // TODO: Add your specialized code here and/or call the base class
140 cs.lpszClass = AfxRegisterWndClass(
145 ASSERT(cs.lpszClass);
147 return CView::PreCreateWindow(cs);