Initial IBM OpenAFS 1.0 tree
[openafs.git] / src / WINNT / client_exp / results_dlg.cpp
1 /*
2  * Copyright (C) 1997  Transarc Corporation.
3  * All rights reserved.
4  *
5  */
6
7 // results_dlg.cpp : implementation file
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 "results_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 // CResultsDlg dialog
27
28
29 CResultsDlg::CResultsDlg(DWORD nHelpID, CWnd* pParent /*=NULL*/)
30         : CDialog()
31 {
32         InitModalIndirect (TaLocale_GetDialogResource (CResultsDlg::IDD), pParent);
33
34         //{{AFX_DATA_INIT(CResultsDlg)
35                 // NOTE: the ClassWizard will add member initialization here
36         //}}AFX_DATA_INIT
37
38         m_nHelpID = nHelpID;
39 }
40
41
42 void CResultsDlg::DoDataExchange(CDataExchange* pDX)
43 {
44         CDialog::DoDataExchange(pDX);
45         //{{AFX_DATA_MAP(CResultsDlg)
46         DDX_Control(pDX, IDC_RESULTS_LABEL, m_ResultsLabel);
47         DDX_Control(pDX, IDC_LIST, m_List);
48         //}}AFX_DATA_MAP
49 }
50
51 BEGIN_MESSAGE_MAP(CResultsDlg, CDialog)
52         //{{AFX_MSG_MAP(CResultsDlg)
53         ON_BN_CLICKED(IDHELP, OnHelp)
54         //}}AFX_MSG_MAP
55 END_MESSAGE_MAP()
56
57 /////////////////////////////////////////////////////////////////////////////
58 // CResultsDlg message handlers
59
60 BOOL CResultsDlg::OnInitDialog() 
61 {
62         CDialog::OnInitDialog();
63         
64         SetWindowText(m_strDlgTitle);
65         m_ResultsLabel.SetWindowText(m_strResultsTitle);
66
67         ASSERT(m_Files.GetSize() == m_Results.GetSize());
68
69         m_List.SetTabStops(118);
70
71         for (int i = 0; i < m_Files.GetSize(); i++) {
72                 CString strItem = m_Files[i] + "\t" + m_Results[i];
73                 m_List.AddString(strItem);
74         }
75         
76         return TRUE;  // return TRUE unless you set the focus to a control
77                       // EXCEPTION: OCX Property Pages should return FALSE
78 }
79
80 void CResultsDlg::SetContents(const CString& strDlgTitle, const CString& strResultsTitle, const CStringArray& files, const CStringArray& results)
81 {
82         m_strDlgTitle = strDlgTitle;
83         m_strResultsTitle = strResultsTitle;
84
85         m_Files.RemoveAll();
86         m_Files.Copy(files);
87
88         m_Results.RemoveAll();
89         m_Results.Copy(results);
90 }
91
92 void CResultsDlg::OnHelp() 
93 {
94         ShowHelp(m_hWnd, m_nHelpID);
95 }
96