Theme:
v
APL+Win Training Pack 4

How to write Dialog Boxes & An APL+Win Spy

Download APL+Win Training Pack 4 (642 K)

The APL+Win Training Pack SETUP4.ZIP file includes:

  • an 83 pages WinWord document full of APL+Win hints and techniques
  • a SPY.W3 workspace (an APL+Win spy application + utilities)
  • a SPYMIN.W3 workspace with the 4 basic functions to spy any form
  • a TEMPLATE.W3 workspace with a GuiTemplate dialog box model function

Microsoft Visual C++® includes a Spy++® application which helps C++ developers spy any GUI object and find about events and messages occuring on this window. Moreover, with Spy++ you can select the events and Windows messages you want to spy through a complete message selection form.

Our SPY.W3 workspace contains a reusable APL+Win Spy application which allows you to perform similar spying on APL+Win objects as Spy++ does on C++ forms and objects.

By reading the DISK4.DOC WinWord training document you will learn how to use low level Windows API calls to subclass any of your APL+Win forms in order to enhance their system menu with the following new options:

Selecting Events in this new system menu will help you select any of your form and form children objects as well as any events you want to spy on these objects, through the use of the following dynamic form:

Then, when selecting the new system menu Spy option, you will immediately start spying your form: messages will start flooding over your APL session as they really occur in your application and in the exact order they really occur. This APL+Win Spy will serve you as a very valuable help in writing APL+Win applications as well as a good APL+Win form's debugger. Here is a sample APL session spy output:

Exit on fmEvents.fEv.ck27 (⎕warg=fmEvents.fEv.ck29)
Unfocus on fmEvents.fEv.ck27
Focus on fmEvents.fEv.ck29
Paint on fmEvents.fEv.ck27
MouseUp on fmEvents.fEv.ck29 (⎕warg=0.375 0.75 1 0 0)
Click on fmEvents.fEv.ck29
MouseMove on fmEvents.fEv.ck29 (⎕warg=0.375 0.75 0 0 0)
MouseMove on fmEvents.fEv.ck29 (⎕warg=0.375 2.5 0 0 0)
MouseMove on fmEvents.fEv.ck29 (⎕warg=0.1875 9.875 0 0 0)
MouseMove on fmEvents.fEv.ck48 (⎕warg=0.125 2.375 0 0 0)
MouseMove on fmEvents.fEv.ck47 (⎕warg=0.6875 9.75 0 0 0)
MouseMove on fmEvents.fEv.ck66 (⎕warg=0.4375 4.625 0 0 0)
MouseMove on fmEvents (⎕warg=145 500 0 0 0)
MouseMove on fmEvents.lsClass (⎕warg=0.75 7.75 0 0 0)
MouseMove on fmEvents (⎕warg=145 619 0 0 0)
MouseMove on fmEvents.ckSync (⎕warg=0.6875 12 0 0 0)
MouseMove on fmEvents.ckSync (⎕warg=0.6875 10.625 0 0 0)
MouseMove on fmEvents (⎕warg=124 512 0 0 0)
MouseMove on fmEvents.ckSync (⎕warg=0.6875 0.375 0 0 0)
MouseDown on fmEvents.ckSync (⎕warg=0.625 1 1 1 0)
Exit on fmEvents.fEv.ck29 (⎕warg=fmEvents.ckSync)
Unfocus on fmEvents.fEv.ck29
Focus on fmEvents.ckSync
MouseUp on fmEvents.ckSync (⎕warg=0.625 1 1 0 0)
Click on fmEvents.ckSync
MouseMove on fmEvents.ckSync (⎕warg=0.625 1 0 0 0)
Paint on fmEvents.fEv.ck29
MouseMove on fmEvents.ckSync (⎕warg=0.5625 1.5 0 0 0)
MouseMove on fmEvents.ckSync (⎕warg=0.125 2.375 0 0 0)
MouseMove on fmEvents.bnNone (⎕warg=1.0625 3.25 0 0 0)
MouseMove on fmEvents.bnNone (⎕warg=0.4375 3.375 0 0 0)
MouseMove on fmEvents (⎕warg=82 546 0 0 0)
MouseMove on fmEvents.bnAll (⎕warg=0.8125 4 0 0 0)
MouseMove on fmEvents (⎕warg=56 550 0 0 0)
MouseMove on fmEvents.bnCancel (⎕warg=0.5625 5.75 0 0 0)
MouseMove on fmEvents (⎕warg=31 572 0 0 0)
MouseMove on fmEvents.bnOK (⎕warg=1.1875 7.5 0 0 0)
MouseMove on fmEvents.bnOK (⎕warg=0.625 7.625 0 0 0)
MouseDown on fmEvents.bnOK (⎕warg=0.625 7.625 1 1 0)
Exit on fmEvents.ckSync (⎕warg=fmEvents.bnOK)
Unfocus on fmEvents.ckSync
Focus on fmEvents.bnOK
MouseUp on fmEvents.bnOK (⎕warg=0.625 7.625 1 0 0)
Click on fmEvents.bnOK
Close on fmEvents
Unfocus on fmEvents
Unfocus on fmEvents.bnOK
Hide on fmEvents
Destroy on fmEvents

The SETUP4.ZIP file also contains the following useful APL+Win training information and reusable software:

  • eplanations about how to write APL+Win dialog boxes
    • how to pass data from APL to the dialog
    • how to return data from the dialog to APL
    • how to implement style-sheets techniques for consistency
    • how to encapsulate callbacks
    • how to write Resize handlers
  • a reusable GuiTemplate function to serve as a start point for developing any APL+Win form
  • reusable Events, Properties and Methods functions to return classes events, properties and method names
  • a reusable SystemMenu function to enhance any APL+Win form's system menu
  • how to write APL+Win User Commands with parameters and options
  • how to write a Spy application in APL+Win
  • how to use several low level Windows API calls (AppendMenu, GetSystemMenu, CheckMenuItem ...)
  • how to write APL+Win filters and how to handle low level Windows messages
  • how to write dynamic forms
  • how to best use events in an APL+Win applications