Will a graphical app work?
Hints on using a graphical interface.
──────────────────────────────────────────────────────────────────────────────

MrDebug has the ability to work within a graphical interface. Should you be
using any third party libraries that offer a graphical interface the
following guidelines may help you to enable MrDebug to work within a
graphical interface.

Turn off the following:

Retain Video Mode
Force Application into 80x25

If at some point, the graphical interface of MrDebug becomes garbled and you
find that <Shift><Alt><R> does not redraw the screen correctly, then you may
find that the using <TAB> key to cycle through the window may help to
refresh the screen.

We have done our best to get MrDebug working with graphical interfaces, but
the direct screen writes can cause some refresh problems with MrDebug - they
are beyond our control.

The following has helped us to Debug programs that we have written that use
DGE. So of you might find the ideas useful for your graphical applications
that you wish to debug.

Create the following three functions within one of your .PRGs


Function RestGraf() // used by 'Before Step'
If nVideoMode == 18
SetHiRes(0)
EndIf
Return(NIL)


Function SaveGraph() // used by 'After Step'
nVideoMode := GetVideo(1)
If nVideoMode == 18
PicWrite(0,0,1350,1000,1,"F:\temp.pic")
EndIf
SetText()
Return(NIL)


Function DispGraph() // used by 'Step Restore'
If nVideoMode == 18 .AND. File("F:\temp.pic")
PicRead(0,0, 1, "F:\temp.pic")
EndIf
Return (NIL)


Create a Static or Public variable called nVideoMode and assign it the value
of the IBM BIOS video mode that you use as text mode. Normally this will be
3 as we would recommend that you run all graphical applications in an 80x25
mode. Make sure that the variable will be in scope to the three functions
when they are called.

Under the Display sub-menu of the Options menu enter the function names that
MrDebug should call when your stop or start the application. For example in
the case of our three functions, above,:

Before Step 'RestGraf()'
After Step 'SaveGraph()'
Step Restore 'DispGraph()'

When you run your application, and MrDebug is invoked, the function held in
After Step is called - in this case, the screen is saved to a graphics file
(a RAM disk comes in handy here!) and the mode is set to text.

When you next Step, run etc the program, the Before Step function is called
and the video mode gets set. The Step Restore function is then called and
the graphics image gets restored.

And that is the basics of the Step Before, After and Restore slots!