Windows: Build afs_shl_ext.dll with talocaleU.lib
[openafs.git] / src / WINNT / client_exp / results_dlg.cpp
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
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
8  */
9
10 #include "stdafx.h"
11 #include <winsock2.h>
12 #include <ws2tcpip.h>
13
14 extern "C" {
15 #include <afs/param.h>
16 #include <afs/stds.h>
17 }
18
19 #include "afs_shl_ext.h"
20 #include "results_dlg.h"
21
22 #ifdef _DEBUG
23 #define new DEBUG_NEW
24 #undef THIS_FILE
25 static char THIS_FILE[] = __FILE__;
26 #endif
27
28 /////////////////////////////////////////////////////////////////////////////
29 // CResultsDlg dialog
30
31
32 CResultsDlg::CResultsDlg(DWORD nHelpID, CWnd* pParent /*=NULL*/)
33         : CDialog()
34 {
35     InitModalIndirect (TaLocale_GetDialogResource (CResultsDlg::IDD), pParent);
36
37     //{{AFX_DATA_INIT(CResultsDlg)
38     // NOTE: the ClassWizard will add member initialization here
39     //}}AFX_DATA_INIT
40
41     m_nHelpID = nHelpID;
42 }
43
44
45 void CResultsDlg::DoDataExchange(CDataExchange* pDX)
46 {
47     CDialog::DoDataExchange(pDX);
48     //{{AFX_DATA_MAP(CResultsDlg)
49     DDX_Control(pDX, IDC_RESULTS_LABEL, m_ResultsLabel);
50     DDX_Control(pDX, IDC_LIST, m_List);
51     //}}AFX_DATA_MAP
52 }
53
54 BEGIN_MESSAGE_MAP(CResultsDlg, CDialog)
55     //{{AFX_MSG_MAP(CResultsDlg)
56     ON_BN_CLICKED(IDHELP, OnHelp)
57     //}}AFX_MSG_MAP
58 END_MESSAGE_MAP()
59
60 /////////////////////////////////////////////////////////////////////////////
61 // CResultsDlg message handlers
62
63 BOOL CResultsDlg::OnInitDialog() 
64 {
65     CDialog::OnInitDialog();
66         
67     SetWindowText(m_strDlgTitle);
68     m_ResultsLabel.SetWindowText(m_strResultsTitle);
69
70     ASSERT(m_Files.GetSize() == m_Results.GetSize());
71
72     m_List.SetTabStops(118);
73
74     for (int i = 0; i < m_Files.GetSize(); i++) {
75         CString strItem = m_Files[i] + "\t" + m_Results[i];
76         m_List.AddString(strItem);
77     }
78
79     return TRUE;  // return TRUE unless you set the focus to a control
80     // EXCEPTION: OCX Property Pages should return FALSE
81 }
82
83 void CResultsDlg::SetContents(const CString& strDlgTitle, const CString& strResultsTitle, const CStringArray& files, const CStringArray& results)
84 {
85     m_strDlgTitle = strDlgTitle;
86     m_strResultsTitle = strResultsTitle;
87
88     m_Files.RemoveAll();
89     m_Files.Copy(files);
90
91     m_Results.RemoveAll();
92     m_Results.Copy(results);
93 }
94
95 void CResultsDlg::OnHelp() 
96 {
97     ShowHelp(m_hWnd, m_nHelpID);
98 }
99