📄 sysgraph.cpp
字号:
// SysGraph.cpp : implementation file
//
#include "stdafx.h"
#include "SymBol.h"
#include "SysGraph.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SysGraph dialog
SysGraph::SysGraph(CWnd* pParent /*=NULL*/)
: CDialog(SysGraph::IDD, pParent)
{
//{{AFX_DATA_INIT(SysGraph)
//}}AFX_DATA_INIT
}
void SysGraph::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SysGraph)
DDX_Control(pDX, IDC_LIST_TGRAPH, m_list);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SysGraph, CDialog)
//{{AFX_MSG_MAP(SysGraph)
ON_BN_CLICKED(IDC_BTN_READ, OnBtnRead)
ON_BN_CLICKED(IDC_BTN_RESIS, OnBtnResis)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SysGraph message handlers
int SysGraph::DoModal()
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::DoModal();
}
BOOL SysGraph::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_list.SetExtendedStyle(LVS_EX_FLATSB|LVS_EX_FULLROWSELECT|LVS_EX_HEADERDRAGDROP|LVS_EX_ONECLICKACTIVATE|LVS_EX_GRIDLINES);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void SysGraph::OnBtnRead()
{
// TODO: Add your control notification handler code here
CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT,"ALL Files(*.*)|*.*||",AfxGetMainWnd());
CString filename;
if (dlg.DoModal()==IDOK)
{
filename=dlg.GetFileName();
staticFileName=filename;
RF.ReadFileFromFun(filename);
m_list.InsertColumn(0,"Order",LVCFMT_LEFT,150,0);
m_list.InsertColumn(1,"产生式",LVCFMT_LEFT,150,1);
for (int i=0;i<RF.ncount;i++)
{
m_list.InsertItem(i,"");
CString strTemp;
strTemp.Format("%d",i+1);
m_list.SetItemText(i,0,strTemp);
m_list.SetItemText(i,1,RF.pstrFileData[i]);
}
}
}
void SysGraph::OnBtnResis()
{
this->OnOK();
}
void SysGraph::OnCancel()
{
exit(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -