📄 extractiondialog.cpp
字号:
// ExtractionDialog.cpp : implementation file
//
#include "stdafx.h"
#include "linjunjuan.h"
#include "ExtractionDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExtractionDialog dialog
CExtractionDialog::CExtractionDialog(CWnd* pParent /*=NULL*/)
: CDialog(CExtractionDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CExtractionDialog)
m_input_filename = _T("");
m_output_filename = _T("");
m_layernum = 0;
//}}AFX_DATA_INIT
}
void CExtractionDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExtractionDialog)
DDX_Text(pDX, IDC_INPUTNAME, m_input_filename);
DDX_Text(pDX, IDC_OUTPUTNAME, m_output_filename);
DDX_Text(pDX, IDC_EDIT3, m_layernum);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExtractionDialog, CDialog)
//{{AFX_MSG_MAP(CExtractionDialog)
ON_BN_CLICKED(IDC_OUTPUT_BUTTON, OnOutputButton)
ON_BN_CLICKED(IDC_INPUT_BUTTON, OnInputButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExtractionDialog message handlers
void CExtractionDialog::OnOutputButton()
{
char ext[] = "picture types (*.*)|*.*|";
CFileDialog dlg(FALSE,NULL ,NULL,OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);
if(dlg.DoModal() == IDOK)
{
m_output_filename=dlg.GetPathName();
}
UpdateData(FALSE);
}
void CExtractionDialog::OnInputButton()
{
char ext[] = "picture types (*.bmp)|*.bmp|picture types (*.pic)|*.pic||";
CFileDialog dlg(TRUE,"bmp" ,"*.bmp",OFN_OVERWRITEPROMPT|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY ,ext, NULL);
if(dlg.DoModal() == IDOK)
{
m_input_filename=dlg.GetPathName();
}
UpdateData(FALSE);
}
void CExtractionDialog::OnOK()
{
UpdateData(TRUE);
if(m_input_filename=="")
{
AfxMessageBox("没有输入文件名及路径!");
OnInputButton();
}
if(m_output_filename=="")
{
AfxMessageBox("没有输出文件名及路径!");
OnOutputButton();
}
CDialog::OnOK();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -