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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [Utils/] [win32/] [StringEdit.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
// StringEdit.cpp : implementation file
23
//
24
//
25
//===========================================================================
26
//#####DESCRIPTIONBEGIN####
27
//
28
// Author(s):   sdf
29
// Contact(s):  sdf
30
// Date:                1998/08/11
31
// Version:             0.01
32
// Purpose:     
33
// Description: This is the implementation of the masked edit control as used 
34
//                              in integer in-cell edits by the control view.
35
// Requires:    
36
// Provides:    
37
// See also:    
38
// Known bugs:  
39
// Usage:       
40
//
41
//####DESCRIPTIONEND####
42
//
43
//===========================================================================
44
 
45
#include "stdafx.h"
46
#include "StringEdit.h"
47
#include "MultiLineEditDialog.h"
48
 
49
#ifdef _DEBUG
50
#define new DEBUG_NEW
51
#undef THIS_FILE
52
static char THIS_FILE[] = __FILE__;
53
#endif
54
 
55
/////////////////////////////////////////////////////////////////////////////
56
// CStringEdit
57
 
58
CStringEdit::CStringEdit(LPCTSTR pszInitialValue):
59
  CCellEdit(pszInitialValue),
60
  m_bDoubleClickEdit(false)
61
  //,CI(_T("Double-click to edit in a dialog"))
62
{
63
}
64
 
65
CStringEdit::~CStringEdit()
66
{
67
}
68
 
69
 
70
BEGIN_MESSAGE_MAP(CStringEdit, CCellEdit)
71
        //{{AFX_MSG_MAP(CStringEdit)
72
        ON_WM_LBUTTONDBLCLK()
73
        ON_WM_CREATE()
74
        //}}AFX_MSG_MAP
75
END_MESSAGE_MAP()
76
 
77
/////////////////////////////////////////////////////////////////////////////
78
// CStringEdit message handlers
79
 
80
void CStringEdit::OnLButtonDblClk(UINT nFlags, CPoint point)
81
{
82
  if(m_bDoubleClickEdit){
83
    UNUSED_ALWAYS(nFlags);
84
    UNUSED_ALWAYS(point);
85
    CMultiLineEditDialog dlg(NULL,m_idEdit);
86
    GetWindowText(dlg.m_strText);
87
    // Change /n to /r/n endings
88
    dlg.m_strText.Replace(_T("\n"),_T("\r\n"));
89
    //CI.Reset();
90
    if(IDOK==dlg.DoModal()){
91
      // Change /r/n to /n endings
92
      dlg.m_strText.Replace(_T("\r\n"),_T("\n"));
93
      SendMessage(WM_SETTEXT,0,(LPARAM)(LPCTSTR)dlg.m_strText);
94
    }
95
    //CI.Set(_T("Double-click to edit in a dialog"));
96
    SetFocus();
97
  } else {
98
    Default();
99
  }
100
}
101
 
102
int CStringEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
103
{
104
        if (CCellEdit::OnCreate(lpCreateStruct) == -1)
105
                return -1;
106
 
107
        // TODO: Add your specialized creation code here
108
 
109
        return 0;
110
}
111
 

powered by: WebSVN 2.1.0

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