8fb9abc5fd4abe3e87f182efc5095e8d41ea11d4
[openafs.git] / src / WINNT / client_exp / mount_points_dlg.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 extern "C" {
11 #include <afs/param.h>
12 #include <afs/stds.h>
13 }
14
15 #include "stdafx.h"
16 #include "afs_shl_ext.h"
17 #include "mount_points_dlg.h"
18
19 #ifdef _DEBUG
20 #define new DEBUG_NEW
21 #undef THIS_FILE
22 static char THIS_FILE[] = __FILE__;
23 #endif
24
25 /////////////////////////////////////////////////////////////////////////////
26 // CMountPointsDlg dialog
27
28
29 CMountPointsDlg::CMountPointsDlg(CWnd* pParent /*=NULL*/)
30         : CDialog()
31 {
32         InitModalIndirect (TaLocale_GetDialogResource (CMountPointsDlg::IDD), pParent);
33
34         //{{AFX_DATA_INIT(CMountPointsDlg)
35                 // NOTE: the ClassWizard will add member initialization here
36         //}}AFX_DATA_INIT
37 }
38
39
40 void CMountPointsDlg::DoDataExchange(CDataExchange* pDX)
41 {
42         CDialog::DoDataExchange(pDX);
43         //{{AFX_DATA_MAP(CMountPointsDlg)
44         DDX_Control(pDX, IDC_LIST, m_List);
45         //}}AFX_DATA_MAP
46 }
47
48
49 BEGIN_MESSAGE_MAP(CMountPointsDlg, CDialog)
50         //{{AFX_MSG_MAP(CMountPointsDlg)
51         ON_BN_CLICKED(IDHELP, OnHelp)
52         //}}AFX_MSG_MAP
53 END_MESSAGE_MAP()
54
55 /////////////////////////////////////////////////////////////////////////////
56 // CMountPointsDlg message handlers
57
58 BOOL CMountPointsDlg::OnInitDialog() 
59 {
60         CDialog::OnInitDialog();
61
62         int tabs[] = { 64, 145, 220 };
63         
64         m_List.SetTabStops(sizeof(tabs) / sizeof(int), tabs);
65
66         for (int i = 0; i < m_MountPoints.GetSize(); i++)
67                 m_List.AddString(m_MountPoints[i]);
68
69         return TRUE;  // return TRUE unless you set the focus to a control
70                       // EXCEPTION: OCX Property Pages should return FALSE
71 }
72
73 void CMountPointsDlg::SetMountPoints(const CStringArray& mountPoints)
74 {
75         m_MountPoints.RemoveAll();
76
77         m_MountPoints.Copy(mountPoints);
78 }
79
80 void CMountPointsDlg::OnHelp() 
81 {
82         ShowHelp(m_hWnd, MOUNT_POINTS_HELP_ID);
83 }
84