MacroPackage: cgToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version

defcomponent

Arguments: class-name superclass-names slot-specifiers &rest class-options

7.0 release note: the option called :editor-mode in earlier releases is now called :editor-type.

Defines a class that has properties, so as to effectively combine a defclass expression with an associated defproperties expression. defcomponent is similar to defclass, except that a :properties option may be specified as follows:

(defcomponent thing
  ((color ...)
   (size ...))
  (:default-initargs
   :color red
   :size 4)
  (:documentation "A silly class")
  (:properties
   (color
    :help-string "Color of the thing."
    :type rgb-or-nil
    :editor-type :color)
   (size
    :help-string "How big the thing is."
    :type positive-integer)
   ))

More examples are on the defproperties page.

The format of the properties option is similar to defproperties except that the symbol define-property is not needed at the beginning of the list for each property.

A property may define any of the following property facets, listed here with the initarg that is used to specify each:

Properties of CLOS classes inherit similarly to slots. Only those facets that differ from the inherited property need be specified for a given class, and properties that have no differing facets need not be specified at all.

Properties are shown on a separate tab of the inspector, and thus can serve as a relatively high-level interface to the object by providing a selected subset of the object's internal attributes, where each property knows to either disallow modification or to cause appropriate side effects upon modification in order to maintain a consistent environment.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 9.0 page.
Created 2015.5.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version