home *** CD-ROM | disk | FTP | other *** search
/ Peanuts NeXT Software Archives / Peanuts-2.iso / Science / mathematics / workbench / ToolBuildingInstructions < prev    next >
Encoding:
Text File  |  1993-05-31  |  3.6 KB  |  51 lines

  1. Note: Wherever "Tool" appears below, it represents the name of the tool you are building.  For example, if you are building a tool for doing curve fitting, you might call your tool Fit.  Replace "Tool" everywhere below by "Fit".
  2.  
  3.  
  4. 1) Create a new bundle using ProjectBuilder.  Make sure you create a bundle and not an application or palette.  The bundle must have the same name as the tool being built.
  5.  
  6. 2) Use ToolBuilder to automatically create the Tool.(mh), ToolInspector.(mh) classes and TooAndInspectorProtocol.h.  Save these files in the new tool bundle directory.  
  7.  
  8. 3) Using ProjectBuilder, add the files created by ToolBuilder to the project.  If you requested an inspector when ToolBuilder was run, use ProjectBuilder to add the nib file to the project.
  9.  
  10. 4) Add a 36x36 pixel tiff file to the project.  This icon will represent the tool in the application.  The file must have the name Tool.tiff.  The icon must have a transparent background in order to let the button's highlighting show through.
  11.  
  12. 5) Launch InterfaceBuilder by clicking on ToolInspector.nib in ProjectBuilder.  An empty panel will appear.  This panel will represent your tool's inspector.
  13.  
  14. 6) Add to the panel whatever objects (text fields, sliders, etc.) needed by the inspector.
  15.  
  16. 7) In the classes window, subclass object.  The subclass should be Tool.  Parse Tool. Make the file's owner be a Tool object.
  17.  
  18. 8) In the classes window, subclass object.  The subclass should be ToolInspector.  Parse and instantiate a ToolInspector.
  19.  
  20. 9) Make the following hook-ups.
  21. Connect the Tool's inspector outlet to the ToolInspector object.
  22. Connect the ToolInspector's object outlet to the Tool.
  23. Connect the ToolInspector's window outlet to the panel.
  24.  
  25. 10) Add any custom instance variables needed by ToolInspector to ToolInspector.h, and then parse ToolInspector.  Make the necessary connections from the ToolInspector to objects in the inspector's window.
  26.  
  27. 11) If necessary, implement the ok: and revert: methods in ToolInspector.  Hook up any controls in the inspectors window so that they send the ok: message to the ToolInspector.
  28.  
  29. 12) Save the nib file. 
  30.  
  31. 13) Add any needed instance variables to Tool.h.  Add any needed initialization to the init method in Tool.m. (You should initialize variables that will be displayed in Tool's inspector.) Implement any methods (in Tool.m) that will be called from within ToolInspector's ok: and revert: methods. Add the prototypes to Tool.h.  These will be methods to set or retrieve the values of instance variables altered or displayed in the inspector.  Implement the evaluate: method in Tool.m.  
  32.  
  33. 14) If your tool has help information, do step 14.  From the Project submenu in ProjectBuilder, click on "Add Help Directory".
  34. Double-click the Help directory under "Other Resources" and edit the contents as follows.  
  35.     a)  Delete Index.rtfd.  
  36.     b)  Create a new rich text file (or rtfd) named Tool.rtf and put in it a
  37.         description of the tool and any special instructions the user might
  38.         need to use the tool. Store the file in the Help folder in the
  39.         English.lproj subdirectory.
  40.     c)  Delete the contents of TableOfContents.rtf and replace them by two
  41.         tabs, the name of your tool (for example, "FitTool"), and a carriage
  42.         return.  Now put the insertion point at the beginning of the line with
  43.         the name of the tool.  From Edit's menu, choose Format, Help, and then
  44.         Insert Link.  In the panel that appears, press the Set button.  In the
  45.         OpenPanel, choose the file you created in step b).  Now press the OK
  46.         button.
  47.  
  48. 15) Build.
  49.  
  50. 16) Rename the resulting bundle so that it has the extension .wbTool (Do NOT replace the word "Tool" in this extension by the name of your specific tool.)
  51.