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 |
|
|
// MultiLineEditDialog.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 popup dialog for in-cell editing
|
34 |
|
|
// of multi-line string items
|
35 |
|
|
// Requires:
|
36 |
|
|
// Provides:
|
37 |
|
|
// See also:
|
38 |
|
|
// Known bugs:
|
39 |
|
|
// Usage:
|
40 |
|
|
//
|
41 |
|
|
//####DESCRIPTIONEND####
|
42 |
|
|
//
|
43 |
|
|
//===========================================================================
|
44 |
|
|
|
45 |
|
|
#include "stdafx.h"
|
46 |
|
|
#include "MultiLineEditDialog.h"
|
47 |
|
|
|
48 |
|
|
#ifdef _DEBUG
|
49 |
|
|
#define new DEBUG_NEW
|
50 |
|
|
#undef THIS_FILE
|
51 |
|
|
static char THIS_FILE[] = __FILE__;
|
52 |
|
|
#endif
|
53 |
|
|
|
54 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
55 |
|
|
// CMultiLineEditDialog dialog
|
56 |
|
|
|
57 |
|
|
const CMultiLineEditDialog::DlgData CMultiLineEditDialog::data={
|
58 |
|
|
{DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU, 0, 3, 0, 0, 294, 170}, // # items
|
59 |
|
|
|
60 |
|
|
0x0000, // menu
|
61 |
|
|
0x0000, // class
|
62 |
|
|
0x0000, // title
|
63 |
|
|
{
|
64 |
|
|
{
|
65 |
|
|
{WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_PUSHBUTTON | BS_DEFPUSHBUTTON,0,183,7,50,14,IDOK},
|
66 |
|
|
0xffff, 0x0080, // class (button)
|
67 |
|
|
0x0000, // title
|
68 |
|
|
0x0000, // creation data
|
69 |
|
|
0x0000 // alignment
|
70 |
|
|
},
|
71 |
|
|
|
72 |
|
|
{
|
73 |
|
|
{WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_PUSHBUTTON,0, 237, 7, 50, 14, IDCANCEL},
|
74 |
|
|
0xffff, 0x0080, // class (button)
|
75 |
|
|
0x0000, // title
|
76 |
|
|
0x0000, // creation data
|
77 |
|
|
0x0000 // alignment
|
78 |
|
|
},
|
79 |
|
|
|
80 |
|
|
{
|
81 |
|
|
{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 */},
|
82 |
|
|
0xffff, 0x0081, // class (edit)
|
83 |
|
|
0x0000, // title
|
84 |
|
|
0x0000, // creation data
|
85 |
|
|
0x0000 // alignment
|
86 |
|
|
}
|
87 |
|
|
}
|
88 |
|
|
};
|
89 |
|
|
|
90 |
|
|
CMultiLineEditDialog::CMultiLineEditDialog(CWnd* pParent /*=NULL*/,UINT idEdit)
|
91 |
|
|
: CeCosDialog(),
|
92 |
|
|
m_idEdit(idEdit)
|
93 |
|
|
{
|
94 |
|
|
m_data=data;
|
95 |
|
|
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)
|
96 |
|
|
InitModalIndirect(&m_data.dtdlg,pParent);
|
97 |
|
|
//{{AFX_DATA_INIT(CMultiLineEditDialog)
|
98 |
|
|
m_strText = _T("");
|
99 |
|
|
//}}AFX_DATA_INIT
|
100 |
|
|
}
|
101 |
|
|
|
102 |
|
|
void CMultiLineEditDialog::DoDataExchange(CDataExchange* pDX)
|
103 |
|
|
{
|
104 |
|
|
CeCosDialog::DoDataExchange(pDX);
|
105 |
|
|
//{{AFX_DATA_MAP(CMultiLineEditDialog)
|
106 |
|
|
//}}AFX_DATA_MAP
|
107 |
|
|
}
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
BEGIN_MESSAGE_MAP(CMultiLineEditDialog, CeCosDialog)
|
111 |
|
|
//{{AFX_MSG_MAP(CMultiLineEditDialog)
|
112 |
|
|
//}}AFX_MSG_MAP
|
113 |
|
|
END_MESSAGE_MAP()
|
114 |
|
|
|
115 |
|
|
/////////////////////////////////////////////////////////////////////////////
|
116 |
|
|
// CMultiLineEditDialog message handlers
|
117 |
|
|
|
118 |
|
|
BOOL CMultiLineEditDialog::OnInitDialog()
|
119 |
|
|
{
|
120 |
|
|
CeCosDialog::OnInitDialog();
|
121 |
|
|
SetWindowText(_T("String Edit"));
|
122 |
|
|
SetDlgItemText(IDOK,_T("OK"));
|
123 |
|
|
SetDlgItemText(IDCANCEL,_T("Cancel"));
|
124 |
|
|
SetDlgItemText(m_idEdit,m_strText);
|
125 |
|
|
return TRUE; // return TRUE unless you set the focus to a control
|
126 |
|
|
// EXCEPTION: OCX Property Pages should return FALSE
|
127 |
|
|
}
|
128 |
|
|
|
129 |
|
|
void CMultiLineEditDialog::OnOK()
|
130 |
|
|
{
|
131 |
|
|
GetDlgItemText(m_idEdit,m_strText);
|
132 |
|
|
CeCosDialog::OnOK();
|
133 |
|
|
}
|