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?
- Has the function call (invocation) changed? That is, does the function still take the same number of arguments?
- Does the function return something different?
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. VLISP has a feature that helps you do this.
- In the VLISP text editor window, double-click on the word gp:Calculate-and-Draw-Tiles within the gpdraw.lsp file.
Search Find from the VLISP menu.
- Select the Project button listed under Search in the Find dialog box.
- Specify your current project name, then choose the Find button.
- Look at the results in the Find Output window and determine whether there are any other locations in your code where you make a call to gp:Calculate-and-Draw-Tiles. There should only be one: a location within gpmain.lsp.
the Find Output window, double-click on the line of code calling gp:Calculate-and-Draw-Tiles.
(setq tilelist (gp:Calculate-and-Draw-Tiles gp_PathData))
the line of code with the following:
(setq tilelist (gp:Calculate-and-Draw-Tiles gp_PathData nil))
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.
(gp:RedefinePolyBorder CurrentPoints reactorData)
) ;_ end of setq