diff options
Diffstat (limited to 'src/apps/mplayerc/OpenDlg.cpp')
-rw-r--r-- | src/apps/mplayerc/OpenDlg.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/src/apps/mplayerc/OpenDlg.cpp b/src/apps/mplayerc/OpenDlg.cpp index d6a1ad536..aeabb4826 100644 --- a/src/apps/mplayerc/OpenDlg.cpp +++ b/src/apps/mplayerc/OpenDlg.cpp @@ -31,11 +31,11 @@ //IMPLEMENT_DYNAMIC(COpenDlg, CResizableDialog)
COpenDlg::COpenDlg(CWnd* pParent /*=NULL*/)
- : CResizableDialog(COpenDlg::IDD, pParent)
- , m_path(_T(""))
- , m_path2(_T(""))
- , m_fMultipleFiles(false)
- , m_fAppendPlaylist(FALSE)
+ : CResizableDialog(COpenDlg::IDD, pParent)
+ , m_path(_T(""))
+ , m_path2(_T(""))
+ , m_fMultipleFiles(false)
+ , m_fAppendPlaylist(FALSE)
{
}
@@ -45,23 +45,23 @@ COpenDlg::~COpenDlg() void COpenDlg::DoDataExchange(CDataExchange* pDX)
{
- __super::DoDataExchange(pDX);
- DDX_Control(pDX, IDC_COMBO1, m_mrucombo);
- DDX_CBString(pDX, IDC_COMBO1, m_path);
- DDX_Control(pDX, IDC_COMBO2, m_mrucombo2);
- DDX_CBString(pDX, IDC_COMBO2, m_path2);
- DDX_Control(pDX, IDC_STATIC1, m_label2);
- DDX_Check(pDX, IDC_CHECK1, m_fAppendPlaylist);
+ __super::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_COMBO1, m_mrucombo);
+ DDX_CBString(pDX, IDC_COMBO1, m_path);
+ DDX_Control(pDX, IDC_COMBO2, m_mrucombo2);
+ DDX_CBString(pDX, IDC_COMBO2, m_path2);
+ DDX_Control(pDX, IDC_STATIC1, m_label2);
+ DDX_Check(pDX, IDC_CHECK1, m_fAppendPlaylist);
}
BEGIN_MESSAGE_MAP(COpenDlg, CResizableDialog)
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedBrowsebutton)
- ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedBrowsebutton2)
- ON_BN_CLICKED(IDOK, OnBnClickedOk)
- ON_UPDATE_COMMAND_UI(IDC_STATIC1, OnUpdateDub)
- ON_UPDATE_COMMAND_UI(IDC_COMBO2, OnUpdateDub)
- ON_UPDATE_COMMAND_UI(IDC_BUTTON2, OnUpdateDub)
+ ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedBrowsebutton)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedBrowsebutton2)
+ ON_BN_CLICKED(IDOK, OnBnClickedOk)
+ ON_UPDATE_COMMAND_UI(IDC_STATIC1, OnUpdateDub)
+ ON_UPDATE_COMMAND_UI(IDC_COMBO2, OnUpdateDub)
+ ON_UPDATE_COMMAND_UI(IDC_BUTTON2, OnUpdateDub)
END_MESSAGE_MAP()
@@ -69,127 +69,127 @@ END_MESSAGE_MAP() BOOL COpenDlg::OnInitDialog()
{
- __super::OnInitDialog();
-
- CRecentFileList& MRU = AfxGetAppSettings().MRU;
- MRU.ReadList();
- m_mrucombo.ResetContent();
- for(int i = 0; i < MRU.GetSize(); i++)
- if(!MRU[i].IsEmpty())
- m_mrucombo.AddString(MRU[i]);
- CorrectComboListWidth(m_mrucombo, GetFont());
-
- CRecentFileList& MRUDub = AfxGetAppSettings().MRUDub;
- MRUDub.ReadList();
- m_mrucombo2.ResetContent();
- for(int i = 0; i < MRUDub.GetSize(); i++)
- if(!MRUDub[i].IsEmpty())
- m_mrucombo2.AddString(MRUDub[i]);
- CorrectComboListWidth(m_mrucombo2, GetFont());
-
- if(m_mrucombo.GetCount() > 0) m_mrucombo.SetCurSel(0);
-
- AddAnchor(m_mrucombo, TOP_LEFT, TOP_RIGHT);
- AddAnchor(m_mrucombo2, TOP_LEFT, TOP_RIGHT);
- AddAnchor(IDC_BUTTON1, TOP_RIGHT);
- AddAnchor(IDC_BUTTON2, TOP_RIGHT);
- AddAnchor(IDOK, TOP_RIGHT);
- AddAnchor(IDCANCEL, TOP_RIGHT);
- AddAnchor(IDC_STATIC1, TOP_LEFT, TOP_RIGHT);
-
- CRect r;
- GetWindowRect(r);
- CSize s = r.Size();
- SetMinTrackSize(s);
- s.cx = 1000;
- SetMaxTrackSize(s);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
+ __super::OnInitDialog();
+
+ CRecentFileList& MRU = AfxGetAppSettings().MRU;
+ MRU.ReadList();
+ m_mrucombo.ResetContent();
+ for(int i = 0; i < MRU.GetSize(); i++)
+ if(!MRU[i].IsEmpty())
+ m_mrucombo.AddString(MRU[i]);
+ CorrectComboListWidth(m_mrucombo, GetFont());
+
+ CRecentFileList& MRUDub = AfxGetAppSettings().MRUDub;
+ MRUDub.ReadList();
+ m_mrucombo2.ResetContent();
+ for(int i = 0; i < MRUDub.GetSize(); i++)
+ if(!MRUDub[i].IsEmpty())
+ m_mrucombo2.AddString(MRUDub[i]);
+ CorrectComboListWidth(m_mrucombo2, GetFont());
+
+ if(m_mrucombo.GetCount() > 0) m_mrucombo.SetCurSel(0);
+
+ AddAnchor(m_mrucombo, TOP_LEFT, TOP_RIGHT);
+ AddAnchor(m_mrucombo2, TOP_LEFT, TOP_RIGHT);
+ AddAnchor(IDC_BUTTON1, TOP_RIGHT);
+ AddAnchor(IDC_BUTTON2, TOP_RIGHT);
+ AddAnchor(IDOK, TOP_RIGHT);
+ AddAnchor(IDCANCEL, TOP_RIGHT);
+ AddAnchor(IDC_STATIC1, TOP_LEFT, TOP_RIGHT);
+
+ CRect r;
+ GetWindowRect(r);
+ CSize s = r.Size();
+ SetMinTrackSize(s);
+ s.cx = 1000;
+ SetMaxTrackSize(s);
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
}
static CString GetFileName(CString str)
{
- CPath p = str;
- p.StripPath();
- return (LPCTSTR)p;
+ CPath p = str;
+ p.StripPath();
+ return (LPCTSTR)p;
}
void COpenDlg::OnBnClickedBrowsebutton()
{
- UpdateData();
-
- CString filter;
- CAtlArray<CString> mask;
- AfxGetAppSettings().Formats.GetFilter(filter, mask);
-
- COpenFileDlg fd(mask, true, NULL, m_path,
- OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY,
- filter, this);
- if(fd.DoModal() != IDOK) return;
-
- m_fns.RemoveAll();
-
- POSITION pos = fd.GetStartPosition();
- while(pos)
- {
- /*
- CString str = fd.GetNextPathName(pos);
- POSITION insertpos = m_fns.GetTailPosition();
- while(insertpos && GetFileName(str).CompareNoCase(GetFileName(m_fns.GetAt(insertpos))) <= 0)
- m_fns.GetPrev(insertpos);
- if(!insertpos) m_fns.AddHead(str);
- else m_fns.InsertAfter(insertpos, str);
- */
- m_fns.AddTail(fd.GetNextPathName(pos));
- }
-
- if(m_fns.GetCount() > 1
- || m_fns.GetCount() == 1
- && (m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '\\'
- || m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '*'))
- {
- m_fMultipleFiles = true;
- EndDialog(IDOK);
- return;
- }
-
- m_mrucombo.SetWindowText(fd.GetPathName());
+ UpdateData();
+
+ CString filter;
+ CAtlArray<CString> mask;
+ AfxGetAppSettings().Formats.GetFilter(filter, mask);
+
+ COpenFileDlg fd(mask, true, NULL, m_path,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ALLOWMULTISELECT|OFN_ENABLEINCLUDENOTIFY,
+ filter, this);
+ if(fd.DoModal() != IDOK) return;
+
+ m_fns.RemoveAll();
+
+ POSITION pos = fd.GetStartPosition();
+ while(pos)
+ {
+ /*
+ CString str = fd.GetNextPathName(pos);
+ POSITION insertpos = m_fns.GetTailPosition();
+ while(insertpos && GetFileName(str).CompareNoCase(GetFileName(m_fns.GetAt(insertpos))) <= 0)
+ m_fns.GetPrev(insertpos);
+ if(!insertpos) m_fns.AddHead(str);
+ else m_fns.InsertAfter(insertpos, str);
+ */
+ m_fns.AddTail(fd.GetNextPathName(pos));
+ }
+
+ if(m_fns.GetCount() > 1
+ || m_fns.GetCount() == 1
+ && (m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '\\'
+ || m_fns.GetHead()[m_fns.GetHead().GetLength()-1] == '*'))
+ {
+ m_fMultipleFiles = true;
+ EndDialog(IDOK);
+ return;
+ }
+
+ m_mrucombo.SetWindowText(fd.GetPathName());
}
void COpenDlg::OnBnClickedBrowsebutton2()
{
- UpdateData();
+ UpdateData();
- CString filter;
- CAtlArray<CString> mask;
- AfxGetAppSettings().Formats.GetAudioFilter(filter, mask);
+ CString filter;
+ CAtlArray<CString> mask;
+ AfxGetAppSettings().Formats.GetAudioFilter(filter, mask);
- COpenFileDlg fd(mask, false, NULL, m_path2,
- OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ENABLEINCLUDENOTIFY,
- filter, this);
+ COpenFileDlg fd(mask, false, NULL, m_path2,
+ OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_ENABLEINCLUDENOTIFY,
+ filter, this);
- if(fd.DoModal() != IDOK) return;
+ if(fd.DoModal() != IDOK) return;
- m_mrucombo2.SetWindowText(fd.GetPathName());
+ m_mrucombo2.SetWindowText(fd.GetPathName());
}
void COpenDlg::OnBnClickedOk()
{
- UpdateData();
+ UpdateData();
- m_fns.RemoveAll();
- m_fns.AddTail(m_path);
- if(m_mrucombo2.IsWindowEnabled())
- m_fns.AddTail(m_path2);
+ m_fns.RemoveAll();
+ m_fns.AddTail(m_path);
+ if(m_mrucombo2.IsWindowEnabled())
+ m_fns.AddTail(m_path2);
- m_fMultipleFiles = false;
+ m_fMultipleFiles = false;
- OnOK();
+ OnOK();
}
void COpenDlg::OnUpdateDub(CCmdUI* pCmdUI)
{
- m_mrucombo.GetWindowText(m_path);
- pCmdUI->Enable(AfxGetAppSettings().Formats.GetEngine(m_path) == DirectShow);
+ m_mrucombo.GetWindowText(m_path);
+ pCmdUI->Enable(AfxGetAppSettings().Formats.GetEngine(m_path) == DirectShow);
}
|