MyBarRightBottom.cpp
资源名称:matcher.rar [点击查看]
上传用户:quan1896
上传日期:2013-04-17
资源大小:94k
文件大小:2k
源码类别:
2D图形编程
开发平台:
Visual C++
- // MyBarRightBottom.cpp : implementation file
- //
- #include "stdafx.h"
- #include "matcher.h"
- #include "MyBarRightBottom.h"
- #include "Resource.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMyBarRightBottom
- CMyBarRightBottom::CMyBarRightBottom()
- {
- }
- CMyBarRightBottom::~CMyBarRightBottom()
- {
- }
- BEGIN_MESSAGE_MAP(CMyBarRightBottom, CCJControlBar)
- //{{AFX_MSG_MAP(CMyBarRightBottom)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMyBarRightBottom message handlers
- static int _gColText[] = {IDS_COL_3};
- static int _gColSize[] = {500};
- int CMyBarRightBottom::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
- return -1;
- // TODO: Add your specialized creation code here
- if (!m_ListCtrl.Create (WS_TABSTOP|WS_CHILD|WS_VISIBLE|LVS_REPORT,
- CRect(0,0,0,0), this, IDC_LIST_CTRL_1))
- {
- TRACE0("Failed to create view for CMyBarLeftn");
- return -1;
- }
- SetChild(&m_ListCtrl);
- m_ListCtrl.ModifyStyleEx(0, WS_EX_STATICEDGE);
- BuildColumns(1, _gColSize, _gColText);
- return 0;
- }
- void CMyBarRightBottom::BuildColumns(int nCols, int * nWidth, int * iCol)
- {
- ASSERT(nCols);
- ASSERT(nWidth);
- ASSERT(iCol);
- ASSERT(m_ListCtrl);
- //insert columns
- int i;
- LV_COLUMN lvc;
- lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
- CString strTemp;
- for(i = 0; i < nCols; i++)
- {
- lvc.iSubItem = i;
- strTemp.LoadString(iCol[i]);
- lvc.pszText = (char*)(LPCTSTR)strTemp;
- lvc.cx = nWidth[i];
- lvc.fmt = LVCFMT_LEFT;
- m_ListCtrl.InsertColumn(i,&lvc);
- }
- }