vdfsplat / AppSrc / VdfSplat.src @ 72
History | View | Annotate | Download (26.7 KB)
1 | 8 | wil | //TH-Header |
---|---|---|---|
2 | //***************************************************************************************** |
||
3 | // Copyright (c) 2013 Antwise Solutions |
||
4 | // All rights reserved. |
||
5 | // |
||
6 | // $FileName : VdfSplat.src |
||
7 | 22 | wil | // $ProjectName : Splat ! Vdf Debugger |
8 | 8 | wil | // $Authors : Wil van Antwerpen |
9 | // $Created : 12.14.2013 23:42 |
||
10 | // $Type : GPLv2 |
||
11 | // |
||
12 | // Contents: |
||
13 | // |
||
14 | //***************************************************************************************** |
||
15 | //TH-RevisionStart |
||
16 | //TH-RevisionEnd |
||
17 | |||
18 | 22 | wil | Use DFAllEnt.pkg |
19 | 49 | wil | Use cToolTipController.pkg |
20 | 7 | wil | Use cDebugCJCommandBarSystem.pkg |
21 | 10 | wil | Use vWin32fh.pkg |
22 | Use seq_chnl.pkg |
||
23 | 35 | wil | Use cSplatApplication.pkg |
24 | 43 | wil | Use cSplatPanel.pkg |
25 | 2 | wil | |
26 | Object oHtmlHelp is a cHtmlHelp |
||
27 | End_Object |
||
28 | |||
29 | 35 | wil | Object oApplication is a cSplatApplication |
30 | 2 | wil | Set peHelpType to htHtmlHelp |
31 | 46 | wil | |
32 | 31 | wil | Set psAutoOpenWorkspace to "" // We're not using data files, the exe has to be completely self contained. |
33 | 2 | wil | End_Object |
34 | |||
35 | 49 | wil | Object oToolTipController is a cToolTipController |
36 | Move Self to ghoToolTipController |
||
37 | End_Object |
||
38 | |||
39 | 2 | wil | Use oEditContextMenu.pkg |
40 | Use oDEOEditContextMenu.pkg |
||
41 | |||
42 | 37 | wil | #IF (1=0) |
43 | // This imagelist is a dummy, it is only used to have the Studio recognize |
||
44 | // which bitmaps are used in the application so that a "Scan Bitmaps" will always |
||
45 | // include the bitmaps as embedded resource. The imagelist itself is not used. |
||
46 | Object ImageContainer is a cImageList32 |
||
47 | Set piMaxImages to 10 |
||
48 | Procedure OnCreate |
||
49 | Integer iImage |
||
50 | Get AddImage "Debugger.bmp/t" to iImage |
||
51 | End_Procedure |
||
52 | End_Object |
||
53 | #ENDIF |
||
54 | |||
55 | 43 | wil | Object oMain is a cSplatPanel |
56 | 2 | wil | Set Label to "VdfSplat" |
57 | Set Location to 4 3 |
||
58 | 22 | wil | Set Size to 300 450 |
59 | 2 | wil | |
60 | 8 | wil | // Make sure it can be used here already |
61 | Use cDebuggerEngine.pkg |
||
62 | |||
63 | 7 | wil | |
64 | 65 | wil | Object oOpenProgramDialog Is an OpenDialog |
65 | Set Dialog_Caption to "Select a DataFlex executable file to debug" |
||
66 | 7 | wil | Set Filter_String to 'Visual DataFlex Executables|*.exe' |
67 | Set Initial_Folder to 'C:\Program Files\Visual DataFlex' |
||
68 | // Set MultiSelect_State To False |
||
69 | Set NoChangeDir_State To True // don't touch my current folder |
||
70 | Set CreatePrompt_State To False |
||
71 | Set HideReadOnly_State To True |
||
72 | Set Filter_Index to 2 |
||
73 | 22 | wil | End_Object |
74 | 25 | wil | |
75 | Object oOpenSourceFileDialog is an OpenDialog |
||
76 | Set Filter_String to 'Visual DataFlex source|*.*' |
||
77 | // Set Initial_Folder to 'C:\Program Files\Visual DataFlex' |
||
78 | // Set MultiSelect_State To False |
||
79 | Set NoChangeDir_State To True // don't touch my current folder |
||
80 | Set CreatePrompt_State To False |
||
81 | Set HideReadOnly_State To True |
||
82 | Set Filter_Index to 2 |
||
83 | End_Object |
||
84 | 2 | wil | |
85 | 10 | wil | Procedure Warning_Box String sMessage String sCaption |
86 | Integer eResponse |
||
87 | |||
88 | Get Message_Box sMessage sCaption MB_OK MB_ICONWARNING to eResponse |
||
89 | 22 | wil | End_Procedure // Warning_Box |
90 | 10 | wil | |
91 | Procedure Fishy_Box String sMessage String sDebugfile |
||
92 | Send Warning_Box ("Sorry but the debug file for the executable you choose\n\n"+; |
||
93 | sDebugfile+"\ndoesn't look like it is valid.\n\n"+sMessage+"\n\nPlease try again.") ; |
||
94 | "VdfSplat thinks this is fishy" |
||
95 | 22 | wil | End_Procedure // Fishy_Box |
96 | 10 | wil | |
97 | // |
||
98 | // Reads the runtime version of the .dbg file passed. |
||
99 | 22 | wil | // The file must exist. |
100 | 10 | wil | // |
101 | Function ReadRuntimeVersion String sDebugFile Returns Integer |
||
102 | Integer iRuntime |
||
103 | 22 | wil | Integer iChIn |
104 | 10 | wil | Integer iFileSize |
105 | Integer iVdfMax |
||
106 | Integer iVdfMin |
||
107 | String sBinary |
||
108 | |||
109 | 22 | wil | Move 0 To iRuntime |
110 | 10 | wil | Get vWin32_APIFileSize sDebugFile to iFileSize |
111 | If (iFileSize > 40000) Begin |
||
112 | |||
113 | 22 | wil | Get Seq_Open_Input_Channel sDebugfile to iChIn |
114 | 10 | wil | Direct_Input channel iChIn ("binary:" + sDebugfile) |
115 | Read_Block channel iChIn sBinary 50 |
||
116 | Send Seq_Close_Channel iChIn |
||
117 | If (Left(sBinary,4)="VDFB") Begin |
||
118 | Move (Ascii(Mid(sBinary,1,5))) To iVdfMax |
||
119 | Move (Ascii(Mid(sBinary,1,9))) To iVdfMin |
||
120 | 16 | wil | If ((iVdfMax>2 and iVdfMax < 26) and (iVdfMin<5)) Begin |
121 | 10 | wil | Move ((iVdfMax*10)+iVdfMin) To iRuntime |
122 | End |
||
123 | Else Begin |
||
124 | Send Fishy_Box ("The debug file suggests this is VDF version"*trim(iVdfMax)+"."+trim(iVdfMin)+"\nNot very likely that.") sDebugfile |
||
125 | 22 | wil | End |
126 | 10 | wil | End |
127 | Else Begin |
||
128 | Send Fishy_Box "The debug file signature is not correct." sDebugfile |
||
129 | End |
||
130 | End |
||
131 | Else Begin |
||
132 | Send Fishy_Box "It is wayyy too small." sDebugfile |
||
133 | 22 | wil | End |
134 | 10 | wil | Function_Return iRuntime |
135 | 22 | wil | End_Function // ReadRuntimeVersion |
136 | 10 | wil | |
137 | 24 | wil | Procedure doOpenFile |
138 | 27 | wil | Handle hoDebug |
139 | 25 | wil | Handle hoEditor |
140 | Handle hoDialog |
||
141 | Boolean bOpen |
||
142 | Boolean bIsValid |
||
143 | String sFileName |
||
144 | 24 | wil | |
145 | Get phoDebugger to hoDebug |
||
146 | If (hoDebug) Begin |
||
147 | 25 | wil | Move (oOpenSourceFileDialog(Self)) To hoDialog |
148 | |||
149 | Get Show_Dialog of hoDialog to bOpen |
||
150 | If bOpen Begin |
||
151 | Get File_Name of hoDialog To sFileName |
||
152 | Get ComIsValidSourceFile of hoDebug sFileName To bIsValid |
||
153 | If (bIsValid) Begin |
||
154 | Get phoEditor to hoEditor |
||
155 | If (hoEditor) Begin |
||
156 | Send DoOpenSourceFile of hoEditor sFileName |
||
157 | End |
||
158 | End |
||
159 | Else Begin |
||
160 | Send Info_Box "source file is not part of selected program we are currently debugging." |
||
161 | End |
||
162 | End |
||
163 | |||
164 | 24 | wil | End |
165 | End_Procedure // doOpenFile |
||
166 | |||
167 | 64 | wil | Procedure DoInitializeParameters |
168 | Set piDebugfileVersion To 0 |
||
169 | //Set phoDebugger To 0 |
||
170 | Set psApplication Of ghoApplication To "" |
||
171 | End_Procedure |
||
172 | |||
173 | // |
||
174 | // Locates the debug file for the application binary passed. |
||
175 | // Returns TRUE if found and sets property piDebugFileVersion |
||
176 | // |
||
177 | Function ParseApplicationDebugFile String sApplication Returns Boolean |
||
178 | Boolean bExists |
||
179 | Integer iRuntime |
||
180 | String sExt |
||
181 | String sDebugfile |
||
182 | |||
183 | Get ParseFileExtension sApplication To sExt |
||
184 | Move (Replace("."+sExt,sApplication,".dbg")) To sDebugfile |
||
185 | Get vFilePathExists sDebugfile to bExists |
||
186 | If (bExists=false) Begin |
||
187 | Send Warning_Box ("Sorry but for the executable chosing the corresponding debug file\n"+; |
||
188 | sDebugfile+"\ncould not be located.\n\nPlease select again.") ; |
||
189 | "VdfSplat can't do that" |
||
190 | End |
||
191 | Else Begin |
||
192 | Get ReadRuntimeVersion sDebugfile To iRuntime |
||
193 | If (iRuntime=0) Begin |
||
194 | Move False To bExists |
||
195 | End |
||
196 | Else Begin |
||
197 | Set piDebugfileVersion To iRuntime |
||
198 | End |
||
199 | End |
||
200 | |||
201 | Function_Return bExists |
||
202 | End_Function |
||
203 | |||
204 | 72 | wil | Procedure doOpenProgram |
205 | Boolean bOpen |
||
206 | Handle hoDialog |
||
207 | String sApplication |
||
208 | |||
209 | Move (oOpenProgramDialog(Self)) To hoDialog |
||
210 | |||
211 | Get Show_Dialog of hoDialog to bOpen |
||
212 | If bOpen Begin |
||
213 | Get File_Name of hoDialog To sApplication |
||
214 | Send DoSetCaptionLabel Of (oVdfDbg(oClientArea(Self))) sApplication |
||
215 | Set psApplication of ghoApplication To sApplication |
||
216 | End |
||
217 | Else Send Info_Box "You did not choose a file, nothing to debug." |
||
218 | End_Procedure |
||
219 | |||
220 | 7 | wil | Procedure doDebugRun |
221 | 10 | wil | Boolean bExists |
222 | 64 | wil | Boolean bRestartMode |
223 | 8 | wil | Handle hoDebug |
224 | 22 | wil | Handle hoParent |
225 | 72 | wil | String sApplication |
226 | 10 | wil | |
227 | 35 | wil | Get psApplication of ghoApplication To sApplication |
228 | 22 | wil | If (sApplication = "") Begin |
229 | 72 | wil | Send doOpenProgram |
230 | Get psApplication of ghoApplication To sApplication |
||
231 | 22 | wil | End |
232 | 10 | wil | If (sApplication="") Begin |
233 | 72 | wil | // Oh still no app? Nothing to debug then |
234 | 35 | wil | Procedure_Return |
235 | 22 | wil | End |
236 | 64 | wil | Get ParseApplicationDebugFile sApplication To bExists |
237 | |||
238 | Get phoDebugger to hoDebug |
||
239 | If (hoDebug) Begin |
||
240 | Get pbDebugRestart of hoDebug to bRestartMode |
||
241 | If (bRestartMode) Begin |
||
242 | 72 | wil | If (IsComObjectCreated(hoDebug)) Begin |
243 | Send ReleaseComObject of hoDebug |
||
244 | End |
||
245 | 64 | wil | Send Destroy of hoDebug |
246 | 65 | wil | Move 0 To hoDebug |
247 | 10 | wil | End |
248 | 22 | wil | End |
249 | 10 | wil | If (bExists and hoDebug=0) Begin |
250 | 20 | wil | // |
251 | |||
252 | Get phoDebuggerHost To hoParent |
||
253 | 64 | wil | Get Create Of hoParent (RefClass(cDebuggerEngine)) To hoDebug |
254 | 8 | wil | If (hoDebug) Begin |
255 | Send DoCreateEngine of hoDebug |
||
256 | 20 | wil | End |
257 | End |
||
258 | 10 | wil | If (bExists and hoDebug<>0) Begin |
259 | |||
260 | 35 | wil | Set psApplication of ghoApplication To sApplication |
261 | 20 | wil | Set ApplicationFileName of hoDebug To sApplication |
262 | 38 | wil | // ?? |
263 | 60 | wil | Send DoStartDebug |
264 | End |
||
265 | End_Procedure // doDebugRun |
||
266 | |||
267 | Procedure DoStartDebug |
||
268 | String sApplication |
||
269 | Integer iRuntime |
||
270 | Handle hoDebug |
||
271 | |||
272 | Get phoDebugger to hoDebug |
||
273 | If (hoDebug<>0) Begin |
||
274 | Get psApplication Of ghoApplication To sApplication |
||
275 | Get piDebugfileVersion To iRuntime |
||
276 | 7 | wil | //Send ComPause of hoDebug |
277 | //Procedure ComStartProgram String llcmdLine Variant llwebApp Variant llurl |
||
278 | 16 | wil | If (iRuntime<181) Begin |
279 | Send ComStartProgram of hoDebug sApplication false "" |
||
280 | End |
||
281 | Else Begin // noheap or heap? that's' the question. |
||
282 | Send ComStartProgram181 of hoDebug sApplication True false "" |
||
283 | End |
||
284 | 22 | wil | Send ComUpdateViews Of hoDebug |
285 | End |
||
286 | 60 | wil | End_Procedure |
287 | 7 | wil | |
288 | Procedure doStopDebug |
||
289 | 64 | wil | Boolean bPaused |
290 | Boolean bBreakMode |
||
291 | Handle hoDebug |
||
292 | 7 | wil | |
293 | Get phoDebugger to hoDebug |
||
294 | If (hoDebug) Begin |
||
295 | 64 | wil | Get pbLimitedBreakMode of hoDebug to bBreakMode |
296 | Get HasProgramPaused To bPaused |
||
297 | If (bPaused) Begin |
||
298 | //Send doDebugContinue |
||
299 | End |
||
300 | 7 | wil | Send ComStopProgram of hoDebug |
301 | 20 | wil | Send ComUpdateViews Of hoDebug |
302 | 64 | wil | If (bBreakMode=False) Begin |
303 | // You cannot destroy the debugger on here as the messageloop has to run to get the debuggee back to run |
||
304 | // so killing it here would be out of sync with what you want. |
||
305 | //Send Destroy of hoDebug |
||
306 | Send DoInitializeParameters |
||
307 | 65 | wil | End |
308 | 20 | wil | End |
309 | 7 | wil | End_Procedure // doStopDebug |
310 | |||
311 | 64 | wil | Procedure DoRestartDebug |
312 | String sApplication |
||
313 | |||
314 | Get psApplication of ghoApplication To sApplication |
||
315 | Set pbDebugRestart of (phoDebugger(Self)) to True |
||
316 | Send DoStopDebug |
||
317 | //Sleep 1 |
||
318 | Set psApplication of ghoApplication To sApplication |
||
319 | End_Procedure |
||
320 | |||
321 | 2 | wil | Procedure doDebugPause |
322 | Handle hoDebug |
||
323 | |||
324 | Get phoDebugger to hoDebug |
||
325 | If (hoDebug) Begin |
||
326 | Send ComPause of hoDebug |
||
327 | 22 | wil | Send ComUpdateViews Of hoDebug |
328 | End |
||
329 | End_Procedure // doDebugPause |
||
330 | 2 | wil | |
331 | Procedure doDebugContinue |
||
332 | Handle hoDebug |
||
333 | |||
334 | Get phoDebugger to hoDebug |
||
335 | If (hoDebug) Begin |
||
336 | Send ComContinue of hoDebug |
||
337 | 22 | wil | Send ComUpdateViews Of hoDebug |
338 | End |
||
339 | 2 | wil | End_Procedure // doDebugContinue |
340 | |||
341 | Procedure doDebugStepOver |
||
342 | Handle hoDebug |
||
343 | |||
344 | Get phoDebugger to hoDebug |
||
345 | If (hoDebug) Begin |
||
346 | Send ComStepOver of hoDebug |
||
347 | 22 | wil | Send ComUpdateViews Of hoDebug |
348 | End |
||
349 | End_Procedure // doDebugStepOver |
||
350 | 7 | wil | |
351 | Procedure doDebugStepInto |
||
352 | Handle hoDebug |
||
353 | |||
354 | Get phoDebugger to hoDebug |
||
355 | If (hoDebug) Begin |
||
356 | Send ComStepInto of hoDebug |
||
357 | 22 | wil | Send ComUpdateViews Of hoDebug |
358 | End |
||
359 | 7 | wil | End_Procedure // doDebugStepInto |
360 | |||
361 | Procedure doDebugStepOut |
||
362 | Handle hoDebug |
||
363 | |||
364 | Get phoDebugger to hoDebug |
||
365 | If (hoDebug) Begin |
||
366 | Send ComStepOut of hoDebug |
||
367 | 22 | wil | Send ComUpdateViews Of hoDebug |
368 | End |
||
369 | 7 | wil | End_Procedure // doDebugStepOut |
370 | 12 | wil | |
371 | 20 | wil | Procedure doSetBreakPoint |
372 | 12 | wil | Integer iLine |
373 | String sFileName |
||
374 | Boolean bSuccess |
||
375 | Handle hoDebugger |
||
376 | Handle hoEditor |
||
377 | |||
378 | Get phoDebugger to hoDebugger |
||
379 | Get phoEditor To hoEditor |
||
380 | If (hoDebugger<>0 and hoEditor<>0) begin |
||
381 | |||
382 | Get psFileName Of hoEditor To sFileName |
||
383 | 20 | wil | Get CurrentLine Of hoEditor To iLine |
384 | 12 | wil | If (sFileName<>"" and iLine<>0) Begin |
385 | 20 | wil | Get SetBreakPoint of hoDebugger sFileName (&iLine) To bSuccess |
386 | 37 | wil | If (bSuccess=false) Begin |
387 | Send info_box ("Set breakpoint at line"*trim(iLine)*"Failed.\nReturned="*trim(bSuccess)) |
||
388 | End |
||
389 | 20 | wil | //Send ComSetMarginImages iLine 1 |
390 | End |
||
391 | 12 | wil | End |
392 | 20 | wil | End_Procedure |
393 | |||
394 | Procedure doRemoveBreakPoint |
||
395 | Integer iLine |
||
396 | String sFileName |
||
397 | Boolean bSuccess |
||
398 | Handle hoDebugger |
||
399 | Handle hoEditor |
||
400 | |||
401 | Get phoDebugger to hoDebugger |
||
402 | Get phoEditor To hoEditor |
||
403 | If (hoDebugger<>0 and hoEditor<>0) begin |
||
404 | |||
405 | Get psFileName Of hoEditor To sFileName |
||
406 | Get CurrentLine Of hoEditor To iLine |
||
407 | If (sFileName<>"" and iLine<>0) Begin |
||
408 | Get RemoveBreakPoint of hoDebugger sFileName (&iLine) To bSuccess |
||
409 | 37 | wil | If (bSuccess=false) Begin |
410 | Send info_box ("Removing breakpoint at line"*trim(iLine)*"Failed.\nReturned="*trim(bSuccess)) |
||
411 | End |
||
412 | 20 | wil | //Send ComSetMarginImages iLine 1 |
413 | End |
||
414 | End |
||
415 | End_Procedure |
||
416 | 2 | wil | |
417 | 8 | wil | // |
418 | //Procedure doCreateCallStack |
||
419 | // Boolean bCreated |
||
420 | // Handle hoCallStack |
||
421 | // |
||
422 | 22 | wil | // |
423 | 8 | wil | // Get phoCallStack To hoCallStack |
424 | // If (hoCallStack) Begin |
||
425 | // Send CreateComObject of hoCallStack |
||
426 | // Get IsComObjectCreated Of hoCallStack To bCreated |
||
427 | // Showln "callstack [" bCreated "]" |
||
428 | // If (bCreated) Begin |
||
429 | 22 | wil | // Send RegisterComEvents Of hoCallStack |
430 | 8 | wil | // //Set ComWindowType Of hoGlobals To 1 // global |
431 | 22 | wil | // End |
432 | 8 | wil | // End |
433 | //End_Procedure // doCreateCallStack |
||
434 | 2 | wil | |
435 | 7 | wil | Function HasProgramStarted Returns Boolean |
436 | Boolean bStarted |
||
437 | Handle hoDebugger |
||
438 | |||
439 | Move False To bStarted |
||
440 | Get phoDebugger To hoDebugger |
||
441 | If (hoDebugger) Begin |
||
442 | Get pbProgramStarted of hoDebugger To bStarted |
||
443 | 22 | wil | End |
444 | 7 | wil | Function_Return bStarted |
445 | 22 | wil | End_Function // HasProgramStarted |
446 | 2 | wil | |
447 | 7 | wil | // |
448 | // A program can only be paused after it has started |
||
449 | // This is used as an indication that we can step through the source |
||
450 | 64 | wil | // The property pbProgramPaused is set on both a breakpoint and on a Pause |
451 | 7 | wil | Function HasProgramPaused Returns Boolean |
452 | 22 | wil | Boolean bPaused |
453 | 7 | wil | Boolean bStarted |
454 | Handle hoDebugger |
||
455 | |||
456 | Move False To bPaused |
||
457 | Get HasProgramStarted To bStarted |
||
458 | If (bStarted) Begin |
||
459 | Get phoDebugger To hoDebugger |
||
460 | If (hoDebugger) Begin |
||
461 | Get pbProgramPaused of hoDebugger to bPaused |
||
462 | 22 | wil | End |
463 | End |
||
464 | 7 | wil | Function_Return bPaused |
465 | 22 | wil | End_Function // HasProgramPaused |
466 | 7 | wil | |
467 | 37 | wil | // |
468 | // A breakpoint can only be removed if we have existing breakpoints |
||
469 | // |
||
470 | Function HasBreakpoints Returns Boolean |
||
471 | Boolean bHasBreakPoints |
||
472 | Boolean bStarted |
||
473 | Handle hoDebugger |
||
474 | |||
475 | Move False To bHasBreakPoints |
||
476 | Get HasProgramStarted To bStarted |
||
477 | If (bStarted) Begin |
||
478 | Get phoDebugger To hoDebugger |
||
479 | If (hoDebugger) Begin |
||
480 | Get HasBreakPoints of hoDebugger to bHasBreakPoints |
||
481 | End |
||
482 | End |
||
483 | Function_Return bHasBreakPoints |
||
484 | End_Function // HasBreakPoints |
||
485 | 7 | wil | |
486 | 37 | wil | |
487 | 2 | wil | |
488 | 7 | wil | Object oCommandBarSystem is a cDebugCJCommandBarSystem |
489 | 2 | wil | |
490 | Procedure OnCreateCommandBars |
||
491 | Handle hoOptions |
||
492 | Get OptionsObject to hoOptions |
||
493 | Forward Send OnCreateCommandBars |
||
494 | End_Procedure |
||
495 | 7 | wil | |
496 | 2 | wil | |
497 | Object oMenuBar is a cCJMenuBar |
||
498 | |||
499 | Object oFileMenu is a cCJMenuItem |
||
500 | 22 | wil | Set peControlType to xtpControlPopup |
501 | 2 | wil | Set psCaption to "&File" |
502 | Set psDescription to "Find, Save, Delete, Clear information or quit this application." |
||
503 | Set psCategory to "Menus" |
||
504 | 72 | wil | |
505 | Object oOpenProgramButton Is a cCJOpenProgramMenuItem |
||
506 | 2 | wil | Set pbAddToDesignerMenu to True |
507 | End_Object |
||
508 | |||
509 | Object oCJDebugPauseMenuItem is a cCJDebugPauseMenuItem |
||
510 | Set pbAddToDesignerMenu to True |
||
511 | Set pbControlBeginGroup to True |
||
512 | End_Object |
||
513 | |||
514 | |||
515 | Object oExitMenu is a cCJExitMenuItem |
||
516 | Set pbControlBeginGroup to True |
||
517 | End_Object |
||
518 | |||
519 | End_Object |
||
520 | |||
521 | Object oViewMenu is a cCJMenuItem |
||
522 | Set peControlType to xtpControlPopup |
||
523 | Set psCaption to "&View" |
||
524 | Set psToolTip to "View" |
||
525 | Set psDescription to "Available Views" |
||
526 | |||
527 | Object ooVdfdbgMenuItem is a cCJMenuItem |
||
528 | 7 | wil | Set psCaption to "Debugger View" |
529 | Set psTooltip to "The debugger main view" |
||
530 | 2 | wil | |
531 | Procedure OnExecute Variant vCommandBarControl |
||
532 | Handle hoClient |
||
533 | Get Client_Id to hoClient |
||
534 | Send Activate_oVdfdbg of hoClient |
||
535 | End_Procedure |
||
536 | End_Object |
||
537 | 24 | wil | |
538 | Object oObjectInspectorMenuItem is a cCJMenuItem |
||
539 | Set psCaption to "Object Inspector Ctrl+L" |
||
540 | Set psTooltip to "Inspect the objects in the running program" |
||
541 | |||
542 | Procedure OnExecute Variant vCommandBarControl |
||
543 | Handle hoClient |
||
544 | Get Client_Id to hoClient |
||
545 | Send doActivateObjectInspectorPanel of hoClient |
||
546 | End_Procedure |
||
547 | |||
548 | Function IsEnabled Returns Boolean |
||
549 | Boolean bPaused |
||
550 | |||
551 | Get HasProgramPaused To bPaused |
||
552 | Function_Return bPaused |
||
553 | End_Function |
||
554 | End_Object |
||
555 | 2 | wil | End_Object |
556 | |||
557 | Object oNavigateMenu is a cCJMenuItem |
||
558 | 22 | wil | Set peControlType to xtpControlPopup |
559 | Set psCaption to "&Navigate" |
||
560 | Set psTooltip to "Navigate" |
||
561 | 2 | wil | Set psDescription to "Move to different areas of the application" |
562 | |||
563 | Object oNextAreaMenu is a cCJNextAreaMenu |
||
564 | End_Object |
||
565 | |||
566 | Object oPriorAreaMenu is a cCJPriorAreaMenu |
||
567 | End_Object |
||
568 | |||
569 | Object oNextViewMenu is a cCJNextViewMenu |
||
570 | End_Object |
||
571 | |||
572 | Object oPriorViewMenu is a cCJPriorViewMenu |
||
573 | End_Object |
||
574 | |||
575 | Object oPromptMenu is a cCJPromptMenuItem |
||
576 | Set pbControlBeginGroup to True |
||
577 | End_Object |
||
578 | |||
579 | Object oZoomMenu is a cCJZoomMenuItem |
||
580 | End_Object |
||
581 | |||
582 | End_Object |
||
583 | |||
584 | Object oWindowMenu is a cCJMDIWindowsMenuItem |
||
585 | Set peControlType to xtpControlPopup |
||
586 | Set psCaption to "&Window" |
||
587 | Set psToolTip to "Window" |
||
588 | 22 | wil | Set psDescription to "Display Current Views and set other display options." |
589 | 2 | wil | |
590 | 22 | wil | // These are the static windows items. More will be created in onInitPopup |
591 | 2 | wil | Object oDisplayOptionsMenu is a cCJMenuItem |
592 | 22 | wil | Set peControlType to xtpControlPopup |
593 | 2 | wil | Set psCaption to "&Display Options" |
594 | Set psToolTip to "Display Options" |
||
595 | Set psDescription to "Set display options" |
||
596 | |||
597 | Object oStatusbarMenu is a cCJStatusbarMenuItem |
||
598 | End_Object |
||
599 | |||
600 | Object oAutoArrangeIconsMenu is a cCJAutoArrangeIconsMenuItem |
||
601 | End_Object |
||
602 | |||
603 | Object oRestoreMenusMenu is a cCJRestoreMenusMenuItem |
||
604 | Set pbControlBeginGroup to True |
||
605 | End_Object |
||
606 | |||
607 | End_Object |
||
608 | |||
609 | Object oCascadeMenu is a cCJCascadeMenuItem |
||
610 | Set pbControlBeginGroup to True |
||
611 | End_Object |
||
612 | |||
613 | Object oHorizTile is a cCJTileHorizontally |
||
614 | End_Object |
||
615 | |||
616 | Object oVertTile is a cCJTileVertically |
||
617 | End_Object |
||
618 | |||
619 | Object oMinimizeMenuItem is a cCJMinimizeWindowsMenuItem |
||
620 | Set pbControlBeginGroup to True |
||
621 | End_Object |
||
622 | |||
623 | Object oRestoreMenuItem is a cCJRestoreWindowsMenuItem |
||
624 | End_Object |
||
625 | |||
626 | Object oArrangeIconsMenuItem is a cCJAutoArrangeIconsMenuItem |
||
627 | Set pbControlBeginGroup to True |
||
628 | End_Object |
||
629 | |||
630 | End_Object |
||
631 | |||
632 | Object oHelpMenu is a cCJMenuItem |
||
633 | 22 | wil | Set peControlType to xtpControlPopup |
634 | 2 | wil | Set psCaption to "&Help" |
635 | Set psDescription to "Access Information for learning and using this DataFlex application." |
||
636 | Set psToolTip to "Help" |
||
637 | |||
638 | 22 | wil | Object oHelpMenuItem is a cCJHelpMenuItem |
639 | 2 | wil | End_Object |
640 | |||
641 | Object oAboutMenuItem is a cCJAboutMenuItem |
||
642 | End_Object |
||
643 | |||
644 | End_Object |
||
645 | |||
646 | End_Object |
||
647 | |||
648 | 7 | wil | Object oDebugToolBar is a cCJToolbar |
649 | 72 | wil | Set psTitle To "Debugging Toolbar" |
650 | |||
651 | Object oOpenProgramButton Is a cCJOpenProgramMenuItem |
||
652 | End_Object |
||
653 | 2 | wil | |
654 | 7 | wil | Object oStartDebugButton is a cCJStartDebugMenuItem |
655 | 2 | wil | End_Object |
656 | |||
657 | 7 | wil | Object oStopDebugButton is a cCJStopDebugMenuItem |
658 | 2 | wil | End_Object |
659 | |||
660 | 60 | wil | Object oRestartDebugButton is a cCJRestartDebugMenuItem |
661 | End_Object |
||
662 | |||
663 | 2 | wil | Object oDebugPauseButton is a cCJDebugPauseMenuItem |
664 | End_Object |
||
665 | |||
666 | 7 | wil | Object oDebugContinueButton is a cCJDebugContinueMenuItem |
667 | End_Object |
||
668 | |||
669 | 2 | wil | Object oDebugStepOverButton is a cCJStepOverMenuItem |
670 | End_Object |
||
671 | |||
672 | 7 | wil | Object oDebugStepIntoButton is a cCJStepIntoMenuItem |
673 | 2 | wil | End_Object |
674 | 7 | wil | |
675 | Object oDebugStepOutButton is a cCJStepOutMenuItem |
||
676 | End_Object |
||
677 | |||
678 | 2 | wil | |
679 | End_Object |
||
680 | 27 | wil | |
681 | 24 | wil | Object oFileToolbar is a cCJToolbar |
682 | Set psTitle To "Open Source Toolbar" |
||
683 | Object oFileOpen is a cCJOpenFileMenuItem |
||
684 | End_Object |
||
685 | End_Object |
||
686 | 2 | wil | |
687 | 21 | wil | Object oBreakPointToolBar is a cCJToolbar |
688 | Set psTitle to "Breakpoint Toolbar" |
||
689 | |||
690 | Object oAddBreakpointButton is a cCJAddBreakpointMenuItem |
||
691 | End_Object |
||
692 | |||
693 | Object oRemoveBreakpointButton is a cCJRemoveBreakpointMenuItem |
||
694 | End_Object |
||
695 | End_Object |
||
696 | |||
697 | 2 | wil | Object oEditToolBar is a cCJToolbar |
698 | Set psTitle to "Edit Toolbar" |
||
699 | |||
700 | Object oCutToolbarItem is a cCJCutMenuItem |
||
701 | End_Object |
||
702 | |||
703 | Object oCopyToolbarItem is a cCJCopyMenuItem |
||
704 | End_Object |
||
705 | |||
706 | Object oPasteToolbarItem is a cCJPasteMenuItem |
||
707 | End_Object |
||
708 | |||
709 | Object oDeleteEditToolbarItem is a cCJDeleteEditMenuItem |
||
710 | Set pbControlBeginGroup to True |
||
711 | End_Object |
||
712 | |||
713 | End_Object |
||
714 | |||
715 | Object oStatusBar is a cCJStatusBar |
||
716 | |||
717 | Object oStatusPane1 is a cCJStatusBarPane |
||
718 | Set piID to sbpIDIdlePane |
||
719 | Set pbStyleStretch to True |
||
720 | 24 | wil | Set psText To "" |
721 | 2 | wil | End_Object |
722 | |||
723 | Object oStatusPane2 is a cCJStatusBarPane |
||
724 | Set phoViewPane to Self |
||
725 | Set pbStyleStretch to True |
||
726 | 24 | wil | Set psText To "" |
727 | 2 | wil | End_Object |
728 | 7 | wil | |
729 | Object oStatusPane3 is a cCJStatusBarPane |
||
730 | Set pbStyleStretch to True |
||
731 | Set psText To "testing 888" |
||
732 | End_Object |
||
733 | 27 | wil | |
734 | 38 | wil | Function EditorHandle Returns Handle |
735 | Handle hoEditor |
||
736 | Boolean bIsCreated |
||
737 | |||
738 | Get phoEditor To hoEditor |
||
739 | If (hoEditor) Begin |
||
740 | Get IsComObjectCreated Of hoEditor To bIsCreated |
||
741 | If (bIsCreated=false) Begin |
||
742 | Move 0 To hoEditor |
||
743 | End |
||
744 | End |
||
745 | Function_Return hoEditor |
||
746 | End_Function |
||
747 | |||
748 | 24 | wil | Function EditorCurrentLine Returns Integer |
749 | Handle hoEditor |
||
750 | Integer iCount |
||
751 | |||
752 | 38 | wil | Get EditorHandle To hoEditor |
753 | 24 | wil | If (hoEditor) Begin |
754 | Get CurrentLine Of hoEditor To iCount |
||
755 | End |
||
756 | Function_Return iCount |
||
757 | End_Function // EditorCurrentLine |
||
758 | 4 | wil | |
759 | Function EditorLineCount Returns Integer |
||
760 | Handle hoEditor |
||
761 | Integer iCount |
||
762 | |||
763 | 38 | wil | Get EditorHandle To hoEditor |
764 | 4 | wil | If (hoEditor) Begin |
765 | Get ComLineCount Of hoEditor To iCount |
||
766 | End |
||
767 | Function_Return iCount |
||
768 | 22 | wil | End_Function // EditorLineCount |
769 | 24 | wil | |
770 | Procedure Show_Status_Help String sStatusHelp |
||
771 | Integer iLine |
||
772 | 38 | wil | Handle hoEditor |
773 | String sFileName |
||
774 | 24 | wil | |
775 | 38 | wil | Move "" To sFileName |
776 | Get EditorHandle To hoEditor |
||
777 | If (hoEditor) Begin |
||
778 | Get psFileName of hoEditor To sFileName |
||
779 | End |
||
780 | 24 | wil | Get EditorCurrentLine To iLine |
781 | Set psText Of oStatusPane1 To ("Line: "+trim(iLine)) |
||
782 | 38 | wil | Set psText Of oStatusPane2 To ("File: "+sFileName) |
783 | 24 | wil | End_Procedure |
784 | 2 | wil | |
785 | End_Object |
||
786 | |||
787 | End_Object |
||
788 | |||
789 | Object oClientArea is a ClientArea |
||
790 | Use StdAbout.pkg |
||
791 | 40 | wil | Use ObjectInspector.dg |
792 | 7 | wil | Use Vdfdbg.vw |
793 | 2 | wil | |
794 | 24 | wil | Procedure doActivateObjectInspectorPanel |
795 | 53 | wil | Send StartObjectInspector |
796 | 24 | wil | End_Procedure |
797 | |||
798 | 37 | wil | |
799 | |||
800 | 2 | wil | Procedure Activate_About |
801 | 37 | wil | String sTitle sCopyright sVersion sBitmap sAuthor |
802 | |||
803 | // string sVal sVal2 sVal3 |
||
804 | // move (SysConf(sysconf_os_name)) to sVal |
||
805 | // send Info_box sVal "Os Name" |
||
806 | // move (SysConf(sysconf_os_short_name)) to sVal2 |
||
807 | // send Info_box sVal2 "os short name" |
||
808 | // move (SysConf(sysconf_os_major_rev)) to sVal3 |
||
809 | // send Info_Box sVal3 "os major revision" |
||
810 | // // |
||
811 | Move "VdfSplat" to sTitle |
||
812 | Move "Alfa 1" to sVersion |
||
813 | Move "Copyright 2015, GPL v2, Antwise Solutions" to sCopyright |
||
814 | Move "Author: Wil van Antwerpen" to sAuthor |
||
815 | Move "Debugger.bmp/t" to sBitMap |
||
816 | Send DoAbout sTitle sVersion sCopyright sAuthor sBitMap |
||
817 | 2 | wil | End_Procedure |
818 | |||
819 | End_Object |
||
820 | |||
821 | End_Object |
||
822 | |||
823 | 35 | wil | |
824 | Procedure StartDebugging |
||
825 | String sApplication |
||
826 | Handle hoClient |
||
827 | |||
828 | Get Client_Id Of oMain To hoClient |
||
829 | If (hoClient) Begin |
||
830 | Send Activate_oVdfdbg of hoClient |
||
831 | Get psApplication of ghoApplication to sApplication |
||
832 | If (sApplication<>"") Begin |
||
833 | Send doDebugRun of hoClient |
||
834 | End |
||
835 | End |
||
836 | End_Procedure |
||
837 | |||
838 | Send StartDebugging |
||
839 | 2 | wil | Start_UI |