In the reactor callback, a hard-coded string "ActiveX" is passed to gp:Calculate-and-Draw-Tiles as the ObjectCreationStyle argument. But what about the other times gp:Calculate-and-Draw-Tiles is invoked?
If you remember back to Lesson 4, it was pointed out that whenever you change a stubbed-out function, you need to ask the following questions:
The same questions need to be asked any time you make a significant change to a working function as you build, refine, and update your applications. In this case, you need to find any other functions in your project that invoke gp:Calculate-and-Draw-Tiles. Visual LISP has a feature that helps you do this.
Because you preselected the function name, it is already listed as the string to search for.
When you select this option, the Find dialog box expands at the bottom, and you can select the project to be searched.
Visual LISP displays the results in the Find output window:
Visual LISP activates a text editor window and takes you right to that line of code in gpmain.lsp. The code currently appears as follows:
(setq tilelist (gp:Calculate-and-Draw-Tiles gp_PathData))
(setq tilelist (gp:Calculate-and-Draw-Tiles gp_PathData nil))
Why nil? Take another look at the pseudo-code:
If ObjectCreationStyle is nil, assign it from the BoundaryData.
Passing nil as a parameter to gp:Calculate-and-Draw-Tiles causes that function to check the user's choice of how to draw the tiles (as determined by the dialog box selection and stored in gp_PathData). Subsequent calls from the command-ended reactor callback, however, will override this behavior by forcing the use of ActiveX.
Congratulations! You now have the basic reactor functionality in place. If you prefer, copy the gpmain.lsp and gpdraw.lsp files from the Tutorial\VisualLISP\Lesson7 into your working directory and examine the completed, debugged code.
There is still a lot of work to be done, and it is all triggered from this fragment of code in the gp:Command-ended function:
(setq NewReactorData (gp:RedefinePolyBorder CurrentPoints reactorData) ) ;_ end of setq