📄 mybarrightbottom.cpp
字号:
// MyBarRightBottom.cpp : implementation file
//
#include "stdafx.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()
{
// TODO: add construction code here.
}
CMyBarRightBottom::~CMyBarRightBottom()
{
// TODO: add destruction code here.
}
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_1, IDS_COL_2 };
static int _gColSize[] = { 165, 165 };
int CMyBarRightBottom::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CCJControlBar::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
if (!m_ListCtrl.Create (WS_CHILD|WS_VISIBLE|LVS_REPORT,
CRect(0,0,0,0), this, IDC_LIST_CTRL_2))
{
TRACE0("Failed to create view for CMyBarLeft\n");
return -1;
}
SetChild(&m_ListCtrl);
m_ListCtrl.ModifyStyleEx(0, WS_EX_STATICEDGE);
BuildColumns(2, _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);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -