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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [Utils/] [win32/] [Cell.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
// CellEdit.cpp : implementation file
23
//
24
 
25
#include "stdafx.h"
26
#include "Cell.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
// CCell
36
 
37
CCell::CCell(LPCTSTR pszInitialValue):
38
  m_strInitialValue(pszInitialValue)
39
{
40
}
41
 
42
CCell::~CCell()
43
{
44
}
45
 
46
 
47
BEGIN_MESSAGE_MAP(CCell, CWnd)
48
        //{{AFX_MSG_MAP(CCell)
49
        ON_WM_CHAR()
50
        //}}AFX_MSG_MAP
51
END_MESSAGE_MAP()
52
 
53
 
54
/////////////////////////////////////////////////////////////////////////////
55
// CCell message handlers
56
 
57
BOOL CCell::PreTranslateMessage(MSG* pMsg)
58
{
59
  if(pMsg->message==WM_KEYDOWN){
60
    switch(pMsg->wParam){
61
      case VK_ESCAPE:
62
        GetParent()->SendMessage(WM_CANCEL_EDIT,0);
63
        return TRUE;
64
      case VK_RETURN:
65
        GetParent()->SendMessage(WM_CANCEL_EDIT,1);
66
        return TRUE;
67
      default:
68
        break;
69
    }
70
  }
71
 
72
        return CWnd::PreTranslateMessage(pMsg);
73
}
74
 
75
BOOL CCell::Create(DWORD, const RECT&, CWnd*, UINT, CCreateContext*)
76
{
77
  ASSERT(false);
78
  return false;
79
}
80
 
81
void CCell::OnChar(UINT nChar, UINT, UINT )
82
{
83
  switch(nChar){
84
    case VK_RETURN:
85
      GetParent()->SendMessage(WM_CANCEL_EDIT,1);
86
      break;
87
    case VK_ESCAPE:
88
      GetParent()->SendMessage(WM_CANCEL_EDIT,0);
89
      break;
90
    default:
91
      // Prevent beep: do not pass message back
92
      break;
93
  }
94
}

powered by: WebSVN 2.1.0

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