arithdemarkpackview.cpp

来自「师兄做的算法可视化演示程序」· C++ 代码 · 共 88 行

CPP
88
字号
// ArithDemarkPackView.cpp : implementation file
//

#include "stdafx.h"
#include "AlgorithmicDesign.h"
#include "ArithDemarkPackView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CArithDemarkPackView

IMPLEMENT_DYNCREATE(CArithDemarkPackView, CListView)

CArithDemarkPackView::CArithDemarkPackView()
{
}

CArithDemarkPackView::~CArithDemarkPackView()
{
}


BEGIN_MESSAGE_MAP(CArithDemarkPackView, CListView)
	//{{AFX_MSG_MAP(CArithDemarkPackView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CArithDemarkPackView drawing

void CArithDemarkPackView::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
}

/////////////////////////////////////////////////////////////////////////////
// CArithDemarkPackView diagnostics

#ifdef _DEBUG
void CArithDemarkPackView::AssertValid() const
{
	CListView::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// CArithDemarkPackView message handlers

void CArithDemarkPackView::OnInitialUpdate() 
{
	CListView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CListCtrl& theCtrl = GetListCtrl();	
	theCtrl.InsertColumn(0,"  算法  ",LVCFMT_CENTER,441);
	DWORD dwStype=GetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE);
	dwStype&=~LVS_TYPEMASK;		//Remove the current stype flags
	dwStype|=LVS_REPORT;		//Add the List stype
	dwStype|=LVS_SHOWSELALWAYS;
	dwStype|=LVS_NOLABELWRAP;
	SetWindowLong(theCtrl.GetSafeHwnd(),GWL_STYLE,dwStype);	//Set it back into the list view

	 DWORD dwStyle =  theCtrl.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE,0,0);
	 dwStyle |= LVS_EX_FULLROWSELECT ;//| LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP;
	 theCtrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (LPARAM)dwStyle);

	 DWORD dwEx =  theCtrl.GetExtendedStyle();
	 theCtrl.SetExtendedStyle(dwEx|LVS_EX_FLATSB);
	 SetRedraw(true);

	 COLORREF	clrBk	=RGB(150, 175, 230);
	 theCtrl.SetBkColor( clrBk);
     theCtrl.SetTextBkColor(clrBk);
	
}

⌨️ 快捷键说明

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