Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Cancels a potential drag operationan operation during certain "pre" events.

Usage

Code Block
Set_Property(OLECtrlEntID, "OLE.Cancel", Boolean)

Values

[True | False]0, 1, or 2

Default: False0

Remarks

The Cancel property is automatically set to 0 before the OnDragStart event is fired or BeforeUpdate events are fired. These events fire when a user starts and operation but before the operation is truly applied. If the drag operation is not desired, then setting this property to 1 during the OnDragStart event will prevent the drag from occurring.It is much easier to set drag and drop behavior using the DragConditionDropConditionItemDraggable, or ItemDroppable properties. The OnDragStart event is useful only when the drag and drop rules are more complexevent will abort the operation. Note that this only works if you qualify the aforementioned events synchronously.

Setting this to 1 during the OnDragStart event cancels the drag completely.

Settings this to 1 or 2 during the BeforeUpdate prevents the item's data from updating but leaves the item in edit mode. If you set this to 1, the item stays in edit mode with the cursor at the end of the text. If you set this to 2, the item stays in edit mode with all the text selected.

Example

Code Block
OLE_TREE.OnDragStart: 

   // Get the list of items to be dragged 
   Items = Param1 
   Convert ',' to @FM in Items 
    
   // Don't allow users to drag if any of the items are of the "Group" class 
   Cancel = 0 
   Pos = 1 
   Flag = "" 
   Loop 
       Remove Item From Items At Pos Setting Flag 
   While Item NE "" AND Cancel EQ 0 
       Class = Get_Property(CtrlEntId, "OLE.ItemClass[":Item:"]") 
       Cancel = Class _EQC "Group" 
   Repeat 
    
   // Cancel if need be 
   Set_Property(CtrlEntId, "OLE.Cancel", Cancel) 
    
return

See Also

DragConditionDropConditionItemDraggableItemDroppableBeforeUpdate, DefCancelOnDragStart