home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / pk4pak.zip / EDEMO.DOC < prev    next >
Text File  |  1992-12-28  |  8KB  |  85 lines

  1. EVENT DEMO
  2.  
  3. A little program to explore Paradox 4.0's event model, and to get some ideas on how to use EventMan, the generic event manager in EVENTMAN.SC. By Henrik Bechmann of Elect Software International Inc.
  4.  
  5. =============================================================================
  6.                            EVENT DEMO DESCRIPTION
  7. =============================================================================
  8.  
  9. The event demo is a very rich environment for testing out operations under different circumstances to see how Paradox's event model works. It uses EventMan (in EVENTMAN.SC), Tracer (in TRACER.SC), and WalkingMan (in WALKING.SC). Incidentally EventMan.sc is actually a powerful and flexible generic event manager that you can use in your applications, and Walking.sc can be played on its own, independent of the event demo. Here are some notes to get you started with using the event demo.
  10.  
  11. This event demo is an exploration tool, to give you a feel for how the Paradox 4.0 interface operates. It is NOT a polished application. Go ahead and bash away at it. In particular, check out the difference of operating under GetEvent as opposed to Wait Workspace. Note that the mouse event names are composite names generated by the event manager.
  12.  
  13. Getting Started:
  14. ----------------
  15.  
  16. When you first play the event edemo (Play EDEMO.SC from its own directory) select {Wait Workspace} from the mode menu that you see. Now hit [CtrlF4] a few times to see the action of the tracer window. The numbers to the left are event numbers, beginning with 1 when the event demo session is started. The next number is EventMan.TargetWindow, as determined by EventMan. Then there is EventMan.EventTag (the name of the event), as set by EventMan, and finally EventMan.CycleNumber as passed to the WAIT eventProc.
  17.  
  18. Next mouse around a bit with the left mouse button, and watch the effect on the Tracer window.
  19.  
  20. Now hit the right mouse button anywhere *except* the Tracer window. You'll see the Event Demo Menu (a ShowPopup menu). Cancel the menu (by cliking anywher outside the menu) and hit the right mouse button *on* the tracer window. Note that you get different menus (this gives you the ability to build "property inspection", or context specific menus, as popularized by Borland, into your applications.)
  21.  
  22. Note that if you left click on the middle window (which says "click & drag here...") you get a rectangle that chases the mouse around as long as you keep the left mouse button depressed, and then changes to red and beeps when you release. This demonstrates mouse modality.
  23.  
  24. Now select {Walking} from the menu bar. Wait a second, and you'll see a walking man crossing the screen. He goes around and around. Mouse around behind him, and hit [CtrlF4] a few times. Watch the tracer window, and satisfy yourself that you're seeing asynchronous behavior on the part of the walking man. Now select the walking man's window (you'll have to be quick!). Click and hold the left mouse button down on the top line of the frame and move the walking man down a bit. After you release, he'll keep walking at the new level. (Note that if you move the frame to the top row, and later try to move the frame with the mouse from the top row to a lower row, it doesn't "take". That's a Paradox bug. Mouse DOWN events are not reported for floating windows on row 0 in the presence of a ShowPullDown.) While the window is selected hit [CtrlF5]-Resize and use the arrow keys to move the window around. Note that the new elevation of the Walking Man becomes permanent.
  25.  
  26. Next, with the mouse, select a window on the desktop that does *not* have a double line around it. Note that the desktop window that has the double line around it is selected, not the window under your mouse cursor. This is selection of the desktop as a whole from a floating window, or the "two z-orders" phenomenon. Click again on the window that you clicked on just now, and THIS time it will be selected.
  27.  
  28. Remove the walking man by selecting {Walking} from the menu bar again. (You can also remove him by hitting [CtrlF8] when his window is current, or by hitting his Close icon on the top row -- if you can catch it!).
  29.  
  30. Now select {ClearMenuBar} from the menu bar, and note that the Paradox menu appears. Also note that because we are under a WAIT command, those menu items do not respond to mouse clicks (or F10).
  31.  
  32. Now hit [AltM] (or right click anywhere except the tracer window) and select {Set MenuBar} to restore the menu bar to satisfy yourself that you can restore the menu bar at will.
  33.  
  34. Select {ClearMenuBar} again. Now hit [AltM] to get the demo menu, and select {GetEvent} as the mode. Note that the Paradox menu is now available. This is where people you can get into trouble, because you have the full Paradox menu at your disposal. But don't worry, you can't do any real harm, and it gives you the opportunity, for example, to load your own forms, return to Wait mode, and see how the event model reacts.
  35.  
  36. Try hitting [AltF9] under WAIT, edit a record, and watch TouchRecord and PostRecord events as you edit and move around. Very nice!
  37.  
  38. Hit [F2] to complete edit.
  39.  
  40. As far as the other menu options go, well as you can see this is a *very* rich ennvironment for playing and exploring. You may find that you come back to this demo repeatedly to check things out.
  41.  
  42. You can get a quick overview of the menus at any time by hitting the maximize button of the "Event demo help" window at the bottom right. That text is in Edemo.hlp.
  43.  
  44. Summary of menus:
  45. -----------------
  46.  
  47. Hit [AltM], or right click anywhare other than on the event tracer window to get an event demo menu. When the Menu bar is visible you can also select {DemoMenu) to get the demo menu.
  48.  
  49. Hit [AltT], or right click the event tracer window for a Tracer menu. You can also get the Tracer menu from the {Tracer menu} selection of the Demo menu.
  50.  
  51. These are the menu choices of the Demo Menu:
  52.  
  53. "Wait Workspace" places the desktop under the control of a Wait Workspace command.
  54.  
  55. "Wait Table" places the desktop under the control of a Wait Table command.
  56.  
  57. "Wait Record" places the desktop under the control of a Wait Record command.
  58.  
  59. "Wait Field" places the desktop under the control of a Wait Field command.
  60.  
  61. "GetEvent" places the desktop under the control of a GetEvent loop.
  62.  
  63. "Tracer menu" gives options which let you control the output of the Tracer, or "Load Tracer" lets you load the tracer if you have previously unloaded it.
  64.  
  65. "Show help" loads this help window if it had been previously unloaded.
  66.  
  67. "Set Menubar" restores the ShowPulldown menu on the top line of the screen if you have removed it with the ClearMenubar selection.
  68.  
  69. "Quit demo" removes all windows from the desktop and exits the application.
  70.  
  71. These are the menu choices of the Tracer Menu:
  72.  
  73. "Trace settings" lets you select a combination of TRIGGER, EVENT, MOUSE, KEYCODE, or MESSAGE events to trace in the Event Tracer Window. Each event listed has an Event number, a window number, and the event index (as used by EventMan). In addition you can control whether the tracer output is written to the EVENTS.TXT file.
  74.  
  75. "Show traces" lets you restore the Event Tracer window to the desktop if you've previously closed it.
  76.  
  77. "View EVENTS.TXT" lets you view (and edit) the disk file to which tracer output is (optionally) directed.
  78.  
  79. "Quit tracer" lets you unload the event tracer. You can reload it from the event demo menu.
  80.  
  81. -----------------
  82.  
  83. For some variation, select the System menu from the menu bar (by hitting [AltSpace]) and choose condensed video mode. The mode transition is made internally with the use of PackMan, the array and dynarray packer.
  84.  
  85. Next select the keybar and see what happens when mouse events are coerced into keyboard events.