| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // ViewListLog.cpp : CViewListLog 类的实现
- //
- #include "StdAfx.h"
- #include "ViewLog.h"
- #include "DisplayWnd.h"
- #include "resource.h"
- // CViewListLog
- IMPLEMENT_DYNAMIC(CViewLog, CListCtrl)
- CViewLog::CViewLog(void)
- {
- }
- CViewLog::~CViewLog(void)
- {
- }
- BEGIN_MESSAGE_MAP(CViewLog, CListCtrl)
- END_MESSAGE_MAP()
- /*****************************************************************
- **【函数名称】 create
- **【函数功能】 控件初始化
- **【参数】
- **【返回值】
- ****************************************************************/
- bool CViewLog::create(CDisplayWnd* pWnd)
- {
- ASSERT(pWnd != NULL);
- CString Name;
- Name.LoadString(IDS_STR_VIEW_LOG);
- // 创建pane
- if (!m_Pane.Create(Name, pWnd, CRect(0, 0, 300, 300), TRUE, IDS_STR_VIEW_LOG,
- WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_BOTTOM | CBRS_FLOAT_MULTI))
- {
- TRACE0("创建日志窗口失败");
- return false;
- }
- m_Pane.EnableDocking(CBRS_ALIGN_ANY);
- //创建控件
- if(!Create(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LVS_REPORT,
- CRect(0, 0, 0, 0), &m_Pane, IDC_LIST_LOG))
- {
- TRACE0("创建日志列表控件失败\n");
- return false;
- }
- pWnd->OnNewPane(&m_Pane);
- return true;
- }
- /*****************************************************************
- **【函数名称】 newSize
- **【函数功能】 调整控件大小
- **【参数】
- **【返回值】
- ****************************************************************/
- void CViewLog::newSize( CRect& Rect )
- {
- if(IsWindow(GetSafeHwnd()))
- SetWindowPos(NULL, Rect.left, Rect.top, Rect.Width(), Rect.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
- }
|