📄 dlgstatementman.cpp
字号:
// DlgStatementMan.cpp : implementation file
//
#include "stdafx.h"
#include "eboard.h"
//包含的头文件
#include "EboardDoc.h"
#include "Statement.h"
#include "DlgStatementMan.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// DlgStatementMan dialog
DlgStatementMan::DlgStatementMan(CWnd* pParent /*=NULL*/)
: CDialog(DlgStatementMan::IDD, pParent)
{
//{{AFX_DATA_INIT(DlgStatementMan)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void DlgStatementMan::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DlgStatementMan)
DDX_Control(pDX, IDC_STATEMENTLIST, m_ctrList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DlgStatementMan, CDialog)
//{{AFX_MSG_MAP(DlgStatementMan)
ON_BN_CLICKED(IDC_STATEMENTDEL, OnStatementdel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// DlgStatementMan message handlers
BOOL DlgStatementMan::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
Statement *s=NULL;
int size=m_pDoc->m_co.stateArray.GetSize();
//遍历图形数组,并将图形数组中的每一个图形结点的表达式加入对话框中的列表框中
for(int i=0;i<size;i++){
s=(Statement *)m_pDoc->m_co.stateArray.GetAt(i);
m_ctrList.AddString(s->getStatement());
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void DlgStatementMan::OnStatementdel() //注释管理对话框中的(按下)擦去键的消息处理函数
{
// TODO: Add your control notification handler code here
int n=m_ctrList.GetCurSel(); //获取列表模框中的当前选中项的下标值
if(n>=0){
if(IDYES==MessageBox("确定要删除选中的注释吗?","询问",MB_ICONINFORMATION | MB_YESNO)){
m_ctrList.DeleteString(n); //删除列表框中选中的项
m_pDoc->m_co.delState(n); //删除该项对应的注释数组中的图形
m_pDoc->UpdateAllViews(NULL); //刷新视图
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -