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

📄 manualreductdlg.cpp

📁 某个实验事编写粗糙集智能信息处理的程序
💻 CPP
字号:
// ManualReductDlg.cpp : implementation file
//

#include "stdafx.h"
#include "rset.h"
#include "ManualReductDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CManualReductDlg dialog


CManualReductDlg::CManualReductDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CManualReductDlg::IDD, pParent)
{
	pStr=0;		//待显示的字符串
	nCount=0;			//字符串的个数
	pBool=0;
	//{{AFX_DATA_INIT(CManualReductDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}

CManualReductDlg::CManualReductDlg( char** str,int count,bool* b,CWnd* pParent/*=NULL*/)
	: CDialog(CManualReductDlg::IDD, pParent)
{
	pStr=str;		//待显示的属性名称字符串
	nCount=count;			//属性个数//字符串的个数
	pBool=b;   //对各个属性选择的标志,true为选中,false为不选
	
	//{{AFX_DATA_INIT(CManualReductDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}
void CManualReductDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CManualReductDlg)
	DDX_Control(pDX, IDC_LIST, m_list);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CManualReductDlg, CDialog)
	//{{AFX_MSG_MAP(CManualReductDlg)
	ON_BN_CLICKED(IDC_SELECT_ALL, OnSelectAll)
	ON_BN_CLICKED(IDC_CLEAR_ALL, OnClearAll)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CManualReductDlg message handlers


BOOL CManualReductDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_list.SetExtendedStyle(LVS_EX_CHECKBOXES|LVS_EX_FULLROWSELECT);

	m_list.InsertColumn(0,"属性名称");
	m_list.SetColumnWidth(0,120);
	if(nCount!=0 && pStr!=0)
	{
		// 把内容显示到listbox中
		for(int i=nCount-1;i>=0;i--)
			m_list.InsertItem(0,pStr[i]);
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CManualReductDlg::OnSelectAll() 
{
	for(int i=0;i<m_list.GetItemCount();i++)
		m_list.SetCheck(i);
}

void CManualReductDlg::OnClearAll() 
{
	for(int i=0;i<m_list.GetItemCount();i++)
		m_list.SetCheck(i,false);
}


void CManualReductDlg::OnOK()
{
	for(int i=0;i<m_list.GetItemCount();i++)
	{
		if(m_list.GetCheck(i))
			pBool[i]=true;//要保留的属性
		else 
			pBool[i]=false;//要删除的属性
	}
	CDialog::OnOK();
}

⌨️ 快捷键说明

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