📄 itemlistview.cpp
字号:
// ItemListView.cpp : implementation file
//
#include "stdafx.h"
#include "DiamondReader.h"
#include "ItemListView.h"
#include "helper.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CItemListView
IMPLEMENT_DYNCREATE(CItemListView, CFormView)
CItemListView::CItemListView()
: CFormView(CItemListView::IDD)
{
//{{AFX_DATA_INIT(CItemListView)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CItemListView::~CItemListView()
{
}
void CItemListView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CItemListView)
/*DDX_Control(pDX, IDC_DATAGRIDITEMLIST, m_itemList);*/
//DDX_Control(pDX,IDC_ADODOCITEMLIST,m_adodc);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CItemListView, CFormView)
//{{AFX_MSG_MAP(CItemListView)
ON_WM_SIZE()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CItemListView diagnostics
#ifdef _DEBUG
void CItemListView::AssertValid() const
{
CFormView::AssertValid();
}
void CItemListView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CItemListView message handlers
void CItemListView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
CRect rect;
GetClientRect(&rect);
if (m_list.m_hWnd)
{
m_list.MoveWindow(&rect);
}
ShowScrollBar(SB_HORZ,false);
}
void CItemListView::OnInitialUpdate(){
CRect rect;
GetClientRect(&rect);
/*m_itemList.Create(TEXT("消息列表"),WS_CHILD|WS_VISIBLE|WS_BORDER,rect,this,0);*/
}
int CItemListView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
CRect rect;
GetClientRect(&rect);
m_list.Create(WS_CHILD|WS_VISIBLE|LVS_REPORT,rect,this,0);
m_list.SetExtendedStyle(LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT|m_list.GetExtendedStyle());
m_list.InsertColumn(0," ",LVCFMT_CENTER,20);
m_list.InsertColumn(1,TEXT("标题"),LVCFMT_CENTER,300);
m_list.InsertColumn(2,TEXT("作者"),LVCFMT_CENTER,120);
m_list.InsertColumn(3,TEXT("发布时间"),LVCFMT_CENTER,120);
return 0;
}
void CItemListView::showChannel(ItemList *list){
makeList(list,&(this->m_list));
}
void CItemListView::sort(int type,int arc){
this->m_list.sort(type,arc);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -