vdfsplat / AppSrc / cSplatCodeMax.pkg
History | View | Annotate | Download (18.8 KB)
1 | 7 | wil | //TH-Header |
---|---|---|---|
2 | //***************************************************************************************** |
||
3 | // Copyright (c) 2013 Antwise Solutions |
||
4 | // All rights reserved. |
||
5 | // |
||
6 | // $FileName : cSplatCodemax.pkg |
||
7 | // $ProjectName : Vdf Debugger |
||
8 | // $Authors : Wil van Antwerpen |
||
9 | // $Created : 12.14.2013 23:50 |
||
10 | 8 | wil | // $Type : GPLv2 |
11 | 7 | wil | // |
12 | // Contents: |
||
13 | // |
||
14 | //***************************************************************************************** |
||
15 | //TH-RevisionStart |
||
16 | //TH-RevisionEnd |
||
17 | |||
18 | |||
19 | Use cComCodeMax.pkg |
||
20 | 14 | wil | Use cImageList32.pkg |
21 | Use RGB.pkg |
||
22 | Use cOSVersionInfo.pkg |
||
23 | //Use cComCDACTreeListCtl.pkg |
||
24 | 7 | wil | |
25 | 14 | wil | Define CS_LNG_VDF for "Visual DataFlex" |
26 | Define CS_DAW_KEY for "Data Access Worldwide" |
||
27 | Define CS_DAW_VDF for "Visual DataFlex" |
||
28 | Define CS_DAW_DF for "DataFlex" |
||
29 | 42 | wil | Define CS_TAB for (Character(9)) |
30 | 7 | wil | |
31 | 12 | wil | |
32 | 72 | wil | Define ICO_Inst_ptr_top for $CI01 // instruction pointer top icon |
33 | 14 | wil | Define ICO_Inst_ptr for $CI02 // instruction pointer icon |
34 | 72 | wil | Define ICO_Brkp_obj for $CI04 // breakpoint object icon |
35 | 14 | wil | |
36 | Class cCodeMaxImageList is a cImageList32 |
||
37 | |||
38 | Procedure Construct_Object |
||
39 | Forward Send Construct_Object |
||
40 | |||
41 | Set piMaxImages To 5 |
||
42 | Set piImageHeight To 16 |
||
43 | Set piImageWidth To 16 |
||
44 | End_Procedure // Construct_Object |
||
45 | |||
46 | Procedure OnCreate |
||
47 | Integer iVoid |
||
48 | |||
49 | Get AddImage "brkp_obj.ico" To iVoid // bit 1 // seems the first image is ignored as a margin image |
||
50 | 72 | wil | Get AddImage "inst_ptr_top_green.ico" To iVoid // bit 2 |
51 | Get AddImage "brkp_obj_red.ico" To iVoid // bit 3 |
||
52 | 64 | wil | Get AddImage "inst_ptr.ico" To iVoid // bit 4 |
53 | 14 | wil | End_Procedure |
54 | End_Class |
||
55 | |||
56 | |||
57 | 7 | wil | Class cSplatCodeMax is a cComCodeMax |
58 | Procedure Construct_Object |
||
59 | Forward Send Construct_Object |
||
60 | Property String psFileName "" |
||
61 | Property Integer piCurrentLine 0 |
||
62 | 14 | wil | |
63 | Object oCodeMaxImages is a cCodeMaxImageList |
||
64 | End_Object |
||
65 | End_Procedure |
||
66 | |||
67 | Function HostOSis64Bits Returns Boolean |
||
68 | Handle hoVersionInfo |
||
69 | Boolean bIs64Bits |
||
70 | |||
71 | Move false to bIs64Bits |
||
72 | Get Create U_cOSVersionInfo To hoVersionInfo |
||
73 | If (hoVersionInfo) Begin |
||
74 | Get pbX64 Of hoVersionInfo To bIs64Bits |
||
75 | End |
||
76 | |||
77 | Function_Return bIs64Bits |
||
78 | End_Function // HostOSis64Bits |
||
79 | 8 | wil | |
80 | 14 | wil | // Returns compiled runtime version as DataFlex version * 10 |
81 | Function CompiledRuntimeVersion Returns Integer |
||
82 | String sVersion |
||
83 | Integer iVersion |
||
84 | Move (Replace(".",gsRuntimeVersion,"")) To sVersion |
||
85 | Move (Cast(sVersion,integer)) To iVersion |
||
86 | Function_Return iVersion |
||
87 | End_Function |
||
88 | |||
89 | // |
||
90 | 12 | wil | // Runtime folder that is used for compiling the current version of Splat. |
91 | // This helps us in getting the required parameters |
||
92 | // |
||
93 | Function CurrentRuntimeFolder Returns String |
||
94 | 14 | wil | Boolean bOpened |
95 | 12 | wil | Boolean bExists |
96 | Handle hoRegistry |
||
97 | String sKey |
||
98 | String sPath |
||
99 | 14 | wil | Integer iVersion |
100 | 12 | wil | |
101 | 14 | wil | Move "" To sPath |
102 | 12 | wil | Get Create U_cRegistry to hoRegistry |
103 | |||
104 | If (hoRegistry) Begin |
||
105 | Set phRootKey of hoRegistry to HKEY_LOCAL_MACHINE |
||
106 | Set pfAccessRights of hoRegistry to Key_Read |
||
107 | 8 | wil | |
108 | 12 | wil | // check if this is a 64 bit machine |
109 | 14 | wil | // if so, the Wow6432Node key will exist <- unreliable test as it turns out |
110 | //Get KeyExists of hoRegistry "SOFTWARE\Wow6432Node" to bExists |
||
111 | Get HostOSis64Bits To bExists |
||
112 | 12 | wil | If bExists Begin |
113 | Move (Append("SOFTWARE\Wow6432Node\", CS_DAW_KEY)) to sKey |
||
114 | End |
||
115 | Else Begin |
||
116 | Move (Append("SOFTWARE\", CS_DAW_KEY)) to sKey |
||
117 | End |
||
118 | |||
119 | Get KeyExists of hoRegistry sKey to bExists |
||
120 | 14 | wil | If bExists Begin |
121 | Get CompiledRuntimeVersion To iVersion |
||
122 | If (iVersion<180) Begin |
||
123 | Move (sKey+"\"+CS_DAW_VDF+"\"+gsRuntimeVersion+"\Defaults\") To sKey |
||
124 | End |
||
125 | Else Begin |
||
126 | Move (sKey+"\"+ CS_DAW_DF+"\"+gsRuntimeVersion+"\Defaults\") To sKey |
||
127 | End |
||
128 | 12 | wil | Get OpenKey of hoRegistry sKey to bOpened |
129 | If bOpened Begin |
||
130 | Get ReadString of hoRegistry "VDFRootDir" To sPath |
||
131 | |||
132 | Send CloseKey of hoRegistry |
||
133 | End |
||
134 | End |
||
135 | |||
136 | Send Destroy of hoRegistry |
||
137 | 14 | wil | End |
138 | 12 | wil | |
139 | |||
140 | Function_Return sPath |
||
141 | 14 | wil | End_Function // CurrentRuntimeFolder |
142 | 12 | wil | |
143 | Procedure LoadVDFLanguageDefinition |
||
144 | Boolean bCreated |
||
145 | Boolean bExists |
||
146 | String sRootDir |
||
147 | String sLibDir |
||
148 | String sLanguageFile |
||
149 | 14 | wil | Integer iVersion |
150 | Handle hoLanguage |
||
151 | 12 | wil | Variant vLanguage |
152 | |||
153 | Get Create U_cComlanguage To hoLanguage |
||
154 | If (hoLanguage) Begin |
||
155 | 14 | wil | Send CreateComObject of hoLanguage |
156 | 12 | wil | Get IsComObjectCreated Of hoLanguage To bCreated |
157 | 14 | wil | If (bCreated) Begin |
158 | 12 | wil | Get CurrentRuntimeFolder to sRootDir |
159 | If (sRootDir<>"") Begin |
||
160 | Get vFolderFormat sRootDir To sRootDir |
||
161 | Move (sRootDir+"Lib\") To sLibDir |
||
162 | 14 | wil | |
163 | Get CompiledRuntimeVersion to iVersion |
||
164 | If (iVersion<180) Begin |
||
165 | Move (sLibDir+"VisualDataFlex.lng") To sLanguageFile |
||
166 | End |
||
167 | Else Begin |
||
168 | Move (sLibDir+"DataFlex.lng") To sLanguageFile |
||
169 | End |
||
170 | 12 | wil | Get vFilePathExists sLanguageFile to bExists |
171 | If (bExists) Begin |
||
172 | 14 | wil | Send ComLoadXmlDefinition of hoLanguage sLanguageFile |
173 | 12 | wil | Set ComName of hoLanguage To CS_LNG_VDF |
174 | 14 | wil | Send ComRegister of hoLanguage |
175 | 12 | wil | |
176 | Get pvComObject of hoLanguage To vLanguage |
||
177 | Set ComLanguage To vLanguage |
||
178 | |||
179 | Send Destroy of hoLanguage |
||
180 | End |
||
181 | Else Begin |
||
182 | Send Info_Box ("Can't load language for runtime"*gsRuntimeVersion*"Couldn't find language file\n"*sLanguageFile) |
||
183 | 14 | wil | End |
184 | 12 | wil | End |
185 | Else Begin |
||
186 | Send Info_Box ("Can't load language as unable to determine runtime folder for VDF"*gsRuntimeVersion) |
||
187 | 14 | wil | End |
188 | 12 | wil | End |
189 | 14 | wil | End |
190 | 12 | wil | End_Procedure // LoadVDFLanguageDefinition |
191 | 20 | wil | |
192 | 46 | wil | // |
193 | // Returns line numbers starting from line 0 (not line 1) |
||
194 | // Columns numbers are also zero based |
||
195 | // |
||
196 | 20 | wil | Function CurrentPosition Variant vPos Integer Byref iLine Integer Byref iColumn Returns Boolean |
197 | Boolean bOK |
||
198 | Handle hoPos |
||
199 | |||
200 | Move false To bOK |
||
201 | Get Create (RefClass(cComPosition)) To hoPos |
||
202 | If (hoPos) Begin |
||
203 | Set pvComObject of hoPos to vPos |
||
204 | Get ComLineNo of hoPos To iLine |
||
205 | Get ComColNo of hoPos To iColumn |
||
206 | Send Destroy of hoPos |
||
207 | Move True To bOk |
||
208 | End |
||
209 | Function_Return bOK |
||
210 | End_Function |
||
211 | |||
212 | Function CurrentLine Returns Integer |
||
213 | Boolean bOK |
||
214 | Integer iOffset |
||
215 | Integer llLine |
||
216 | Integer llColumn |
||
217 | Integer iLine |
||
218 | Variant vPos |
||
219 | |||
220 | Move 0 To iLine |
||
221 | Get ComSelStart to iOffset |
||
222 | //Get ComSelEnd to llColumn |
||
223 | Get ComOffsetToPos iOffset to vPos |
||
224 | //Get ComGetSel False to vSel |
||
225 | Get CurrentPosition vPos (&llLine) (&llColumn) To bOK |
||
226 | If (bOK) Begin |
||
227 | 46 | wil | Move (llLine+1) To iLine // +1 because line number returned is zero based. |
228 | 20 | wil | End |
229 | 49 | wil | If (llLine=0 and piCurrentLine(Self)<>0) Begin |
230 | 27 | wil | // .. not great .. |
231 | // if file was opened via stack and this window does not yet have the focus by clicking |
||
232 | // into the file, it will return line 0, as a result setting a breakpoint isn't reliable |
||
233 | // so... we use this ugly workaround. |
||
234 | Get piCurrentLine To iLine |
||
235 | End |
||
236 | 20 | wil | Function_Return iLine |
237 | End_Function |
||
238 | 27 | wil | |
239 | 42 | wil | Function WordAtPositionDoesNotWork Integer iLine Integer iColumn Returns String |
240 | 27 | wil | String sWord |
241 | String sLeadingChar |
||
242 | String sTrailingChar |
||
243 | 42 | wil | Handle hoPos |
244 | Variant vPos |
||
245 | |||
246 | Get Create (RefClass(cComPosition)) to hoPos |
||
247 | If (hoPos) Begin |
||
248 | Send CreateComObject to hoPos |
||
249 | Set ComLineNo of hoPos to iLine |
||
250 | Set ComColNo of hoPos to iColumn |
||
251 | Get pvComObject of hoPos to vPos |
||
252 | Move " (=+-*" to sLeadingChar |
||
253 | Move " ()=+-*" to sTrailingChar |
||
254 | // Won't work ComGetWordEx does not stop on any of the above characters |
||
255 | Get ComGetWordEx vPos sLeadingChar sTrailingChar to sWord |
||
256 | Send Destroy of hoPos |
||
257 | End |
||
258 | Function_Return sWord |
||
259 | End_Function |
||
260 | |||
261 | Function WordAtLinePosition String sLine Integer iColumn Returns String |
||
262 | String sWord |
||
263 | String sLeadingChar |
||
264 | String sTrailingChar |
||
265 | 27 | wil | String sChar |
266 | Integer iChar |
||
267 | Integer iStart |
||
268 | Integer iEnd |
||
269 | Integer iLength |
||
270 | Boolean bStop |
||
271 | |||
272 | 42 | wil | Move (CS_TAB+" (=+-*") To sLeadingChar |
273 | Move (CS_TAB+" ()=+-*") to sTrailingChar |
||
274 | |||
275 | Move False to bStop |
||
276 | Move iColumn to iChar |
||
277 | 27 | wil | if (iColumn>0) begin |
278 | While not bStop |
||
279 | Move (Mid(sLine,1,iChar)) To sChar |
||
280 | If (iChar<=0 or sLeadingChar contains sChar) begin |
||
281 | Move True To bStop |
||
282 | Move (iChar+1) To iStart |
||
283 | End |
||
284 | Decrement iChar |
||
285 | Loop |
||
286 | End |
||
287 | Move (length(sLine)) To iLength |
||
288 | For iChar from iColumn To iLength |
||
289 | Move (Mid(sLine,1,iChar)) To sChar |
||
290 | If (sTrailingChar contains sChar) begin |
||
291 | Move (iChar-1) to iEnd |
||
292 | Move iLength To iChar |
||
293 | End |
||
294 | Loop |
||
295 | If (iEnd=0) Move iLength To iEnd |
||
296 | Move (Mid(sLine,iEnd-iStart+1,iStart)) To sWord |
||
297 | Function_Return sWord |
||
298 | End_Function |
||
299 | |||
300 | 46 | wil | // Returns the word under the specified location. |
301 | // iLine and iColumn are zero based |
||
302 | // |
||
303 | 42 | wil | Function WordAtPosition Integer iLine Integer iColumn Returns String |
304 | String sWord |
||
305 | String sComment |
||
306 | String sLeadingChar |
||
307 | String sTrailingChar |
||
308 | String sChar |
||
309 | String sLine |
||
310 | Integer iCommentPos |
||
311 | Integer iChar |
||
312 | Boolean bBeforeLine |
||
313 | |||
314 | Get ComGetLine iLine To sLine |
||
315 | Move "//" to sComment |
||
316 | Move (Pos(sComment,sLine)) To iCommentPos |
||
317 | If (iCommentPos>0 and iCommentPos<iColumn and iColumn>0) Begin |
||
318 | Function_Return "" // caret is in a comment block |
||
319 | End |
||
320 | Move " (=+-*" to sLeadingChar |
||
321 | Move " ()=+-*" to sTrailingChar |
||
322 | Move True to bBeforeLine // test if caret is before any words on the line |
||
323 | For iChar from 1 to iColumn |
||
324 | Move (Mid(sLine,1,iChar)) to sChar |
||
325 | If not ( (sLeadingChar+sTrailingChar) contains sChar ) Begin |
||
326 | Move False to bBeforeLine |
||
327 | Move iColumn to iChar |
||
328 | End |
||
329 | Loop |
||
330 | If (bBeforeLine) Begin |
||
331 | Function_Return "" // before any words |
||
332 | End |
||
333 | Get WordAtLinePosition sLine iColumn To sWord |
||
334 | Function_Return sWord |
||
335 | End_Function |
||
336 | |||
337 | // |
||
338 | // A bunch of parsing problems happen because we don't know how many |
||
339 | // white space characters exist. This replaces multiple WS characters to just |
||
340 | // one space character. |
||
341 | // |
||
342 | Function SingleWhiteSpaceLine String sLine Returns String |
||
343 | Integer iLength |
||
344 | Integer iChar |
||
345 | Boolean bPrevWSChar |
||
346 | String sChar |
||
347 | String sSWSLine |
||
348 | String sWSChars |
||
349 | |||
350 | Move "" To sSWSLine |
||
351 | Move (CS_TAB+" ") To sWSChars |
||
352 | Move (length(sLine)) To iLength |
||
353 | Move False To bPrevWSChar |
||
354 | For iChar From 1 To iLength |
||
355 | Move (Mid(sLine,1,iChar)) to sChar |
||
356 | If (sWSChars contains sChar) begin |
||
357 | If (bPrevWSChar=false) Begin |
||
358 | Move True To bPrevWSChar |
||
359 | Move (sSWSLine+" ") To sSWSLine |
||
360 | End |
||
361 | End |
||
362 | Else Begin |
||
363 | Move False To bPrevWSChar |
||
364 | Move (sSWSLine+sChar) To sSWSLine |
||
365 | End |
||
366 | Loop |
||
367 | Function_Return sSWSLine |
||
368 | End_Function |
||
369 | |||
370 | // |
||
371 | // Tries to locate the object (or variable) in a notation like |
||
372 | // Get Property Of oObject To |
||
373 | // which should return oObject |
||
374 | // |
||
375 | Function IsPropertyOf String sProperty Integer iline Integer iColumn Returns String |
||
376 | Integer iPos |
||
377 | Integer iLength |
||
378 | Integer iObj |
||
379 | String sObject |
||
380 | String sLine |
||
381 | String sXLine |
||
382 | String slLine |
||
383 | |||
384 | Move "" To sObject |
||
385 | Get ComGetLine iLine To sLine |
||
386 | If (sLine<>"") Begin |
||
387 | Get SingleWhiteSpaceLine sLine To sXLine |
||
388 | Move (lowercase(sXLine)) To slLine |
||
389 | Move (Pos(lowercase(sProperty)+" of ",slLine)) To iPos |
||
390 | If (iPos) Begin |
||
391 | Move (Length(sProperty+" of ")) To iLength |
||
392 | Move (iPos+iLength+1) To iObj |
||
393 | Get WordAtLinePosition sXline iObj To sObject |
||
394 | End |
||
395 | |||
396 | End |
||
397 | Function_Return sObject |
||
398 | End_Function |
||
399 | |||
400 | // |
||
401 | // Properties that are queried which are not local to the focused object will need to |
||
402 | // be referenced in order to get the correct data back. |
||
403 | // This code will try to parse out the object. |
||
404 | // |
||
405 | 27 | wil | Function ObjectForProperty String sProperty Integer iLine Integer iColumn Returns String |
406 | String sObject |
||
407 | 42 | wil | String sOfObject |
408 | 27 | wil | String sLine |
409 | |||
410 | Move "Self" To sObject // the default target object is self |
||
411 | 42 | wil | Get IsPropertyOf sProperty iLine iColumn To sOfObject |
412 | If (sOfObject<>"") Begin |
||
413 | Move sOfObject To sObject |
||
414 | End |
||
415 | 27 | wil | Function_Return sObject |
416 | End_Function |
||
417 | 12 | wil | |
418 | 27 | wil | Procedure OnComQuickInfo Integer llLine Integer llColumn String ByRef llTipText |
419 | Handle hoDebugger |
||
420 | String sWord |
||
421 | String sResult |
||
422 | String sObjectID |
||
423 | String sObjectName |
||
424 | String sType |
||
425 | String sTargetObject |
||
426 | Boolean bIsProperty |
||
427 | 42 | wil | Boolean bIsProcedure |
428 | 27 | wil | Boolean bIsObject |
429 | 64 | wil | Boolean bIsKeyword |
430 | Boolean bPaused |
||
431 | 27 | wil | Boolean bOK |
432 | |||
433 | // Does not always return what we need |
||
434 | //Get ComCurrentWord To sWord // gets word under cursor |
||
435 | 42 | wil | Move False To bOk |
436 | 27 | wil | Get WordAtPosition llLine llColumn To sWord |
437 | If (sWord<>"") Begin |
||
438 | Get phoDebugger To hoDebugger |
||
439 | If (hoDebugger) Begin |
||
440 | Move "" To sResult |
||
441 | Move "" To sType |
||
442 | Move False To bIsObject |
||
443 | 64 | wil | Get pbProgramPaused Of hoDebugger To bPaused |
444 | If (bPaused) Begin |
||
445 | Get IsLanguageKeyword of hoDebugger sWord To bIsKeyword // |
||
446 | If (bIsKeyword=false) Begin |
||
447 | Get IsVariableProperty of hoDebugger sWord To bIsProperty |
||
448 | If (bIsProperty) Begin |
||
449 | Get ObjectForProperty sWord llLine llColumn to sTargetObject |
||
450 | Move (sWord+"("+sTargetObject+")") To sWord |
||
451 | Move "Property " To sType |
||
452 | 42 | wil | End |
453 | 64 | wil | Else Begin |
454 | Get IsVariableProcedure Of hoDebugger sWord To bIsProcedure |
||
455 | If (bIsProcedure) Begin |
||
456 | Move "Procedure " To sType |
||
457 | End |
||
458 | Else Begin |
||
459 | If (lowercase(sWord)="self") Begin |
||
460 | Move "Object " To sType |
||
461 | Move True To bIsObject |
||
462 | End |
||
463 | End |
||
464 | End |
||
465 | Move ("Evaluating "+sType+"'"+sWord+"' results in"+character(10)) To llTipText |
||
466 | If (bIsProcedure) Begin |
||
467 | Move "Not evaluating methods." To sResult |
||
468 | End |
||
469 | Else Begin |
||
470 | Get ComEval of hoDebugger sWord (&sResult) to bOK |
||
471 | End |
||
472 | 27 | wil | If (bOK) Begin |
473 | 64 | wil | If (bIsObject) Begin |
474 | Move sResult To sObjectID |
||
475 | Move "" To sObjectName |
||
476 | Get ComEval of hoDebugger ("name("+sObjectID+")") (&sObjectName) to bOK |
||
477 | If (bOK) Begin |
||
478 | Move (sResult+" ("+sObjectName+") ") To sResult |
||
479 | End |
||
480 | End |
||
481 | Move (sResult+character(10)+character(10)+"Eval OK") To sResult |
||
482 | 27 | wil | End |
483 | 64 | wil | Else Begin |
484 | Move (sResult+character(10)+character(10)+"Eval Failed") To sResult |
||
485 | End |
||
486 | 27 | wil | End |
487 | 64 | wil | Else Begin |
488 | Move ("Keyword "+sWord) To sResult |
||
489 | End |
||
490 | 27 | wil | End |
491 | Else Begin |
||
492 | 64 | wil | Move sWord To sResult |
493 | 27 | wil | End |
494 | 46 | wil | Move (sResult+", line="+trim(llLine+1)*", column="+Trim(llColumn+1)) To sResult |
495 | 27 | wil | End |
496 | Else Begin |
||
497 | Move "Unable to attach to debugger core" To sResult |
||
498 | End |
||
499 | End |
||
500 | Move (llTipText+sResult) To llTipText |
||
501 | End_Procedure |
||
502 | 12 | wil | |
503 | 27 | wil | |
504 | 12 | wil | Procedure OnCreate |
505 | 20 | wil | Handle hWnd |
506 | Handle hWndImg |
||
507 | Handle hoImgList |
||
508 | 12 | wil | Variant vImageList |
509 | // Boolean bCreated |
||
510 | |||
511 | Forward Send OnCreate |
||
512 | |||
513 | // ToDo: Set the ActiveX properties here... |
||
514 | 20 | wil | // ComImageListRef |
515 | // ComHImageList // line margin images |
||
516 | //Set ComHImageList To (oEditImages(Self))//vImageList |
||
517 | |||
518 | 12 | wil | Send LoadVDFLanguageDefinition |
519 | 20 | wil | // |
520 | Set ComDisplayLeftMargin To True |
||
521 | Send ComSetColor OLEcmClrLeftMargin clLtGray |
||
522 | Set ComBorderStyle To OLEcmBorderClient |
||
523 | |||
524 | //Get Window_Handle of oCodeMaxImages To hWnd |
||
525 | Get phImageList Of oCodeMaxImages To hWndImg |
||
526 | //Move (oCodeMaxImages(Self)) To hoImgList |
||
527 | Set ComHImageList To hWndImg //vImageList |
||
528 | //Set ComImageListRef To hWndImg |
||
529 | 12 | wil | End_Procedure |
530 | 8 | wil | |
531 | 24 | wil | Procedure UpdateStatusHelp |
532 | Integer Fg |
||
533 | Move 1 To Fg |
||
534 | Send Request_Status_Help Fg |
||
535 | End_Procedure |
||
536 | 12 | wil | |
537 | 24 | wil | // update status bar when cursor is moving |
538 | Procedure onCaretPosChanged |
||
539 | Send UpdateStatusHelp |
||
540 | End_Procedure |
||
541 | |||
542 | // The caret position changed |
||
543 | Procedure OnComSelChange |
||
544 | Send onCaretPosChanged |
||
545 | Forward Send OnComSelChange |
||
546 | End_Procedure |
||
547 | |||
548 | 72 | wil | Procedure DisplayBreakPoints UInteger[] BreakPoints |
549 | Integer iItem |
||
550 | Integer iCount |
||
551 | UInteger iLine |
||
552 | |||
553 | Move (SizeOfArray(BreakPoints)) To iCount |
||
554 | For iItem From 0 To (iCount-1) |
||
555 | Move BreakPoints[iItem] To iLine |
||
556 | Send ComSetMarginImages (iLine-1) ICO_Brkp_obj // 4 |
||
557 | Loop |
||
558 | End_Procedure |
||
559 | 24 | wil | |
560 | |||
561 | 8 | wil | Procedure doOpenSourceFile String sFileName |
562 | 72 | wil | Handle hoDebugger |
563 | String sLanguage |
||
564 | UInteger[] BreakPoints |
||
565 | 8 | wil | Variant vLanguage |
566 | |||
567 | 38 | wil | Send ComOpenFile sFileName |
568 | 14 | wil | |
569 | 8 | wil | Set psFilename To sFileName |
570 | 14 | wil | |
571 | 8 | wil | Set ComReadOnly To True // NO changes allowed |
572 | Set ComColorSyntax To True |
||
573 | |||
574 | 72 | wil | Get phoDebugger To hoDebugger |
575 | If (hoDebugger) Begin |
||
576 | Get ListBreakPointsForFile Of hoDebugger sFileName To BreakPoints |
||
577 | Send DisplayBreakPoints BreakPoints |
||
578 | End |
||
579 | |||
580 | 8 | wil | // Update view hosting our control |
581 | 38 | wil | //Send doSetCaptionLabel sFileName |
582 | End_Procedure // doOpenSourceFile |
||
583 | 8 | wil | |
584 | Procedure doOpenSourceFileAtLine String sFileName Integer iLine |
||
585 | 20 | wil | Integer eBkLineColor |
586 | 64 | wil | Integer iTopMostLine |
587 | 8 | wil | Boolean bVisible |
588 | Boolean bScrollup |
||
589 | |||
590 | 72 | wil | Move false To bScrollup |
591 | // not optimal, but wait on codemax retirement for optimizing this |
||
592 | //If (psFileName(Self)<>sFileName) Begin |
||
593 | Send doOpenSourceFile sFileName |
||
594 | //End |
||
595 | 64 | wil | Set piCurrentLine to iLine |
596 | Move iLine to iTopMostLine |
||
597 | If (iLine>5) Begin |
||
598 | Move (iLine-4) to iTopMostLine // scroll up a bit so we can see context |
||
599 | 8 | wil | Move true to bScrollup |
600 | 20 | wil | End |
601 | 64 | wil | Send ComSetTopIndex 0 iTopMostLine |
602 | If (iLine>=0) Begin |
||
603 | Send ComSetMarginImages (iLine-1) ICO_Inst_ptr //ICO_Brkp_obj// 2 |
||
604 | //Set psFilename of oCodeMax To sFileName |
||
605 | // Make it visible to the user where we are |
||
606 | //Move True to bVisible |
||
607 | //Send ComSelectLine of oCodeMax iLine bVisible |
||
608 | Move (RGB(223,253,193)) to eBkLineColor |
||
609 | Send ComSetLineColor (iLine-1) eBkLineColor //clYellow |
||
610 | End |
||
611 | 8 | wil | |
612 | 24 | wil | Send UpdateStatusHelp |
613 | |||
614 | 20 | wil | // Send ComSetLineColor iLine clRed |
615 | 38 | wil | End_Procedure // doOpenSourceFileAtLine |
616 | 8 | wil | |
617 | 38 | wil | End_Class |