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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [Utils/] [win32/] [eCosDialog.cpp] - Blame information for rev 790

Go to most recent revision | 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
// eCosDialog.cpp : implementation file
23
//
24
 
25
#include "stdafx.h"
26
#include "eCosDialog.h"
27
 
28
#ifdef _DEBUG
29
#define new DEBUG_NEW
30
#undef THIS_FILE
31
static char THIS_FILE[] = __FILE__;
32
#endif
33
 
34
/////////////////////////////////////////////////////////////////////////////
35
// CeCosDialog dialog
36
 
37
void CeCosDialog::DoDataExchange(CDataExchange* pDX)
38
{
39
        CCSHDialog::DoDataExchange(pDX);
40
        //{{AFX_DATA_MAP(CeCosDialog)
41
                // NOTE: the ClassWizard will add DDX and DDV calls here
42
        //}}AFX_DATA_MAP
43
}
44
 
45
 
46
BEGIN_MESSAGE_MAP(CeCosDialog, CCSHDialog)
47
        //{{AFX_MSG_MAP(CeCosDialog)
48
        //}}AFX_MSG_MAP
49
END_MESSAGE_MAP()
50
 
51
/////////////////////////////////////////////////////////////////////////////
52
// CeCosDialog message handlers
53
 
54
CPtrArray CeCosDialog::m_arDialogMaps;
55
 
56
CString CeCosDialog::CSHFile() const
57
{
58
  return CSHFile((UINT)m_lpszTemplateName);
59
}
60
 
61
CString CeCosDialog::CSHFile(UINT nID)
62
{
63
  if(nID){
64
    for(int j=m_arDialogMaps.GetSize()-1;j>=0;--j){
65
      UINT *map=(UINT *)m_arDialogMaps[j];
66
      for(int i=0;map[i];i+=2){
67
        if(nID==map[i]){
68
          CString strFile;
69
          if(strFile.LoadString(map[i+1])){
70
            return m_strCSHFilePath+strFile;
71
          } else {
72
            TRACE(_T("CCSHDialog::Failed to load help file id %d for dialog id=%d\n"),map[i+1],nID);
73
          }
74
        }
75
      }
76
    }
77
  }
78
  TRACE(_T("CCSHDialog::Failed to find help file for dialog id=%d\n"),nID);
79
  return _T("");
80
}
81
 
82
UINT CeCosDialog::HelpID (DWORD dwCtrlID) const
83
{
84
  return HelpID((UINT)m_lpszTemplateName,dwCtrlID);
85
}
86
 
87
UINT CeCosDialog::HelpID (UINT dlgID, DWORD dwCtrlID)
88
{
89
  UNUSED_ALWAYS(dlgID); // because we have a single namespace for all control IDs
90
  LPCTSTR id;
91
  switch(dwCtrlID){
92
    case IDOK:
93
      id=_T("Closes the dialog and saves any changes you have made.");
94
      break;
95
    case IDCANCEL:
96
      id=_T("Closes the dialog without saving any changes you have made.");
97
      break;
98
    case ID_APPLY_NOW:
99
      id=_T("Saves all the changes you have made without closing this dialog box.");
100
      break;
101
    case ID_HELP:
102
    case IDHELP:
103
      id=_T("Click this to display an overview of the dialog box.");
104
      break;
105
    default:
106
      id=(LPCTSTR)dwCtrlID;
107
      break;
108
  }
109
  return (UINT)id;
110
}
111
 
112
HINSTANCE CeCosDialog::GetInstanceHandle()
113
{
114
#ifdef PLUGIN
115
  extern HINSTANCE heCosInstance;
116
  return heCosInstance;
117
#else
118
  return AfxGetInstanceHandle();
119
#endif
120
}

powered by: WebSVN 2.1.0

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