@@ -50,6 +50,8 @@ void CEditMultiLine::DoDataExchange(CDataExchange* pDX)
50
50
if (!pDX->m_bSaveAndValidate && App.m_bFixedFontForEditing )
51
51
FixFont (m_font, m_ctlText, App.m_strFixedPitchFont , App.m_iFixedPitchFontSize , FW_NORMAL, DEFAULT_CHARSET);
52
52
53
+ if (!pDX->m_bSaveAndValidate )
54
+ m_ctlText.SetTabStops (10 );
53
55
}
54
56
55
57
@@ -76,12 +78,12 @@ END_MESSAGE_MAP()
76
78
iTopOfRow, iWidth, iHeight)
77
79
78
80
79
- void CEditMultiLine::OnSize (UINT nType, int cx, int cy)
81
+ void CEditMultiLine::OnSize (UINT nType, int cx, int cy)
80
82
{
81
83
CDialog::OnSize (nType, cx, cy);
82
-
83
- if (m_ctlText.m_hWnd &&
84
- m_ctlCancel.m_hWnd &&
84
+
85
+ if (m_ctlText.m_hWnd &&
86
+ m_ctlCancel.m_hWnd &&
85
87
m_ctlFunctionListButton.m_hWnd &&
86
88
m_ctlCompleteFunctionButton.m_hWnd &&
87
89
m_ctlGoToLineButton.m_hWnd &&
@@ -140,21 +142,21 @@ void CEditMultiLine::OnSize(UINT nType, int cx, int cy)
140
142
141
143
}
142
144
143
- BOOL CEditMultiLine::OnInitDialog ()
145
+ BOOL CEditMultiLine::OnInitDialog ()
144
146
{
145
147
CDialog::OnInitDialog ();
146
-
148
+
147
149
CWindowPlacement wp;
148
150
wp.Restore (" Edit MultiLine Dialog" , this , false );
149
151
150
152
if (!m_strTitle.IsEmpty ())
151
- SetWindowText (m_strTitle);
152
-
153
+ SetWindowText (m_strTitle);
154
+
153
155
PostMessage (WM_COMMAND, CLEAR_SELECTION);
154
156
155
157
if (!m_bScript)
156
158
{
157
- m_ctlFunctionListButton.ShowWindow (SW_HIDE);
159
+ m_ctlFunctionListButton.ShowWindow (SW_HIDE);
158
160
m_ctlCompleteFunctionButton.ShowWindow (SW_HIDE);
159
161
m_ctlGoToLineButton.ShowWindow (SW_HIDE);
160
162
}
@@ -170,7 +172,7 @@ void CEditMultiLine::OnRemoveSelection()
170
172
171
173
}
172
174
173
- void CEditMultiLine::OnFunctionList ()
175
+ void CEditMultiLine::OnFunctionList ()
174
176
{
175
177
int nStartChar,
176
178
nEndChar;
@@ -184,21 +186,21 @@ CString strSelection;
184
186
ShowFunctionslist (strSelection, nStartChar, nEndChar, m_bLua);
185
187
}
186
188
187
- void CEditMultiLine::OnCompleteWord ()
189
+ void CEditMultiLine::OnCompleteWord ()
188
190
{
189
191
FunctionMenu (m_ctlText, m_bScript && m_bLua);
190
192
}
191
193
192
- void CEditMultiLine::OnDestroy ()
194
+ void CEditMultiLine::OnDestroy ()
193
195
{
194
196
CDialog::OnDestroy ();
195
-
197
+
196
198
CWindowPlacement wp;
197
199
wp.Save (" Edit MultiLine Dialog" , this );
198
-
200
+
199
201
}
200
202
201
- void CEditMultiLine::OnGotoLine ()
203
+ void CEditMultiLine::OnGotoLine ()
202
204
{
203
205
CGoToLineDlg dlg;
204
206
@@ -218,8 +220,34 @@ CGoToLineDlg dlg;
218
220
219
221
// go to the start of that line
220
222
m_ctlText.SetSel (iIndex, iIndex);
221
-
223
+
222
224
// ensure text box has the focus if you click on the button
223
225
m_ctlText.SetFocus ();
224
226
225
227
}
228
+
229
+ BOOL CEditMultiLine::PreTranslateMessage (MSG* pMsg)
230
+ {
231
+
232
+ if ( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB &&
233
+ App.m_bTabInsertsTab )
234
+ {
235
+ int nStartChar,
236
+ nEndChar;
237
+
238
+ // find the selection range
239
+ m_ctlText.GetSel (nStartChar, nEndChar);
240
+
241
+ // select zero chars
242
+ m_ctlText.SetSel (nStartChar, nStartChar);
243
+
244
+ // then replace that selection with a TAB
245
+ m_ctlText.ReplaceSel (" \t " , TRUE );
246
+
247
+ // no need to do a msg translation, so quit.
248
+ // that way no further processing gets done
249
+ return TRUE ;
250
+ }
251
+
252
+ return CDialog::PreTranslateMessage (pMsg);
253
+ } // end of CEditMultiLine::PreTranslateMessage
0 commit comments