An outline view for general use. This is a small rewrite of the outline view I use in Pref Setter. This subclass has the following features:
The alternating row colors.
Returns the custom alternating row colors being used, or nil if they haven't been set.
Fills the specified rect with a gradient.
The rect you wish to fill with a gradient.
The starting color of the gradient. Note this color must be a device RGB color.
The ending color of the gradient. Note this color must be a device RGB color.
The highlight image drawn as the selection(s).
Returns the image used to draw the selection(s).
Draws the selections.
The visible portion of the outline view.
Returns if the outline view is the first responder.
If the outline view is the first responder, returns YES, otherwise returns NO.
Returns if the outline view is using rounded selections or not.
Returns YES if rounded selections are being used, NO otherwise.
The inactive highlight image drawn as the selection(s).
Returns the image used to draw the selection(s) when the outline view is inactive. Only used if the outline view is using the highlight color in the background.
Sets the color of the alternating row colors.
An array containing two colors to be used as the row colors.
Sets the dragging source opertaions.
For ease of setting your drag operations without needing to edit the subclass.
Note that there's a new method on 10.4 that will do this — this is mainly for pre 10.4 use.
Sets if modifier keys are ignored during drags.
If YES, ignores modifier keys while dragging. If NO, honors modifier keys while dragging.
Sets if the outline view uses rounded selections.
If YES, selections are rounded. If NO, selections are normal.
Sets if custom alternating row colors are used.
If YES, sets the outline view to use custom alternating row colors.
This method will do nothing if the alternating row colors have not been set.
This flag is automatically turned on when custom row colors are set. Most likely, you will not need to call this method.
Sets if the outline view uses gradient selections.
If YES, selections use gradients. If NO, selections are normal.
Gradient selections are used by default.
Sets if highlights are tinted with the user's selection color when inactive.
If YES, sets to tint the highlight color when inactive.
This is used by default.
Returns if custom alternating row colors are being used.
Returns YES if custom alternating row colors are being used, NO if they aren't.
Returns if the outline view is using gradient selections.
Returns YES if gradient selections are being used, NO otherwise.
Returns if the outline view is tinting the selections with the highlight color when inactive.
Returns YES if highlights are tinted when inactive, NO otherwise.
Lets the delegate know the drag failed.
The outline view for which the drag failed.
The returned drag operation.
The last position (in screen coordinates) of the lower left corner of the drag image before the drag failed.
If YES, the drag ended inside the outline view.
You can use this method to do whatever sort of clean up or anything of that nature you wish to if the drag fails.
Note that this method is called both when a drag is not accepted by any drag sources AND if the drag is dropped over the Trash icon in the Dock. In the former case, the operation parameter will be NSDragOperationNone, and in the latter it will be NSDragOperationDelete.
Called when a drag is started to create a custom drag image.
The outline view that is starting the drag.
The row indexes that are selected in the outline view.
The column indexes that are selected in the outline view.
A pointer to the coordinates of the lower left corner of the default drag image.
The size of the default drag image.
The drag event.
The image you wish to use as the drag image, or nil if you wish to use the outline view's drag image.
You can use this method to create your own drag image. Some things to note:
Called when a text movement (i.e. an edit) occurs.
The outline view for which the text movement is occurring.
The text movment that is occurring.
The table column that is currently being edited.
The item that is currently being edited.
If the delegate handles the text movement (or wants to ignore it), this method should return NO, otherwise it should return YES to allow the outline view to handle it as it normally would.
You can use this method to stop the edit from completing (though a formatter would likely be a better way to do this), or to keep the tab key from moving on to the next item.
Called when a key down event occurs.
The outline view for which the key down event is occurring.
The key down event that is occurring.
If the delegate handles the keydown, this method should return NO, otherwise it should return YES to allow the outline view to handle it as it normally would.
Called when a drag is started to see if the image should slideback if not accepted.
The outline view that is starting the drag.
If you wish for the drag image to slide back if not accepted, return YES, otherwise return NO.