skyrope-mit-merge-hell-20040226
[openafs.git] / src / WINNT / win9xpanel / Retry.cpp
1 /* Copyright 2000, International Business Machines Corporation and others.
2         All Rights Reserved.
3  
4         This software has been released under the terms of the IBM Public
5         License.  For details, see the LICENSE file in the top-level source
6         directory or online at http://www.openafs.org/dl/license10.html
7 */
8 // Retry.cpp : implementation file
9 //
10
11 #include "stdafx.h"
12 #include "winafsload.h"
13 #include "Retry.h"
14
15 #ifdef _DEBUG
16 #define new DEBUG_NEW
17 #undef THIS_FILE
18 static char THIS_FILE[] = __FILE__;
19 #endif
20
21 /////////////////////////////////////////////////////////////////////////////
22 // CRetry dialog
23
24
25 CRetry::CRetry(BOOL force,CWnd* pParent /*=NULL*/)
26         : CDialog(CRetry::IDD, pParent)
27 {
28         //{{AFX_DATA_INIT(CRetry)
29         m_sMsg = _T("");
30         //}}AFX_DATA_INIT
31         m_force=force;
32 }
33
34
35 void CRetry::DoDataExchange(CDataExchange* pDX)
36 {
37         CDialog::DoDataExchange(pDX);
38         //{{AFX_DATA_MAP(CRetry)
39         DDX_Control(pDX, IDC_STATICOPTIONS, m_cOptions);
40         DDX_Control(pDX, IDC_FORCE, m_cForce);
41         DDX_Text(pDX, IDC_STATICMSG, m_sMsg);
42         //}}AFX_DATA_MAP
43 }
44
45
46 BEGIN_MESSAGE_MAP(CRetry, CDialog)
47         //{{AFX_MSG_MAP(CRetry)
48         ON_BN_CLICKED(IDC_FORCE, OnForceDismont)
49         //}}AFX_MSG_MAP
50 END_MESSAGE_MAP()
51
52 /////////////////////////////////////////////////////////////////////////////
53 // CRetry message handlers
54
55 void CRetry::OnForceDismont() 
56 {
57         // TODO: Add your control notification handler code here
58         EndDialog(IDC_FORCE); 
59 }
60
61 BOOL CRetry::OnInitDialog() 
62 {
63         CDialog::OnInitDialog();
64         
65         // TODO: Add extra initialization here
66         
67         if (m_force)
68         {
69                 m_cForce.ModifyStyle(WS_DISABLED,0,0);
70                 m_cOptions.SetWindowText("You map shut down any applications that are using the drive letter and then press Retry.  Or press Cancel to the bypass the disconnect.\nYou may over-ride the file protection (possible loss of 'opened' file data) and slect Force to disconnect.");
71         }else {
72                 m_cForce.ModifyStyle(0,WS_DISABLED,0);
73                 m_cOptions.SetWindowText("You may shut down any applications that are using the drive letter and then press Retry.  Or press Cancel to the bypass the disconnect.\n('Force' is not premitted.)");
74         }
75                 
76         return TRUE;  // return TRUE unless you set the focus to a control
77                       // EXCEPTION: OCX Property Pages should return FALSE
78 }