1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
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)
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
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.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // PlatformDialog.cpp : implementation file
31 #include "PlatformDialog.h"
36 static char THIS_FILE[] = __FILE__;
39 /////////////////////////////////////////////////////////////////////////////
40 // CPlatformDialog dialog
43 CPlatformDialog::CPlatformDialog(CWnd* pParent /*=NULL*/)
44 : CeCosDialog(CPlatformDialog::IDD, pParent)
46 //{{AFX_DATA_INIT(CPlatformDialog)
50 m_strInferior = _T("");
52 m_bServerSideGdb = FALSE;
57 void CPlatformDialog::DoDataExchange(CDataExchange* pDX)
59 CeCosDialog::DoDataExchange(pDX);
60 //{{AFX_DATA_MAP(CPlatformDialog)
61 DDX_Text(pDX, IDC_TT_NEW_PLATFORM, m_strPlatform);
62 DDX_Text(pDX, IDC_TT_NEW_PLATFORM_PREFIX, m_strPrefix);
63 DDX_Text(pDX, IDC_TT_NEW_PLATFORM_GDB, m_strGDB);
64 DDX_Text(pDX, IDC_INFERIOR, m_strInferior);
65 DDX_Text(pDX, IDC_PROMPT, m_strPrompt);
66 DDX_Check(pDX, IDC_SERVER_SIDE_GDB, m_bServerSideGdb);
71 BEGIN_MESSAGE_MAP(CPlatformDialog, CeCosDialog)
72 //{{AFX_MSG_MAP(CPlatformDialog)
73 ON_CBN_EDITCHANGE(IDC_TT_NEW_PLATFORM_PREFIX, OnChangeNewPlatformPrefix)
74 ON_EN_CHANGE(IDC_TT_NEW_PLATFORM, OnChangeNewPlatform)
78 /////////////////////////////////////////////////////////////////////////////
79 // CPlatformDialog message handlers
81 BOOL CPlatformDialog::OnInitDialog()
83 m_strGDB.Replace(_T(";"),_T("\r\n"));
84 CeCosDialog::OnInitDialog();
86 SetWindowText(m_strCaption);
87 if(!m_strPlatform.IsEmpty()){
88 SetDlgItemText(IDC_TT_NEW_PLATFORM,m_strPlatform);
89 GetDlgItem(IDC_TT_NEW_PLATFORM)->EnableWindow(false);
92 for(unsigned int i=0;i<CeCosTestPlatform::Count();i++){
93 map.SetAt(CeCosTestPlatform::Get(i)->Prefix(),this);
95 for(POSITION pos = map.GetStartPosition(); pos != NULL; ){
98 map.GetNextAssoc(pos, str, p);
99 ((CComboBox *)GetDlgItem(IDC_TT_NEW_PLATFORM_PREFIX))->AddString(str);
102 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
107 void CPlatformDialog::OnChangeNewPlatformPrefix()
110 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
113 void CPlatformDialog::OnChangeNewPlatform()
116 GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
119 void CPlatformDialog::OnOK()
122 m_strGDB.Replace(_T("\r\n"),_T(";"));