📄 wordlistshow.cpp
字号:
// WordListShow.cpp : implementation file
//
#include "stdafx.h"
#include "LiveController.h"
#include "WordListShow.h"
#include "ListItem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWordListShow dialog
CWordListShow::CWordListShow(CWnd* pParent /*=NULL*/)
: CDialog(CWordListShow::IDD, pParent)
{
//{{AFX_DATA_INIT(CWordListShow)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CWordListShow::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWordListShow)
DDX_Control(pDX, IDC_WordList_Show, m_ctrWordShow);
//}}AFX_DATA_MAP
}
void CWordListShow::RefreshWordList(int index)
{
m_ctrWordShow.DeleteAllItems();
WordListShowItem *pSWItem = pInterface->GetScheWord(index);
if ( pSWItem )
{
CString strTemp;
LVITEM tempLvi;
tempLvi.mask = LVIF_IMAGE | LVIF_TEXT;
tempLvi.stateMask = -1;
int nIndex = 0;
while ( pSWItem )
{
// Sche ID
char idtemp[20];
_itoa(pSWItem->sch_id,idtemp,10);
tempLvi.iItem = nIndex;
tempLvi.iSubItem = 0;
tempLvi.pszText = (char *)idtemp;
m_ctrWordShow.InsertItem(&tempLvi);
// Word Type
char ttemp[20];
_itoa(pSWItem->WordType,ttemp,10);
tempLvi.iSubItem = 1;
tempLvi.pszText = (char *)ttemp;
m_ctrWordShow.SetItem( &tempLvi );
// Word Content
tempLvi.iSubItem = 2;
tempLvi.pszText = (char *)(LPCTSTR)pSWItem->WordContent;
m_ctrWordShow.SetItem( &tempLvi );
pSWItem = pSWItem->pnext;
nIndex++;
}
}
}
BEGIN_MESSAGE_MAP(CWordListShow, CDialog)
//{{AFX_MSG_MAP(CWordListShow)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWordListShow message handlers
BOOL CWordListShow::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
LVCOLUMN lvcol;
lvcol.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT;
lvcol.fmt = LVCFMT_LEFT;
lvcol.pszText = _T( "节目ID" );
lvcol.iSubItem = 1;
m_ctrWordShow.InsertColumn( 0, &lvcol );
m_ctrWordShow.SetColumnWidth( 0, 80);
lvcol.pszText = _T( "词汇类型" );
m_ctrWordShow.InsertColumn( 1, &lvcol );
m_ctrWordShow.SetColumnWidth( 1, 60 );
lvcol.pszText = _T( "过滤词汇" );
m_ctrWordShow.InsertColumn( 2, &lvcol );
m_ctrWordShow.SetColumnWidth( 2, 95 );
DWORD dwStyle = m_ctrWordShow.GetExtendedStyle();
dwStyle |= LVS_EX_FULLROWSELECT;
dwStyle |= LVS_EX_GRIDLINES;
m_ctrWordShow.SetExtendedStyle(dwStyle);
int qIndex = WorkingSche_ID;
RefreshWordList(qIndex);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -