User's Guide


Adding a custom edit part

You can fine-tune how the shape part works in the Composition Editor by creating your own edit part. An edit part is a special class that is used by the Composition Editor to control the part's pop-up menu and other special behavior during editing.

Begin by creating a new class:

  1. On the VisualAge Organizer select MyEditSamplePartsApp.
  2. From the Parts menu, select New > Part.
  3. Enter MyShapeEditPart for the part class.
  4. From the Part type list, select Nonvisual part.
  5. Enter AbtCompositeEditPart in the Inherits from field.

The class definition should look like the following:

AbtCompositeEditPart subclass: #MyShapeEditPart
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''

Create a link between the shape part and the edit part by implementing the editPartClass class method in MyShape. Move this method to MyEditSamplePartsApp.

editPartClass
  "Answer my edit part's class name."
  ^MyShapeEditPart


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]