GlyphsToolEvent Protocol Reference
Overview
Protocol for the Event handling parts of the tool API.
The tool can implement all methods that are defined by NSResponder
Tasks
-
groupIDproperty required method -
titleproperty required method -
toolBarIconproperty required method -
tempTriggerproperty required method -
draggingproperty required method -
– modifierChanged:required method -
– willActivaterequired method -
– willDeactivaterequired method -
– willSelectTempTool:required method -
– drawBackgroundrequired method -
– drawSelectionrequired method -
– drawForegroundrequired method -
– copy: -
– paste: -
– toolbarMenu -
– addMenuItemsForEvent:toMenu: -
– selectNextSubTool: -
– activeLayers -
– showInfoForSelection
Properties
dragging
Set to YES while the mouse is down and dragging.
@property (nonatomic) BOOL draggingDiscussion
The setter should initialise the drag action. (set dragStart)
groupID
The group ID defines the position of the tool in the toolbar.
@property (nonatomic, readonly) NSUInteger groupIDDiscussion
- selection tools (select, text): 10
- editTools (draw): 20
- navigationTools (hand, zoom): 30
Instance Methods
activeLayers
returns all layers that arecurrently active. That is mostly used for the ‘Select All Layers’ tool.
- (NSArray *)activeLayersReturn Value
an array of layers
addMenuItemsForEvent:toMenu:
Callback to allow to add something to the contect menu
- (void)addMenuItemsForEvent:(NSEvent *)theEvent toMenu:(NSMenu *)theMenuParameters
- theEvent
the current event
- theMenu
the context menu to add to
drawSelection
Draws the active selection. The default is a colored dragg rect.
- (void)drawSelectionmodifierChanged:
Informs the receiver that the user has pressed or released a modifier key (Shift, Control, and so on).
- (void)modifierChanged:(NSEvent *)anEventParameters
- anEvent
An object encapsulating information about the modifier-key event.
selectNextSubTool:
if the tool has several sub groups, this is called to swithch to the next tool
- (void)selectNextSubTool:(id)senderParameters
- sender
the object calling the command
showInfoForSelection
actually show the info for Selection dialog
- (void)showInfoForSelectionDiscussion
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 *)toolbarMenuReturn Value
A NSMenu object
willActivate
Is called when the tool is activated.
- (void)willActivateDiscussion
This might happen when the user selects the tool or when the document becomes active