📄 fontlist.cpp
字号:
// FontList.cpp : implementation file
//
#include "stdafx.h"
#include "LoadFont.h"
#include "LoadFontDoc.h"
#include "LoadFontView.h"
#include "FontList.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFontList
CFontList::CFontList(CLoadFontView *pView)
{
m_pView = pView;
}
CFontList::~CFontList()
{
}
BEGIN_MESSAGE_MAP(CFontList, CListBox)
//{{AFX_MSG_MAP(CFontList)
ON_CONTROL_REFLECT(LBN_SELCHANGE, OnSelchange)
ON_CONTROL_REFLECT(LBN_KILLFOCUS, OnKillfocus)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFontList message handlers
void CFontList::OnSelchange()
{
// TODO: Add your control notification handler code here
// Get reference to our control.
CListCtrl &ctlList = m_pView->GetListCtrl();
// Now update the selected cell with our selection.
CString szText;
GetText(GetCurSel(), szText);
ctlList.SetItemText(m_iIndex, m_iSubItem, szText);
// Update our board list with the changes also.
CDlgcLoadFont *pLF = m_pView->m_pLF;
CDlgcLoadFont::CDlgcBoard *pBoard =
(CDlgcLoadFont::CDlgcBoard*)pLF->m_BoardList[m_iIndex];
if (m_iSubItem == CLoadFontView::NormalSubitem)
pBoard->SetNormalFont(szText);
if (m_iSubItem == CLoadFontView::CompressedSubitem)
pBoard->SetCompressedFont(szText);
// Make our list box invisible again now that we are done.
ModifyStyle(WS_VISIBLE, WS_DISABLED);
GetParent()->Invalidate();
}
void CFontList::SetListSelection(int iIndex, int iSubItem)
{
m_iIndex = iIndex;
m_iSubItem = iSubItem;
}
void CFontList::OnKillfocus()
{
// TODO: Add your control notification handler code here
ModifyStyle(WS_VISIBLE, WS_DISABLED);
GetParent()->Invalidate();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -