Notification when the drag'n drop mode changes.

        in dnd_mode of type :class:`DnDMode`
            The new mode for drag'n drop.
435889
def on_dn_d_mode_change(self, dnd_mode):
        
        if not isinstance(dnd_mode, DnDMode):
            raise TypeError("dnd_mode can only be an instance of type DnDMode")
        self._call("onDnDModeChange",
                     in_p=[dnd_mode])
867344
def OnEnterSelectionMode(self, event):
        """"""

        self.grid.sel_mode_cursor = list(self.grid.actions.cursor)
        self.grid.EnableDragGridSize(False)
        self.grid.EnableEditing(False)
1061183
def _notify_change(self):
        
        def inner_action(*args):
            """ Inner action: open file """
            # cache cursor position before reloading so that the cursor
            # position is restored automatically after reload has finished.
            # See OpenCobolIDE/OpenCobolIDE#97
            Cache().set_cursor_position(
                self.editor.file.path,
                self.editor.textCursor().position())
            if os.path.exists(self.editor.file.path):
                self.editor.file.open(self.editor.file.path)
                self.file_reloaded.emit()
            else:
                # file moved just after a change, see OpenCobolIDE/OpenCobolIDE#337
                self._notify_deleted_file()

        args = (_("File changed"),
                _("The file <i>%s</i> has changed externally.\nDo you want to "
                  "reload it?") % os.path.basename(self.editor.file.path))
        kwargs = {"expected_action": inner_action}
        if self.editor.hasFocus() or self.auto_reload:
            self._notify(*args, **kwargs)
        else:
            # show the reload prompt as soon as the editor has focus
            self._notification_pending = True
            self._data = (args, kwargs)
1153422
def on_selection_changed(self):
        
        d = self.declaration
        selection = self.scene.selectedItems()
        self._guards |= 0x01
        try:
            d.selected_items = [item.ref().declaration for item in selection
                                if item.ref()]
        finally:
            self._guards &= ~0x01
1207993
function( event, type, dd, x, elem ){
                // not configured
                if ( !dd )
                    return;
                // remember the original event and type
                var orig = { event:event.originalEvent, type:event.type },
                    // is the event drag related or drog related?
                    mode = type.indexOf("drop") ? "drag" : "drop",
                    // iteration vars
                    result, i = x || 0, ia, $elems, callback,
                    len = !isNaN( x ) ? x : dd.interactions.length;
                // modify the event type
                event.type = type;
                // protects originalEvent from side-effects
                var noop = function(){};
                event.originalEvent = new jQuery.Event(orig.event, {
                    preventDefault: noop,
                    stopPropagation: noop,
                    stopImmediatePropagation: noop
                });
                // initialize the results
                dd.results = [];
                // handle each interacted element
                do if ( ia = dd.interactions[ i ] ){
                    // validate the interaction
                    if ( type !== "dragend" && ia.cancelled )
                        continue;
                    // set the dragdrop properties on the event object
                    callback = drag.properties( event, dd, ia );
                    // prepare for more results
                    ia.results = [];
                    // handle each element
                    $( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){
                        // identify drag or drop targets individually
                        callback.target = subject;
                        // force propagtion of the custom event
                        event.isPropagationStopped = function(){ return false; };
                        // handle the event
                        result = subject ? $event.dispatch.call( subject, event, callback ) : null;
                        // stop the drag interaction for this element
                        if ( result === false ){
                            if ( mode == "drag" ){
                                ia.cancelled = true;
                                dd.propagates -= 1;
                            }
                            if ( type == "drop" ){
                                ia[ mode ][p] = null;
                            }
                        }
                        // assign any dropinit elements
                        else if ( type == "dropinit" )
                            ia.droppable.push( drag.element( result ) || subject );
                        // accept a returned proxy element
                        if ( type == "dragstart" )
                            ia.proxy = $( drag.element( result ) || ia.drag )[0];
                        // remember this result
                        ia.results.push( result );
                        // forget the event result, for recycling
                        delete event.result;
                        // break on cancelled handler
                        if ( type !== "dropinit" )
                            return result;
                    });
                    // flatten the results
                    dd.results[ i ] = drag.flatten( ia.results );
                    // accept a set of valid drop targets
                    if ( type == "dropinit" )
                        ia.droppable = drag.flatten( ia.droppable );
                    // locate drop targets
                    if ( type == "dragstart" && !ia.cancelled )
                        callback.update();
                }
                while ( ++i < len )
                    // restore the original event & type
                    event.type = orig.type;
                    event.originalEvent = orig.event;
                    // return all handler results
                    return drag.flatten( dd.results );
            }
760861
def on_modified(self, event):
        """"""
        for delegate in self.delegates:
            if hasattr(delegate, "on_modified"):
                delegate.on_modified(event)
1195816
def detect_change_mode(text,change):
  ""
  # warning: some wacky diff logic (in python, probably in JS too) is making some adds / deletes look like replacements (see notes at bottom of diff.py)
  if len(change.deltas)>1: return 'internal'
  # todo below: why are blank deltas getting sent? is it a new seg thing? I'm picking 'add' because it has to be in some category and add is most likely next if this is a new seg.
  elif not change.deltas: return 'add'
  delta,=change.deltas # intentional crash if len(deltas)!=1
  if delta.a==delta.b and delta.a==len(text): return 'add'
  elif delta.b==len(text) and len(delta.text)==0: return 'delete'
  else: return 'internal'
230582
def dragMoveEvent(self, event):
        """"""
        if (event.mimeData().hasFormat("text/plain")):
            event.setDropAction(Qt.MoveAction)
            event.accept()
        else:
            event.ignore()
1016304
def setViewMode( self, viewMode ):
        
        ddrop_mode = self.dragDropMode()
        super(XMultiTagEdit, self).setViewMode(viewMode)
        self.setDragDropMode(ddrop_mode)
897983
@Override
    public void setMode(Mode mode) {
		if(this.mode != mode) {
			fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED,
					this.mode, ItemEvent.DESELECTED));
			this.mode = mode;
			if(mode == Mode.PICKING) {
				setPickingMode();
			} else if(mode == Mode.EDITING) {
				setEditingMode();
			}
			if(modeBox != null) {
				modeBox.setSelectedItem(mode);
			}
			fireItemStateChanged(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, mode, ItemEvent.SELECTED));
		}
	}
485242
public void setEditMode(final EditMode mode) {

        if (!m_modeSelect.getValue().equals(mode)) {
            m_modeSelect.setValue(mode);
        }
    }
219362
@Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
    if (draggableView.isDragViewAtBottom()) {
      draggableView.changeDragViewViewAlpha();
    } else {
      draggableView.restoreAlpha();
      draggableView.changeDragViewScale();
      draggableView.changeDragViewPosition();
      draggableView.changeSecondViewAlpha();
      draggableView.changeSecondViewPosition();
      draggableView.changeBackgroundAlpha();
    }
  }
763992
def on_modified(self, event):
        
        if not self._event_error:
            self.logger.info(u"Change detected from an edit on: %s",
                             event.src_path)

            self.compile_dependencies(event.src_path)
493973
def notify_width_changed(self):
        
        new_table_width = sum([col.width for col in self.columns])
        self._graphic_frame.width = new_table_width
669941
def on_state_changed(self, state):
        """"""
        if state:
            self.editor.sig_key_pressed.connect(self._on_key_pressed)
        else:
            self.editor.sig_key_pressed.disconnect(self._on_key_pressed)
519828
def dropped(self, component, event):
        
        if isinstance(component, AbstractStimulusComponent):
            row, col = self.splitAt(event.pos())
            index = self.model().createIndex(row, col, component)
            
            self.model().insertComponent(index, component)

            if isinstance(event.source(), DragLabel):
                if component.__class__.__name__ in self._componentDefaults:
                    component.loadState(self._componentDefaults[component.__class__.__name__])
                self.edit(index)

            self._viewIsDirty = True
            self.viewport().update()
347460
public void setEditMode(EditMode currentMode) {
		super.setEditMode(currentMode);
		if (controller != null) {
			controller.setEditMode(currentMode);
		}
	}