⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 channellistview.cpp

📁 离线的RSS阅读器
💻 CPP
字号:
// ChannelListView.cpp : implementation file
//


#include "stdafx.h"
#include "DiamondReader.h"
#include "ChannelListView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChannelListView

IMPLEMENT_DYNCREATE(CChannelListView, CFormView)

CChannelListView::CChannelListView()
	: CFormView(CChannelListView::IDD)
{
	//{{AFX_DATA_INIT(CChannelListView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	root = new DirNode("新建频道");
}

CChannelListView::~CChannelListView()
{
	delete root;
}

void CChannelListView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CChannelListView)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CChannelListView, CFormView)
	//{{AFX_MSG_MAP(CChannelListView)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
	ON_WM_SIZE()
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChannelListView diagnostics

#ifdef _DEBUG
void CChannelListView::AssertValid() const
{
	CFormView::AssertValid();
}

void CChannelListView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CChannelListView message handlers

void CChannelListView::OnInitialUpdate(){
	CRect rect;
	this->GetClientRect(&rect);
	m_tab.Create(TCS_TABS | TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE | TCS_OWNERDRAWFIXED,rect, this,ID_CHANNELTAB);
	m_tab.InsertItem(0,TEXT("频道列表"));
	m_tab.InsertItem(1,TEXT("收藏列表"));
	m_tab.initChildren();
	

}

void CChannelListView::OnSize(UINT nType, int cx, int cy){
	CRect rect;
	this->GetClientRect(&rect);
	if (m_tab.m_hWnd)
	{
		m_tab.MoveWindow(&rect);
	}

}

BOOL CChannelListView::deleteCategory(BOOL notify){
	return m_tab.deleteCategory(notify);
	
}

BOOL CChannelListView::addCategory(char* newname){
	return m_tab.addCategory(newname);
}

BOOL CChannelListView::addChannel(Channel *channel){
	return m_tab.addChannel(channel);
}

int CChannelListView::getSelId(){
	return m_tab.getSelId();
}

int CChannelListView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CFormView::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	// TODO: Add your specialized creation code here
	CRect rect;
	GetClientRect(&rect);

	rect.left = rect.right+7;
	rect.right = rect.right+12;
	rect.top = (rect.bottom-rect.top)/2-20;
	rect.bottom = rect.top+40;
//	m_hideView.Create(" ",WS_CHILD|WS_VISIBLE,rect,this,10000);
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -