draw Event (AnnAutomation)

Summary

Occurs when an AnnObject is being drawn.

Syntax

JavaScript Syntax
Object.defineProperty(AnnAutomation.prototype,'draw',  
	get: function(), 
	set: function(value) 
) 
function draw.add(function(sender, e)); 
function draw.remove(function(sender, e)); 
TypeScript Syntax
draw: void;

Remarks

When an object is being drawn, the automation object will hook the object draw designer's AnnDrawDesigner.Draw to this event. Therefore, instead of hooking and unhooking to the various designers draw events, you can simply subscribe to this event once.

Example

The following example will show how to stop drawing new line objects.

Start with the AnnAutomationManager example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:

Click the example button then try to draw a line object.

JavaScript Example
example: function SiteLibrary_DefaultPage$example() { 
   var _this = this; 
   // Hook to the automation's Draw event 
   this._automation.add_draw(function(sender, e) { 
      // e is of type AnnDrawDesignerEventArgs 
 
      // Check if we are drawing a line and we just started, if so, cancel it 
      if(_this._automation.get_manager().get_currentObjectId() == lt.Annotations.Core.AnnObject.lineObjectId && 
         e.get_operationStatus() == lt.Annotations.Core.AnnDesignerOperationStatus.start) { 
         alert("Canceling line..."); 
         e.set_cancel(true); 
      } 
   }); 
}, 

Event Data
ParameterTypeDescription
sendervarThe source of the event.
eAnnDrawDesignerEventArgsThe event data.
Requirements

Target Platforms

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
Leadtools.Annotations.Automation Assembly
Click or drag to resize