Revision 72
updated icons to new
Added open program option to toolbar (makes a bit more sense)
Display breakpoints on loading source file
AppSrc/VdfSplat.src | ||
---|---|---|
201 | 201 |
Function_Return bExists |
202 | 202 |
End_Function |
203 | 203 |
|
204 |
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 |
|
|
204 | 220 |
Procedure doDebugRun |
205 |
String sApplication |
|
206 |
Boolean bOpen |
|
207 | 221 |
Boolean bExists |
208 | 222 |
Boolean bRestartMode |
209 | 223 |
Handle hoDebug |
210 | 224 |
Handle hoParent |
211 |
Handle hoDialog
|
|
225 |
String sApplication
|
|
212 | 226 |
|
213 | 227 |
Get psApplication of ghoApplication To sApplication |
214 | 228 |
If (sApplication = "") Begin |
215 |
Move (oOpenProgramDialog(Self)) To hoDialog |
|
216 |
|
|
217 |
Get Show_Dialog of hoDialog to bOpen |
|
218 |
If bOpen Begin |
|
219 |
Get File_Name of hoDialog To sApplication |
|
220 |
// Don't tell me when I selected a file, just do it. |
|
221 |
//Send Info_Box ("Selected file " + sApplication) |
|
222 |
End |
|
223 |
Else Send Info_Box "You did not choose a file, nothing to debug." |
|
224 |
|
|
229 |
Send doOpenProgram |
|
230 |
Get psApplication of ghoApplication To sApplication |
|
225 | 231 |
End |
226 | 232 |
If (sApplication="") Begin |
227 |
// Oh still no app? Use our hardcoded path
|
|
233 |
// Oh still no app? Nothing to debug then
|
|
228 | 234 |
Procedure_Return |
229 | 235 |
End |
230 | 236 |
Get ParseApplicationDebugFile sApplication To bExists |
... | ... | |
233 | 239 |
If (hoDebug) Begin |
234 | 240 |
Get pbDebugRestart of hoDebug to bRestartMode |
235 | 241 |
If (bRestartMode) Begin |
242 |
If (IsComObjectCreated(hoDebug)) Begin |
|
243 |
Send ReleaseComObject of hoDebug |
|
244 |
End |
|
236 | 245 |
Send Destroy of hoDebug |
237 | 246 |
Move 0 To hoDebug |
238 | 247 |
End |
... | ... | |
251 | 260 |
Set psApplication of ghoApplication To sApplication |
252 | 261 |
Set ApplicationFileName of hoDebug To sApplication |
253 | 262 |
// ?? |
254 |
Send DoSetCaptionLabel Of (oVdfDbg(oClientArea(Self))) sApplication |
|
255 | 263 |
Send DoStartDebug |
256 | 264 |
End |
257 | 265 |
End_Procedure // doDebugRun |
... | ... | |
493 | 501 |
Set psCaption to "&File" |
494 | 502 |
Set psDescription to "Find, Save, Delete, Clear information or quit this application." |
495 | 503 |
Set psCategory to "Menus" |
496 |
|
|
497 |
Object oClearMenuItem is a cCJClearMenuItem
|
|
504 |
|
|
505 |
Object oOpenProgramButton Is a cCJOpenProgramMenuItem
|
|
498 | 506 |
Set pbAddToDesignerMenu to True |
499 | 507 |
End_Object |
500 | 508 |
|
501 |
Object oClearAllMenu is a cCJClearAllMenuItem |
|
502 |
Set pbAddToDesignerMenu to True |
|
503 |
End_Object |
|
504 |
|
|
505 |
Object oPromptMenuItem is a cCJPromptMenuItem |
|
506 |
Set pbAddToDesignerMenu to True |
|
507 |
Set pbControlBeginGroup to True |
|
508 |
End_Object |
|
509 |
|
|
510 | 509 |
Object oCJDebugPauseMenuItem is a cCJDebugPauseMenuItem |
511 | 510 |
Set pbAddToDesignerMenu to True |
512 | 511 |
Set pbControlBeginGroup to True |
513 | 512 |
End_Object |
514 | 513 |
|
515 |
Object oFindNextMenu is a cCJFindNextMenuItem |
|
516 |
Set pbAddToDesignerMenu to True |
|
517 |
End_Object |
|
518 | 514 |
|
519 |
Object oFindPreviousMenu is a cCJFindPreviousMenuItem |
|
520 |
Set pbAddToDesignerMenu to True |
|
521 |
End_Object |
|
522 |
|
|
523 |
Object oFindFirstMenu is a cCJFindFirstMenuItem |
|
524 |
Set pbAddToDesignerMenu to True |
|
525 |
End_Object |
|
526 |
|
|
527 |
Object oFindLastMenu is a cCJFindLastMenuItem |
|
528 |
Set pbAddToDesignerMenu to True |
|
529 |
End_Object |
|
530 |
|
|
531 |
Object oSaveMenuItem is a cCJSaveMenuItem |
|
532 |
Set pbAddToDesignerMenu to True |
|
533 |
Set pbControlBeginGroup to True |
|
534 |
End_Object |
|
535 |
|
|
536 |
Object oDeleteMenuItem is a cCJDeleteMenuItem |
|
537 |
Set pbAddToDesignerMenu to True |
|
538 |
End_Object |
|
539 |
|
|
540 | 515 |
Object oExitMenu is a cCJExitMenuItem |
541 | 516 |
Set pbControlBeginGroup to True |
542 | 517 |
End_Object |
... | ... | |
671 | 646 |
End_Object |
672 | 647 |
|
673 | 648 |
Object oDebugToolBar is a cCJToolbar |
674 |
Set psTitle to "Debugging Toolbar" |
|
649 |
Set psTitle To "Debugging Toolbar" |
|
650 |
|
|
651 |
Object oOpenProgramButton Is a cCJOpenProgramMenuItem |
|
652 |
End_Object |
|
675 | 653 |
|
676 |
|
|
677 | 654 |
Object oStartDebugButton is a cCJStartDebugMenuItem |
678 | 655 |
End_Object |
679 | 656 |
|
AppSrc/cDebugCJMenuItemClasses.pkg | ||
---|---|---|
414 | 414 |
{ OverrideProperty=psCaption InitialValue=CS_CaptionAddBreakpoint} |
415 | 415 |
{ OverrideProperty=psToolTip InitialValue=CS_ToolTipAddBreakpoint} |
416 | 416 |
{ OverrideProperty=psDescription InitialValue=CS_DescAddBreakpoint } |
417 |
{ OverrideProperty=psImage InitialValue="brkp_obj.ico" } |
|
417 |
{ OverrideProperty=psImage InitialValue="brkp_obj_red.ico" }
|
|
418 | 418 |
Class cCJAddBreakpointMenuItem is a cCJDebugMenuItem |
419 | 419 |
|
420 | 420 |
Procedure Construct_Object |
... | ... | |
422 | 422 |
Set psCaption To CS_CaptionAddBreakpoint |
423 | 423 |
Set psToolTip To CS_ToolTipAddBreakpoint |
424 | 424 |
Set psDescription To CS_DescAddBreakpoint |
425 |
Set psImage To "brkp_obj.ico" |
|
425 |
Set psImage To "brkp_obj_red.ico"
|
|
426 | 426 |
//Set psImageDisabled To "brkpd_obj.ico" |
427 | 427 |
Set piShortcutKey To xtpKey_None VK_F9 |
428 | 428 |
End_Procedure |
... | ... | |
540 | 540 |
End_Function |
541 | 541 |
|
542 | 542 |
End_Class // cCJOpenFileMenuItem |
543 |
|
|
544 |
|
|
545 |
Define CS_CaptionOpenProgram For "Open Program" |
|
546 |
Define CS_TooltipOpenProgram For "Open executable file" |
|
547 |
Define CS_DescOpenProgram For "Open executable file" |
|
548 |
|
|
549 |
{ OverrideProperty=psCaption InitialValue=CS_CaptionOpenProgram} |
|
550 |
{ OverrideProperty=psToolTip InitialValue=CS_ToolTipOpenProgram} |
|
551 |
{ OverrideProperty=psDescription InitialValue=CS_DescOpenProgram } |
|
552 |
{ OverrideProperty=psImage InitialValue="workset.ico" } |
|
553 |
Class cCJOpenProgramMenuItem is a cCJDebugMenuItem |
|
554 |
|
|
555 |
Procedure Construct_Object |
|
556 |
Forward Send Construct_Object |
|
557 |
Set psCaption To CS_CaptionOpenProgram |
|
558 |
Set psToolTip To CS_ToolTipOpenProgram |
|
559 |
Set psDescription To CS_DescOpenProgram |
|
560 |
Set psImage To "workset.ico" |
|
561 |
End_Procedure |
|
562 |
|
|
563 |
Procedure OnExecute Variant vCommandBarControl |
|
564 |
Send doOpenProgram |
|
565 |
End_Procedure |
|
566 |
|
|
567 |
Function IsEnabled Returns Boolean |
|
568 |
Boolean bStarted |
|
569 |
Get HasProgramStarted To bStarted |
|
570 |
Function_Return (bStarted=false) |
|
571 |
End_Function |
|
572 |
|
|
573 |
End_Class |
AppSrc/cDebuggerEngine.pkg | ||
---|---|---|
495 | 495 |
Function_Return iPos |
496 | 496 |
End_Function |
497 | 497 |
|
498 |
|
|
499 |
// |
|
500 |
// Checks the breakpoint array to see if it has any breakpoints |
|
501 |
// for the filename passed and returns them as line numbers if they |
|
502 |
// do. |
|
503 |
// |
|
504 |
Function ListBreakPointsForFile String sFile Returns UInteger[] |
|
505 |
Integer iPos |
|
506 |
Integer iBreak |
|
507 |
Integer iCount |
|
508 |
UInteger iLine |
|
509 |
UInteger[] Lines |
|
510 |
tBreakPoints[] BP |
|
511 |
|
|
512 |
Move -1 To iPos |
|
513 |
Move (ResizeArray(Lines,0)) To Lines |
|
514 |
Get pBreakPoints To BP |
|
515 |
Move (Lowercase(sFile)) To sFile |
|
516 |
Move (SizeOfArray(BP)) To iCount |
|
517 |
For iBreak from 0 To (iCount-1) |
|
518 |
If (lowercase(BP[iBreak].sFileName)=sFile and BP[iBreak].bEnabled=True) Begin |
|
519 |
Move BP[iBreak].iLine to Lines[SizeOfArray(Lines)] |
|
520 |
End |
|
521 |
Loop |
|
522 |
Function_Return Lines |
|
523 |
End_Function |
|
498 | 524 |
|
499 | 525 |
Procedure AddBreakPointToArray String sFile UInteger iLine |
500 | 526 |
Integer iCount |
AppSrc/cSplatCodeMax.pkg | ||
---|---|---|
29 | 29 |
Define CS_TAB for (Character(9)) |
30 | 30 |
|
31 | 31 |
|
32 |
Define ICO_Brkp_obj for $CI01 // breakpoint object icon
|
|
32 |
Define ICO_Inst_ptr_top for $CI01 // instruction pointer top icon
|
|
33 | 33 |
Define ICO_Inst_ptr for $CI02 // instruction pointer icon |
34 |
Define ICO_Inst_ptr_top for $CI04 // instruction pointer top icon
|
|
34 |
Define ICO_Brkp_obj for $CI04 // breakpoint object icon
|
|
35 | 35 |
|
36 | 36 |
Class cCodeMaxImageList is a cImageList32 |
37 | 37 |
|
... | ... | |
47 | 47 |
Integer iVoid |
48 | 48 |
|
49 | 49 |
Get AddImage "brkp_obj.ico" To iVoid // bit 1 // seems the first image is ignored as a margin image |
50 |
Get AddImage "inst_ptr_top.ico" To iVoid // bit 2 |
|
51 |
Get AddImage "brkp_obj.ico" To iVoid // bit 3
|
|
50 |
Get AddImage "inst_ptr_top_green.ico" To iVoid // bit 2
|
|
51 |
Get AddImage "brkp_obj_red.ico" To iVoid // bit 3
|
|
52 | 52 |
Get AddImage "inst_ptr.ico" To iVoid // bit 4 |
53 | 53 |
End_Procedure |
54 | 54 |
End_Class |
... | ... | |
545 | 545 |
Forward Send OnComSelChange |
546 | 546 |
End_Procedure |
547 | 547 |
|
548 |
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 |
|
548 | 559 |
|
549 | 560 |
|
550 | 561 |
Procedure doOpenSourceFile String sFileName |
551 |
String sLanguage |
|
562 |
Handle hoDebugger |
|
563 |
String sLanguage |
|
564 |
UInteger[] BreakPoints |
|
552 | 565 |
Variant vLanguage |
553 | 566 |
|
554 | 567 |
Send ComOpenFile sFileName |
... | ... | |
558 | 571 |
Set ComReadOnly To True // NO changes allowed |
559 | 572 |
Set ComColorSyntax To True |
560 | 573 |
|
574 |
Get phoDebugger To hoDebugger |
|
575 |
If (hoDebugger) Begin |
|
576 |
Get ListBreakPointsForFile Of hoDebugger sFileName To BreakPoints |
|
577 |
Send DisplayBreakPoints BreakPoints |
|
578 |
End |
|
579 |
|
|
561 | 580 |
// Update view hosting our control |
562 | 581 |
//Send doSetCaptionLabel sFileName |
563 | 582 |
End_Procedure // doOpenSourceFile |
... | ... | |
568 | 587 |
Boolean bVisible |
569 | 588 |
Boolean bScrollup |
570 | 589 |
|
571 |
Move false to bScrollup |
|
572 |
Send doOpenSourceFile sFileName |
|
590 |
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 |
|
573 | 595 |
Set piCurrentLine to iLine |
574 | 596 |
Move iLine to iTopMostLine |
575 | 597 |
If (iLine>5) Begin |
Also available in: Unified diff