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

📄 questiondlg.cpp

📁 clips的ocx控件,很有用
💻 CPP
字号:
// QuestionDlg.cpp : implementation file
//

#include "stdafx.h"
#include "CLIPS.h"
#include "QuestionDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CQuestionDlg dialog


CQuestionDlg::CQuestionDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CQuestionDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CQuestionDlg)
	m_Question = _T("");
	//}}AFX_DATA_INIT
}


void CQuestionDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CQuestionDlg)
	DDX_Control(pDX, IDC_ANSWER, m_List);
	DDX_Text(pDX, IDC_QUESTION, m_Question);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CQuestionDlg, CDialog)
	//{{AFX_MSG_MAP(CQuestionDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CQuestionDlg message handlers

void CQuestionDlg::OnOK() 
{
	//get the currently selected text
	m_List.GetText(m_List.GetCurSel(), m_Selection);
	//clear out the list box
	while(m_List.DeleteString(0) > 0);
	//return
	CDialog::OnOK();
}

BOOL CQuestionDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	CString tStr;
	int     idx;
	int     start = 1, hold = 0;
	
	//start parsing the string for space delimited data
	//we know the format of the string is (xxx yyy zzzz) and we do not
	//want to see the '(' or ')' either
	idx = m_Answers.Find(" ");
	while(idx != -1)	{
		tStr = m_Answers.Mid(start, idx - start);
		tStr.TrimRight(" ");
		m_List.AddString((LPCSTR)tStr);
		start = idx + 1;
		idx = m_Answers.Find(" ", start);
	}
	//get the last one
	tStr = m_Answers.Mid(start, m_Answers.GetLength() - 1 - start);
	m_List.AddString((LPCSTR)tStr);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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