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 "partition_info_dlg.h"
25 static char THIS_FILE[] = __FILE__;
28 /////////////////////////////////////////////////////////////////////////////
29 // CPartitionInfoDlg dialog
32 CPartitionInfoDlg::CPartitionInfoDlg(CWnd* pParent /*=NULL*/)
35 InitModalIndirect (TaLocale_GetDialogResource (CPartitionInfoDlg::IDD), pParent);
37 //{{AFX_DATA_INIT(CPartitionInfoDlg)
38 // NOTE: the ClassWizard will add member initialization here
44 void CPartitionInfoDlg::DoDataExchange(CDataExchange* pDX)
46 CDialog::DoDataExchange(pDX);
47 //{{AFX_DATA_MAP(CPartitionInfoDlg)
48 DDX_Control(pDX, IDC_TOTAL_SIZE, m_Size);
49 DDX_Control(pDX, IDC_PERCENT_USED, m_PercentUsed);
50 DDX_Control(pDX, IDC_BLOCKS_FREE, m_Free);
54 BEGIN_MESSAGE_MAP(CPartitionInfoDlg, CDialog)
55 //{{AFX_MSG_MAP(CPartitionInfoDlg)
56 ON_BN_CLICKED(IDHELP, OnHelp)
60 /////////////////////////////////////////////////////////////////////////////
61 // CPartitionInfoDlg message handlers
63 BOOL CPartitionInfoDlg::OnInitDialog()
65 double percentUsed; // because partition sizes are big
67 CDialog::OnInitDialog();
72 strSize.Format("%ld", m_nSize);
75 strFree.Format("%ld", m_nFree);
78 strPerUsed.Format("%d", ((m_nSize - m_nFree) * 100) / m_nSize);
80 m_Size.SetWindowText(strSize);
81 m_Free.SetWindowText(strFree);
82 percentUsed = ( double(m_nSize - m_nFree) * 100.0l ) / double(m_nSize);
83 strPerUsed.Format("%2.2lf", percentUsed );
85 return TRUE; // return TRUE unless you set the focus to a control
86 // EXCEPTION: OCX Property Pages should return FALSE
89 void CPartitionInfoDlg::OnHelp()
91 ShowHelp(m_hWnd, PARTITION_INFO_HELP_ID);