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
11 #include <afs/param.h>
16 #include "afs_shl_ext.h"
17 #include "partition_info_dlg.h"
22 static char THIS_FILE[] = __FILE__;
25 /////////////////////////////////////////////////////////////////////////////
26 // CPartitionInfoDlg dialog
29 CPartitionInfoDlg::CPartitionInfoDlg(CWnd* pParent /*=NULL*/)
32 InitModalIndirect (TaLocale_GetDialogResource (CPartitionInfoDlg::IDD), pParent);
34 //{{AFX_DATA_INIT(CPartitionInfoDlg)
35 // NOTE: the ClassWizard will add member initialization here
41 void CPartitionInfoDlg::DoDataExchange(CDataExchange* pDX)
43 CDialog::DoDataExchange(pDX);
44 //{{AFX_DATA_MAP(CPartitionInfoDlg)
45 DDX_Control(pDX, IDC_TOTAL_SIZE, m_Size);
46 DDX_Control(pDX, IDC_PERCENT_USED, m_PercentUsed);
47 DDX_Control(pDX, IDC_BLOCKS_FREE, m_Free);
51 BEGIN_MESSAGE_MAP(CPartitionInfoDlg, CDialog)
52 //{{AFX_MSG_MAP(CPartitionInfoDlg)
53 ON_BN_CLICKED(IDHELP, OnHelp)
57 /////////////////////////////////////////////////////////////////////////////
58 // CPartitionInfoDlg message handlers
60 BOOL CPartitionInfoDlg::OnInitDialog()
62 double percentUsed; // because partition sizes are big
64 CDialog::OnInitDialog();
69 strSize.Format("%ld", m_nSize);
72 strFree.Format("%ld", m_nFree);
75 strPerUsed.Format("%d", ((m_nSize - m_nFree) * 100) / m_nSize);
77 m_Size.SetWindowText(strSize);
78 m_Free.SetWindowText(strFree);
79 percentUsed = ( double(m_nSize - m_nFree) * 100.0l ) / double(m_nSize);
80 strPerUsed.Format("%2.2lf", percentUsed );
82 return TRUE; // return TRUE unless you set the focus to a control
83 // EXCEPTION: OCX Property Pages should return FALSE
86 void CPartitionInfoDlg::OnHelp()
88 ShowHelp(m_hWnd, PARTITION_INFO_HELP_ID);