Click here to Skip to main content
15,885,985 members
Articles / Desktop Programming / MFC

Another Report List Control

Rate me:
Please Sign up or sign in to vote.
4.89/5 (95 votes)
31 Dec 20036 min read 1.3M   17.4K   235  
A report style CListCtrl supporting sorting, sub-item editing, sub-item image, sub-item color etc.
// SepDlg.cpp : implementation file
//

#include "stdafx.h"
#include "RCSeparator.h"
#include "SepDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSepDlg dialog


CSepDlg::CSepDlg(BOOL bNoSep, LPCTSTR lpSep, CWnd* pParent /*=NULL*/)
	: CDialog(CSepDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CSepDlg)
	m_bNoSep = FALSE;
	m_sSep = _T("");
	//}}AFX_DATA_INIT
	m_bNoSep = bNoSep;
	if (!m_bNoSep)
		m_sSep = lpSep;
}


void CSepDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSepDlg)
	DDX_Control(pDX, IDC_EDIT1, m_wndSep);
	DDX_Check(pDX, IDC_CHECK1, m_bNoSep);
	DDX_Text(pDX, IDC_EDIT1, m_sSep);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSepDlg, CDialog)
	//{{AFX_MSG_MAP(CSepDlg)
	ON_BN_CLICKED(IDC_CHECK1, OnCheck1)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSepDlg message handlers

BOOL CSepDlg::UseSep() const
{
	return !m_bNoSep;
}

CString CSepDlg::GetSep() const
{
	return m_sSep;
}

BOOL CSepDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_wndSep.EnableWindow(!m_bNoSep);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CSepDlg::OnCheck1() 
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	m_wndSep.EnableWindow(!m_bNoSep);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions