home *** CD-ROM | disk | FTP | other *** search
- // ColorInspector.h
- // By Kevin Brain (ksbrain@zeus.UWaterloo.ca)
-
- // ColorInspector is responsible for the 'color' inspector view.
-
- // This class is an example of a class that is responsible for
- // a set of inspector views in an application. Such classes
- // act as intermediaries between the controls of inspector
- // views and the currently selected object. These classes
- // have outlets to each control in the inspector views it is
- // responsible for, and methods that act as the targets for
- // each of these controls. This intermediary class is
- // necessary because the application can have more than one
- // "inspectable views", each which may be "inspected" on a
- // particular "inspector view", so we don't directly connect
- // the inspector controls to the actual object that the control
- // is currently affecting. Instead, the controls are connected
- // to the inspSet{*} methods of this class, and these methods
- // send a corresponding message to the object itself. They do
- // this by sending the message to the 'currentParameterReceiver'.
- // This means that a setCurrentParameterReceiver: message must
- // be sent to this class when a new object is selected to set
- // the object as the currentParameterReceiver. (Another option
- // is to have the inspSet{*} methods find out the currently
- // selected object (somehow) at the time it is invoked.)
- // The reflect{*}Attributes: methods reflect the attributes of an
- // object on the controls of a particular inspector view.
- // The {*}InspectorNum methods return the inspector number
- // assigned to the inspector when it was given to InspectorManager
- // in the setupInspectors: method.
- // Notice how this class is set up to have only one instance in
- // an application. After the first instance of the class is
- // created using the 'class method 'new', subsequent calls to
- // new return a pointer to this single instance.
-
- #import <objc/Object.h>
-
- @interface ColorInspector:Object
- {
- id colorBox;
- id currentParameterReceiver;
- id inspectorManager;
-
- int bkgndColorInspectorNum;
-
- id colorWellOut;
- id graySliderOut;
- }
-
- - setupInspectors:(id)mainInspector;
- - setCurrentParameterReceiver:(id)newCurrent;
- - (unsigned int)bkgndColorInspectorNum;
-
- - reflectbkgndColorAttributes:(id)theObject;
-
- - inspSetGray:sender;
- - inspSetColor:sender;
-
- @end
-