comparison host/tools/testtool/win32/PlatformDialog.cpp @ 76:435cced73e2f ecos-v1_3_1-release

eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
author jlarmour
date Tue, 28 Mar 2000 14:10:45 +0000
parents
children 6736c52df507
comparison
equal deleted inserted replaced
75:41bf073c0c32 76:435cced73e2f
1 //####COPYRIGHTBEGIN####
2 //
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
5 //
6 // This program is part of the eCos host tools.
7 //
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
11 // any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 // more details.
17 //
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 //
22 // ----------------------------------------------------------------------------
23 //
24 //####COPYRIGHTEND####
25 // PlatformDialog.cpp : implementation file
26 //
27
28 #include "stdafx.h"
29 #include "eCosTest.h"
30 #include "testtool.h"
31 #include "PlatformDialog.h"
32
33 #ifdef _DEBUG
34 #define new DEBUG_NEW
35 #undef THIS_FILE
36 static char THIS_FILE[] = __FILE__;
37 #endif
38
39 /////////////////////////////////////////////////////////////////////////////
40 // CPlatformDialog dialog
41
42
43 CPlatformDialog::CPlatformDialog(CWnd* pParent /*=NULL*/)
44 : CeCosDialog(CPlatformDialog::IDD, pParent)
45 {
46 //{{AFX_DATA_INIT(CPlatformDialog)
47 m_strPlatform=_T("");
48 m_strPrefix=_T("");
49 m_strGDB=_T("");
50 m_nType = 0;
51 //}}AFX_DATA_INIT
52 }
53
54
55 void CPlatformDialog::DoDataExchange(CDataExchange* pDX)
56 {
57 CeCosDialog::DoDataExchange(pDX);
58 //{{AFX_DATA_MAP(CPlatformDialog)
59 DDX_Text(pDX, IDC_TT_NEW_PLATFORM, m_strPlatform);
60 DDX_Text(pDX, IDC_TT_NEW_PLATFORM_PREFIX, m_strPrefix);
61 DDX_Text(pDX, IDC_TT_NEW_PLATFORM_GDB, m_strGDB);
62 DDX_CBIndex(pDX, IDC_TYPE_COMBO, m_nType);
63 //}}AFX_DATA_MAP
64 }
65
66
67 BEGIN_MESSAGE_MAP(CPlatformDialog, CeCosDialog)
68 //{{AFX_MSG_MAP(CPlatformDialog)
69 ON_CBN_EDITCHANGE(IDC_TT_NEW_PLATFORM_PREFIX, OnChangeNewPlatformPrefix)
70 ON_EN_CHANGE(IDC_TT_NEW_PLATFORM, OnChangeNewPlatform)
71 //}}AFX_MSG_MAP
72 END_MESSAGE_MAP()
73
74 /////////////////////////////////////////////////////////////////////////////
75 // CPlatformDialog message handlers
76
77 BOOL CPlatformDialog::OnInitDialog()
78 {
79 CeCosDialog::OnInitDialog();
80 SetWindowText(m_strCaption);
81 if(!m_strPlatform.IsEmpty()){
82 SetDlgItemText(IDC_TT_NEW_PLATFORM,m_strPlatform);
83 GetDlgItem(IDC_TT_NEW_PLATFORM)->EnableWindow(false);
84 }
85 CMapStringToPtr map;
86 for(unsigned int i=0;i<CeCosTest::TargetTypeMax();i++){
87 map.SetAt(CeCosTest::Target(i).Prefix(),this);
88 }
89 for(POSITION pos = map.GetStartPosition(); pos != NULL; ){
90 void *p;
91 CString str;
92 map.GetNextAssoc(pos, str, p);
93 ((CComboBox *)GetDlgItem(IDC_TT_NEW_PLATFORM_PREFIX))->AddString(str);
94 }
95
96 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
97
98 return true;
99 }
100
101 void CPlatformDialog::OnChangeNewPlatformPrefix()
102 {
103 UpdateData(true);
104 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
105 }
106
107 void CPlatformDialog::OnChangeNewPlatform()
108 {
109 UpdateData(true);
110 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
111 }