📄 grid.cpp
字号:
// Grid.cpp : implementation file
//
#include "stdafx.h"
#include "IcDemo.h"
#include "Grid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGrid
CGrid::CGrid()
{
::GetObject((HFONT)GetStockObject(DEFAULT_GUI_FONT),sizeof(m_lf),&m_lf);
m_font.CreateFontIndirect(&m_lf);
}
CGrid::~CGrid()
{
}
BEGIN_MESSAGE_MAP(CGrid, CListCtrl)
//{{AFX_MSG_MAP(CGrid)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGrid message handlers
void CGrid::SetGridStyle(BOOL bset)
{
if(bset)
SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT);
}
void CGrid::SetGridSel(BOOL bset)
{
if(bset)
SetExtendedStyle(LVS_EX_FULLROWSELECT);
}
CGrid& CGrid::SetFontSize(int nSize)
{
nSize*=-1;
m_lf.lfHeight = nSize;
ReconstructFont();
RedrawWindow();
return *this;
}
CGrid& CGrid::SetFontBold(BOOL bBold)
{
m_lf.lfWeight = bBold ? FW_BOLD : FW_NORMAL;
ReconstructFont();
RedrawWindow();
return *this;
}
void CGrid::ReconstructFont()
{
m_font.DeleteObject();
BOOL bCreated = m_font.CreateFontIndirect(&m_lf);
SetFont(&m_font,TRUE);
ASSERT(bCreated);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -