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 // MultiLineEditDialog.cpp : implementation file
28 //===========================================================================
29 //#####DESCRIPTIONBEGIN####
36 // Description: This is the implementation of the popup dialog for in-cell editing
37 // of multi-line string items
44 //####DESCRIPTIONEND####
46 //===========================================================================
49 #include "MultiLineEditDialog.h"
54 static char THIS_FILE[] = __FILE__;
57 /////////////////////////////////////////////////////////////////////////////
58 // CMultiLineEditDialog dialog
60 const CMultiLineEditDialog::DlgData CMultiLineEditDialog::data={
61 {DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU, 0, 3, 0, 0, 294, 170}, // # items
68 {WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_PUSHBUTTON | BS_DEFPUSHBUTTON,0,183,7,50,14,IDOK},
69 0xffff, 0x0080, // class (button)
71 0x0000, // creation data
76 {WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_PUSHBUTTON,0, 237, 7, 50, 14, IDCANCEL},
77 0xffff, 0x0080, // class (button)
79 0x0000, // creation data
84 {WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL | WS_HSCROLL,0, 7, 24, 280, 139, 42 /* replaced by m_idEdit */},
85 0xffff, 0x0081, // class (edit)
87 0x0000, // creation data
93 CMultiLineEditDialog::CMultiLineEditDialog(CWnd* pParent /*=NULL*/,UINT idEdit)
98 m_data.ctrl[2].dit.id=(WORD)m_idEdit; // set the id of the edit control according to parent's wishes (typically to allow CSH to work)
99 InitModalIndirect(&m_data.dtdlg,pParent);
100 //{{AFX_DATA_INIT(CMultiLineEditDialog)
105 void CMultiLineEditDialog::DoDataExchange(CDataExchange* pDX)
107 CeCosDialog::DoDataExchange(pDX);
108 //{{AFX_DATA_MAP(CMultiLineEditDialog)
113 BEGIN_MESSAGE_MAP(CMultiLineEditDialog, CeCosDialog)
114 //{{AFX_MSG_MAP(CMultiLineEditDialog)
118 /////////////////////////////////////////////////////////////////////////////
119 // CMultiLineEditDialog message handlers
121 BOOL CMultiLineEditDialog::OnInitDialog()
123 CeCosDialog::OnInitDialog();
124 SetWindowText(_T("String Edit"));
125 SetDlgItemText(IDOK,_T("OK"));
126 SetDlgItemText(IDCANCEL,_T("Cancel"));
127 SetDlgItemText(m_idEdit,m_strText);
128 return TRUE; // return TRUE unless you set the focus to a control
129 // EXCEPTION: OCX Property Pages should return FALSE
132 void CMultiLineEditDialog::OnOK()
134 GetDlgItemText(m_idEdit,m_strText);