pathinputdlg.cpp

来自「很珍贵得视频编辑器原码及CODEC。需要安装下列CODEC.可播放多种格式的视频」· C++ 代码 · 共 105 行

CPP
105
字号
// PathInputDlg.cpp : implementation file
//

#include "stdafx.h"
#include "magicscissors.h"
#include "PathInputDlg.h"
#include "DirDialog.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPathInputDlg dialog


CPathInputDlg::CPathInputDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPathInputDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPathInputDlg)
	m_strBase = _T("");
	m_strStereo = _T("");
	m_strLeft = _T("");
	m_strRight = _T("");
	m_strSeg = _T("");
	m_nFrame = 0;
	//}}AFX_DATA_INIT
}


void CPathInputDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPathInputDlg)
	DDX_Text(pDX, IDC_EDIT1, m_strBase);
	DDX_Text(pDX, IDC_EDIT2, m_strStereo);
	DDX_Text(pDX, IDC_EDIT3, m_strLeft);
	DDX_Text(pDX, IDC_EDIT4, m_strRight);
	DDX_Text(pDX, IDC_EDIT5, m_strSeg);
	DDX_Text(pDX, IDC_EDIT6, m_nFrame);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CPathInputDlg, CDialog)
	//{{AFX_MSG_MAP(CPathInputDlg)
	ON_BN_CLICKED(IDC_SET_PATH, OnSetPath)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPathInputDlg message handlers

void CPathInputDlg::OnSetPath() 
{
	// TODO: Add your control notification handler code here
	UpdateData();
	CDirDialog dlg;
	dlg.m_strTitle = "版肺 汲沥";
	dlg.m_strSelDir = m_strBase;	
	CString tmp;
	int l;
	if( dlg.DoBrowse() == IDOK )
	{
		m_strBase = dlg.m_strPath;
		l = m_strStereo.ReverseFind('\\');
		tmp = m_strStereo.Left(l);
		l = tmp.ReverseFind('\\');
		tmp = tmp.Left(l);
		l = tmp.GetLength();
		m_strStereo = m_strStereo.Right(m_strStereo.GetLength()-l);
		m_strStereo = m_strBase + m_strStereo;

		l = m_strLeft.ReverseFind('\\');
		tmp = m_strLeft.Left(l);
		l = tmp.ReverseFind('\\');
		tmp = tmp.Left(l);
		l = tmp.GetLength();
		m_strLeft = m_strLeft.Right(m_strLeft.GetLength()-l);
		m_strLeft = m_strBase + m_strLeft;

		l = m_strRight.ReverseFind('\\');
		tmp = m_strRight.Left(l);
		l = tmp.ReverseFind('\\');
		tmp = tmp.Left(l);
		l = tmp.GetLength();
		m_strRight = m_strRight.Right(m_strRight.GetLength()-l);
		m_strRight = m_strBase + m_strRight;

		l = m_strSeg.ReverseFind('\\');
		tmp = m_strSeg.Left(l);
		l = tmp.ReverseFind('\\');
		tmp = tmp.Left(l);
		l = tmp.GetLength();
		m_strSeg = m_strSeg.Right(m_strSeg.GetLength()-l);
		m_strSeg = m_strBase + m_strSeg;

		UpdateData(FALSE);

	}

}

⌨️ 快捷键说明

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