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 // StringEdit.cpp : implementation file
28 //===========================================================================
29 //#####DESCRIPTIONBEGIN####
36 // Description: This is the implementation of the masked edit control as used
37 // in integer in-cell edits by the control view.
44 //####DESCRIPTIONEND####
46 //===========================================================================
49 #include "StringEdit.h"
50 #include "MultiLineEditDialog.h"
55 static char THIS_FILE[] = __FILE__;
58 /////////////////////////////////////////////////////////////////////////////
61 CStringEdit::CStringEdit(LPCTSTR pszInitialValue):
62 CCellEdit(pszInitialValue),
63 m_bDoubleClickEdit(false)
64 //,CI(_T("Double-click to edit in a dialog"))
68 CStringEdit::~CStringEdit()
73 BEGIN_MESSAGE_MAP(CStringEdit, CCellEdit)
74 //{{AFX_MSG_MAP(CStringEdit)
80 /////////////////////////////////////////////////////////////////////////////
81 // CStringEdit message handlers
83 void CStringEdit::OnLButtonDblClk(UINT nFlags, CPoint point)
85 if(m_bDoubleClickEdit){
86 UNUSED_ALWAYS(nFlags);
88 CMultiLineEditDialog dlg(NULL,m_idEdit);
89 GetWindowText(dlg.m_strText);
90 // Change /n to /r/n endings
91 dlg.m_strText.Replace(_T("\n"),_T("\r\n"));
93 if(IDOK==dlg.DoModal()){
94 // Change /r/n to /n endings
95 dlg.m_strText.Replace(_T("\r\n"),_T("\n"));
96 SendMessage(WM_SETTEXT,0,(LPARAM)(LPCTSTR)dlg.m_strText);
98 //CI.Set(_T("Double-click to edit in a dialog"));
105 int CStringEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
107 if (CCellEdit::OnCreate(lpCreateStruct) == -1)
110 // TODO: Add your specialized creation code here