2 * Copyright 2000, International Business Machines Corporation and others.
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
15 #include <afs/param.h>
19 #include "afs_shl_ext.h"
20 #include "make_mount_point_dlg.h"
26 static char THIS_FILE
[] = __FILE__
;
29 /////////////////////////////////////////////////////////////////////////////
30 // CMakeMountPointDlg dialog
33 CMakeMountPointDlg::CMakeMountPointDlg(CWnd
* pParent
/*=NULL*/)
36 InitModalIndirect (TaLocale_GetDialogResource (CMakeMountPointDlg::IDD
), pParent
);
38 //{{AFX_DATA_INIT(CMakeMountPointDlg)
46 void CMakeMountPointDlg::DoDataExchange(CDataExchange
* pDX
)
48 CDialog::DoDataExchange(pDX
);
49 //{{AFX_DATA_MAP(CMakeMountPointDlg)
50 DDX_Control(pDX
, IDOK
, m_Ok
);
51 DDX_Control(pDX
, IDC_VOLUME
, m_Vol
);
52 DDX_Control(pDX
, IDC_RW
, m_RW
);
53 DDX_Control(pDX
, IDC_DIR
, m_Dir
);
54 DDX_Control(pDX
, IDC_CELL
, m_Cell
);
55 DDX_Radio(pDX
, IDC_REGULAR
, m_nType
);
60 BEGIN_MESSAGE_MAP(CMakeMountPointDlg
, CDialog
)
61 //{{AFX_MSG_MAP(CMakeMountPointDlg)
62 ON_EN_CHANGE(IDC_VOLUME
, OnChangeVolume
)
63 ON_EN_CHANGE(IDC_DIR
, OnChangeDir
)
64 ON_EN_CHANGE(IDC_CELL
, OnChangeCell
)
65 ON_BN_CLICKED(IDHELP
, OnHelp
)
69 /////////////////////////////////////////////////////////////////////////////
70 // CMakeMountPointDlg message handlers
72 void CMakeMountPointDlg::OnOK()
76 BOOL bRW
= m_nType
== 1;
78 m_bMade
= MakeMount(m_strDir
, m_strVol
, m_strCell
, bRW
);
83 void CMakeMountPointDlg::OnChangeVolume()
86 m_Vol
.GetWindowText(strVol
);
87 if (strVol
.GetLength() > 63) {
88 MessageBeep((UINT
)-1);
89 m_Vol
.SetWindowText(m_strVol
);
96 void CMakeMountPointDlg::OnChangeDir()
98 m_Dir
.GetWindowText(m_strDir
);
103 void CMakeMountPointDlg::OnChangeCell()
105 m_Cell
.GetWindowText(m_strCell
);
110 void CMakeMountPointDlg::CheckEnableOk()
112 BOOL bEnable
= FALSE
;
114 if ((m_strVol
.GetLength() > 0) && (m_strDir
.GetLength() > 0))
117 m_Ok
.EnableWindow(bEnable
);
120 BOOL
CMakeMountPointDlg::OnInitDialog()
122 CDialog::OnInitDialog();
124 m_Dir
.SetWindowText(m_strDir
);
130 return TRUE
; // return TRUE unless you set the focus to a control
131 // EXCEPTION: OCX Property Pages should return FALSE
134 void CMakeMountPointDlg::OnHelp()
136 ShowHelp(m_hWnd
, MAKE_MOUNT_POINT_HELP_ID
);