OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [testtool/] [win32/] [PlatformDialog.cpp] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// PlatformDialog.cpp : implementation file
23
//
24
 
25
#include "stdafx.h"
26
#include "eCosTest.h"
27
#include "testtool.h"
28
#include "PlatformDialog.h"
29
 
30
#ifdef _DEBUG
31
#define new DEBUG_NEW
32
#undef THIS_FILE
33
static char THIS_FILE[] = __FILE__;
34
#endif
35
 
36
/////////////////////////////////////////////////////////////////////////////
37
// CPlatformDialog dialog
38
 
39
 
40
CPlatformDialog::CPlatformDialog(CWnd* pParent /*=NULL*/)
41
        : CeCosDialog(CPlatformDialog::IDD, pParent)
42
{
43
        //{{AFX_DATA_INIT(CPlatformDialog)
44
        m_strPlatform=_T("");
45
        m_strPrefix=_T("");
46
        m_strGDB=_T("");
47
        m_strInferior = _T("");
48
        m_strPrompt = _T("");
49
        m_bServerSideGdb = FALSE;
50
        //}}AFX_DATA_INIT
51
}
52
 
53
 
54
void CPlatformDialog::DoDataExchange(CDataExchange* pDX)
55
{
56
        CeCosDialog::DoDataExchange(pDX);
57
        //{{AFX_DATA_MAP(CPlatformDialog)
58
  DDX_Text(pDX, IDC_TT_NEW_PLATFORM, m_strPlatform);
59
  DDX_Text(pDX, IDC_TT_NEW_PLATFORM_PREFIX, m_strPrefix);
60
  DDX_Text(pDX, IDC_TT_NEW_PLATFORM_GDB, m_strGDB);
61
        DDX_Text(pDX, IDC_INFERIOR, m_strInferior);
62
        DDX_Text(pDX, IDC_PROMPT, m_strPrompt);
63
        DDX_Check(pDX, IDC_SERVER_SIDE_GDB, m_bServerSideGdb);
64
        //}}AFX_DATA_MAP
65
}
66
 
67
 
68
BEGIN_MESSAGE_MAP(CPlatformDialog, CeCosDialog)
69
        //{{AFX_MSG_MAP(CPlatformDialog)
70
        ON_CBN_EDITCHANGE(IDC_TT_NEW_PLATFORM_PREFIX, OnChangeNewPlatformPrefix)
71
        ON_EN_CHANGE(IDC_TT_NEW_PLATFORM, OnChangeNewPlatform)
72
        //}}AFX_MSG_MAP
73
END_MESSAGE_MAP()
74
 
75
/////////////////////////////////////////////////////////////////////////////
76
// CPlatformDialog message handlers
77
 
78
BOOL CPlatformDialog::OnInitDialog()
79
{
80
  m_strGDB.Replace(_T(";"),_T("\r\n"));
81
  CeCosDialog::OnInitDialog();
82
 
83
  SetWindowText(m_strCaption);
84
  if(!m_strPlatform.IsEmpty()){
85
    SetDlgItemText(IDC_TT_NEW_PLATFORM,m_strPlatform);
86
    GetDlgItem(IDC_TT_NEW_PLATFORM)->EnableWindow(false);
87
  }
88
  CMapStringToPtr map;
89
  for(unsigned int i=0;i<CeCosTestPlatform::Count();i++){
90
    map.SetAt(CeCosTestPlatform::Get(i)->Prefix(),this);
91
  }
92
  for(POSITION pos = map.GetStartPosition(); pos != NULL; ){
93
    void *p;
94
    CString str;
95
    map.GetNextAssoc(pos, str, p);
96
    ((CComboBox *)GetDlgItem(IDC_TT_NEW_PLATFORM_PREFIX))->AddString(str);
97
  }
98
 
99
  GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
100
 
101
  return true;
102
}
103
 
104
void CPlatformDialog::OnChangeNewPlatformPrefix()
105
{
106
  UpdateData(true);
107
  GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
108
}
109
 
110
void CPlatformDialog::OnChangeNewPlatform()
111
{
112
  UpdateData(true);
113
  GetDlgItem(IDOK)->EnableWindow(!m_strPlatform.IsEmpty() && !m_strPrefix.IsEmpty());
114
}
115
 
116
void CPlatformDialog::OnOK()
117
{
118
        UpdateData(TRUE);
119
  m_strGDB.Replace(_T("\r\n"),_T(";"));
120
        EndDialog(IDOK);
121
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.