Overview

Protocol for the Event handling parts of the tool API.

The tool can implement all methods that are defined by NSResponder

Tasks

Properties

dragging

Set to YES while the mouse is down and dragging.

@property (nonatomic) BOOL dragging

Discussion

The setter should initialise the drag action. (set dragStart)

groupID

The group ID.

@property (nonatomic, readonly) NSUInteger groupID

Discussion

The group ID defines the position of the tool in the toolbar.

  • selection tools (select, text): 10
  • editTools (draw): 20
  • navigationTools (hand, zoom): 30

tempTrigger

The trigger (key mask) to select the tool temporarily

@property (nonatomic, readonly) NSInteger tempTrigger

Discussion

The select tool is selected with the cmd key. It returns NSCommandKeyMask.

title

The descrition/name of the plugin.

@property (nonatomic, readonly) NSString *title

toolBarIcon

The icon displayed in the toolbar.

@property (nonatomic, readonly) NSImage *toolBarIcon

Instance Methods

drawBackground

Draw some general things to the background of the edit view.

- (void)drawBackground

drawForeground

Draw some general things to the background of the edit view.

- (void)drawForeground

drawSelection

Draws the active selection. The default is a colored dragg rect.

- (void)drawSelection

modifierChanged:

Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).

- (void)modifierChanged:(NSEvent *)anEvent

Parameters

anEvent

An object encapsulating information about the modifier-key event.

showInfoForSelection

actually show the info for Selection dialog

- (void)showInfoForSelection

Discussion

is only called if canShowInfoForSelection returned YES.

toolbarMenu

Return a NSMenu object that should be displayed if the user presses/holdes the mouse on the icon

- (NSMenu *)toolbarMenu

Return Value

A NSMenu object

willActivate

Is called when the tool is activated.

- (void)willActivate

Discussion

This might happen when the user selects the tool or when the document becomes active

See Also

willDeactivate

Is called when the tool is deactivated.

- (void)willDeactivate

Discussion

This might happen when the user deselects the tool or when the document becomes inactive

See Also