1 /*
2  * Portions Copyright (C) 2004, 2007  Internet Systems Consortium, Inc. ("ISC")
3  * Portions Copyright (C) 2001  Internet Software Consortium.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15  * PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 /* Id: DirBrowse.cpp,v 1.6 2007/06/19 23:47:07 tbox Exp  */
19 
20 /*
21  * Copyright (c) 1999-2000 by Nortel Networks Corporation
22  *
23  * Permission to use, copy, modify, and distribute this software for any
24  * purpose with or without fee is hereby granted, provided that the above
25  * copyright notice and this permission notice appear in all copies.
26  *
27  * THE SOFTWARE IS PROVIDED "AS IS" AND NORTEL NETWORKS DISCLAIMS
28  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
29  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL NORTEL NETWORKS
30  * BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
31  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
32  * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
33  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
34  * SOFTWARE.
35  */
36 
37 #include "stdafx.h"
38 #include "BINDInstall.h"
39 #include "DirBrowse.h"
40 
41 #ifdef _DEBUG
42 #define new DEBUG_NEW
43 #undef THIS_FILE
44 static char THIS_FILE[] = __FILE__;
45 #endif
46 
47 /////////////////////////////////////////////////////////////////////////////
48 // CDirBrowse dialog
49 
50 
CDirBrowse(CString initialDir,CWnd * pParent)51 CDirBrowse::CDirBrowse(CString initialDir, CWnd* pParent /*=NULL*/)
52 	: CDialog(CDirBrowse::IDD, pParent)
53 {
54 	//{{AFX_DATA_INIT(CDirBrowse)
55 		// NOTE: the ClassWizard will add member initialization here
56 	//}}AFX_DATA_INIT
57 	m_selectedDir = initialDir;
58 }
59 
60 
DoDataExchange(CDataExchange * pDX)61 void CDirBrowse::DoDataExchange(CDataExchange* pDX)
62 {
63 	CDialog::DoDataExchange(pDX);
64 	//{{AFX_DATA_MAP(CDirBrowse)
65 		// NOTE: the ClassWizard will add DDX and DDV calls here
66 	//}}AFX_DATA_MAP
67 }
68 
69 
BEGIN_MESSAGE_MAP(CDirBrowse,CDialog)70 BEGIN_MESSAGE_MAP(CDirBrowse, CDialog)
71 	//{{AFX_MSG_MAP(CDirBrowse)
72 	ON_LBN_DBLCLK(IDC_DIRLIST, OnDblclkDirlist)
73 	ON_LBN_SELCHANGE(IDC_DIRLIST, OnSelchangeDirlist)
74 	//}}AFX_MSG_MAP
75 END_MESSAGE_MAP()
76 
77 /////////////////////////////////////////////////////////////////////////////
78 // CDirBrowse message handlers
79 
80 BOOL CDirBrowse::OnInitDialog()
81 {
82 	CDialog::OnInitDialog();
83 
84 	DlgDirList((LPTSTR)(LPCTSTR)m_selectedDir, IDC_DIRLIST, IDC_CURDIR, DDL_DIRECTORY);
85 
86 	return TRUE;  // return TRUE unless you set the focus to a control
87 	              // EXCEPTION: OCX Property Pages should return FALSE
88 }
89 
OnDblclkDirlist()90 void CDirBrowse::OnDblclkDirlist()
91 {
92 	CListBox *lb = (CListBox *)GetDlgItem(IDC_DIRLIST);
93 	CString curSel;
94 
95 	lb->GetText(lb->GetCurSel(), curSel);
96 	DlgDirList((LPTSTR)(LPCTSTR)curSel, IDC_DIRLIST, IDC_CURDIR, DDL_DIRECTORY);
97 }
98 
OnSelchangeDirlist()99 void CDirBrowse::OnSelchangeDirlist()
100 {
101 	// TODO: Add your control notification handler code here
102 
103 }
104