public DragOverEventArgs(Point position, ITransferData info, DragDropAction action) { Position = position; Info = info; Action = action; AllowedAction = DragDropAction.Default; }
public void SetDragTarget(string[] types, DragDropAction dragAction) { SetupForDragDrop(Widget.GetType()); var dtypes = types.Select(t => ToNSDragType(t)).ToArray(); Widget.RegisterForDraggedTypes(dtypes); }
/// <summary> /// Initializes a new instance of the <see cref="Xwt.DragOverEventArgs"/> class. /// </summary> /// <param name="position">The potential drop coordinates (in widget coordinates).</param> /// <param name="dataStore">The collection of transferred data.</param> /// <param name="action">The proposed drag&drop action type.</param> public DragOverEventArgs(Point position, ITransferData dataStore, DragDropAction action) { Position = position; Data = dataStore; Action = action; AllowedAction = DragDropAction.Default; }
public DragEventArgs (Point position, Xwt.Backends.TransferDataStore dataStore, DragDropAction action) { Data = dataStore; Position = position; Action = action; Success = false; }
public void SetDragSource(string[] types, DragDropAction dragAction) { sourceDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); Gtk.Drag.SourceSet(Widget, (Gdk.ModifierType) 0, (Gtk.TargetEntry[])table, sourceDragAction); }
public DragOverCheckEventArgs (Point position, TransferDataType[] types, DragDropAction action) { DataTypes = types; Action = action; Position = position; AllowedAction = DragDropAction.Default; }
public DragCheckEventArgs(Point position, TransferDataType[] types, DragDropAction action) { DataTypes = types; Action = action; Position = position; Result = DragDropResult.None; }
/// <summary> /// Initializes a new instance of the <see cref="Xwt.DragEventArgs"/> class. /// </summary> /// <param name="position">The drop coordinates (in widget coordinates).</param> /// <param name="dataStore">The collection of transferred data.</param> /// <param name="action">The drag&drop action type.</param> public DragEventArgs(Point position, Xwt.Backends.TransferDataStore dataStore, DragDropAction action) { Data = dataStore; Position = position; Action = action; Success = false; }
public void SetDragSource(TransferDataType[] types, DragDropAction dragAction) { DragDropInfo.SourceDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); OnSetDragSource(Gdk.ModifierType.Button1Mask, (Gtk.TargetEntry[])table, DragDropInfo.SourceDragAction); }
/// <summary> /// Initializes a new instance of the <see cref="Xwt.DragOverCheckEventArgs"/> class. /// </summary> /// <param name="position">The potential drop coordinates (in widget coordinates).</param> /// <param name="types">The transferred data types.</param> /// <param name="action">The proposed drag&drop action type.</param> public DragOverCheckEventArgs(Point position, TransferDataType[] types, DragDropAction action) { DataTypes = types; Action = action; Position = position; AllowedAction = DragDropAction.Default; }
/// <summary> /// Initializes a new instance of the <see cref="Xwt.DragCheckEventArgs"/> class. /// </summary> /// <param name="position">The drop coordinates (in widget coordinates).</param> /// <param name="types">The types of the transferred data.</param> /// <param name="action">The proposed drag&drop action type.</param> public DragCheckEventArgs(Point position, TransferDataType[] types, DragDropAction action) { DataTypes = types; Action = action; Position = position; Result = DragDropResult.None; }
public DragEventArgs(Point position, ITransferData data, DragDropAction action) { Data = data; Position = position; Action = action; Success = false; }
public void SetDragTarget(string[] types, DragDropAction dragAction) { destDragAction = ConvertDragAction(dragAction); var table = Util.BuildTargetTable(types); validDropTypes = (Gtk.TargetEntry[])table; Gtk.Drag.DestSet(Widget, Gtk.DestDefaults.Highlight, validDropTypes, destDragAction); }
internal DragStartData(TransferDataSource data, DragDropAction action, object imageBackend, double hotX, double hotY) { Data = data; DragAction = action; ImageBackend = imageBackend; HotX = hotX; HotY = hotY; }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object imageBackend, double hotX, double hotY) { Gdk.DragAction action = ConvertDragAction(dragAction); currentDragData = data; Widget.DragBegin += HandleDragBegin; IconInitializer.Init(Widget, (Gdk.Pixbuf)imageBackend, hotX, hotY); Gtk.Drag.Begin(Widget, Util.BuildTargetTable(data.DataTypes), action, 1, Gtk.Global.CurrentEvent); }
/// <summary> /// Sets up a widget so that XWT will start a drag operation when the user clicks and drags on the widget. /// </summary> /// <param name='types'> /// Types of data that can be dragged from this widget /// </param> /// <param name='dragAction'> /// Bitmask of possible actions for a drag from this widget /// </param> public virtual void SetDragSource(DragDropAction dragAction, params TransferDataType[] types) { if (DragDropInfo.AutodetectDrag) { return; // Drag auto detect has been already activated. } DragDropInfo.AutodetectDrag = true; DragDropInfo.SourceTypes = types; }
private static void AddDropCardAction(this GameObject gameObject, DragDropAction dropAction) { BoxCollider2D boxCollider = gameObject.AddComponent <BoxCollider2D>(); boxCollider.isTrigger = true; boxCollider.size = D.CardSize; var dropController = gameObject.AddComponent <DropCardController>(); dropController.DragDropAction = dropAction; }
public void SetDragSource(TransferDataType [] types, DragDropAction dragAction) { if (DragDropInfo.AutodetectDrag) { return; // Drag auto detect has been already activated. } DragDropInfo.AutodetectDrag = true; Widget.MouseUp += WidgetMouseUpForDragHandler; Widget.MouseMove += WidgetMouseMoveForDragHandler; }
static DragDropAction GetOrCreateAction(DependencyObject depObj) { DragDropAction action = depObj.GetValue(DragDropActionProperty) as DragDropAction; if (action == null) { action = new DragDropAction(); depObj.SetValue(DragDropActionProperty, action); } return(action); }
public void DragOver(IDropInfo dropInfo) { DragDropAction <StartListItemViewModel> action = dropInfo.GetDragDropAction <StartListItemViewModel>(inSource: s => this.Skiers.Data.Contains(s)); if (action == null) { return; } switch (action.Drag, action.Drop) {
public override void SetDragSource(DragDropAction dragAction, params TransferDataType[] types) { base.SetDragSource(dragAction, types); Backend.MouseUp += (s, e) => { var ev = Converter.Convert(e); MouseUp(ev); }; Backend.MouseMove += (s, e) => { var ev = Converter.Convert(e); MouseMove(ev); }; }
private void ListViewControl_DragDrop(object sender, DragEventArgs e) { if (e.Effect != DragDropEffects.Copy) { return; } if (!e.Data.GetDataPresent(typeof(DragDropData))) { return; } DragDropData data = e.Data.GetData(typeof(DragDropData)) as DragDropData; DragDropKey key = new DragDropKey(data.SourceColumn.GetType().FullName, GetType().FullName); DragDropAction action = Host.DragDropHandlers[key]; action.Invoke(data.SourceColumn, this, data.Items); }
static NSDragOperation ConvertAction(DragDropAction action) { NSDragOperation res = (NSDragOperation)0; if ((action & DragDropAction.Copy) != 0) { res |= NSDragOperation.Copy; } if ((action & DragDropAction.Move) != 0) { res |= NSDragOperation.Move; } if ((action & DragDropAction.Link) != 0) { res |= NSDragOperation.Link; } return(res); }
public static DragDropEffects ToWpfDropEffect(this DragDropAction value) { var effects = DragDropEffects.None; if ((value & DragDropAction.Copy) > 0) { effects |= DragDropEffects.Copy; } if ((value & DragDropAction.Move) > 0) { effects |= DragDropEffects.Move; } if ((value & DragDropAction.Link) > 0) { effects |= DragDropEffects.Link; } return(effects); }
protected override IEnumerable <DragDropAction> CreateDragDropActions() { /* * var stashDD = new DragDropAction<StashNode>( * (draggedStash) => IsActive, * (draggedStash) => * { * // normal -> Pop * // Alt -> Apply * UICommands.StartStashDialog(); * }); */ var branchDD = new DragDropAction <BranchNode>(draggedBranch => { string activeBranch = UICommands.Module.GetSelectedBranch(); if (Equals(FullPath, activeBranch)) { // target is active -> merge dropped return(true); } if (Equals(draggedBranch.FullPath, activeBranch)) { // dragged is active -> merge dragged return(true); } return(false); }, draggedBranch => { string activeBranch = UICommands.Module.GetSelectedBranch(); if (Equals(FullPath, activeBranch)) { // target is active -> merge dropped UICommands.StartMergeBranchDialog(draggedBranch.FullPath); } if (Equals(draggedBranch.FullPath, activeBranch)) { // dropped is active -> merge target UICommands.StartMergeBranchDialog(FullPath); } }); return(new DragDropAction[] { /*stashDD,*/ branchDD }); }
static DragDropAction ConvertAction(NSDragOperation action) { if (action == NSDragOperation.AllObsolete) { return(DragDropAction.All); } DragDropAction res = (DragDropAction)0; if ((action & NSDragOperation.Copy) != 0) { res |= DragDropAction.Copy; } if ((action & NSDragOperation.Move) != 0) { res |= DragDropAction.Move; } if ((action & NSDragOperation.Link) != 0) { res |= DragDropAction.Link; } return(res); }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object image, double xhot, double yhot) { var lo = RootWidget.ConvertPointToBase(new PointF(Widget.Bounds.X, Widget.Bounds.Y)); lo = RootWidget.Window.ConvertBaseToScreen(lo); var ml = NSEvent.CurrentMouseLocation; var pb = NSPasteboard.FromName(NSPasteboard.NSDragPasteboardName); if (pb == null) { throw new InvalidOperationException("Could not get pasteboard"); } if (data == null) { throw new ArgumentNullException("data"); } InitPasteboard(pb, data); var img = (NSImage)image; var pos = new PointF(ml.X - lo.X - (float)xhot, lo.Y - ml.Y - (float)yhot + img.Size.Height); Widget.DragImage(img, pos, new SizeF(0, 0), NSApplication.SharedApplication.CurrentEvent, pb, Widget, true); }
public virtual DragDropAction DragDropActionFromKeyState(int keyState, DragDropAction allowedEffect) { // Set the effect based upon the KeyState. if ((keyState & (8 + 32)) == (8 + 32) && (allowedEffect & DragDropAction.Link) == DragDropAction.Link) { // KeyState 8 + 32 = CTL + ALT // Link drag and drop effect. return(DragDropAction.Link); } else if ((keyState & 32) == 32 && (allowedEffect & DragDropAction.Link) == DragDropAction.Link) { // ALT KeyState for link. return(DragDropAction.Link); } else if ((keyState & 4) == 4 && (allowedEffect & DragDropAction.Move) == DragDropAction.Move) { // SHIFT KeyState for move. return(DragDropAction.Move); } else if ((keyState & 8) == 8 && (allowedEffect & DragDropAction.Copy) == DragDropAction.Copy) { // CTL KeyState for copy. return(DragDropAction.Copy); } else if ((allowedEffect & DragDropAction.Move) == DragDropAction.Move) { // By default, the drop action should be copy, if allowed. return(DragDropAction.Copy); } return(DragDropAction.Copy); }
public void SetDragTarget(string[] types, DragDropAction dragAction) { }
public void SetDragSource(string[] types, DragDropAction dragAction) { }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object dragImage, double xhot, double yhot) { throw new NotImplementedException (); }
public void SetDragTarget(TransferDataType[] types, DragDropAction dragAction) { DragDropInfo.DestDragAction = ConvertDragAction (dragAction); var table = Util.BuildTargetTable (types); DragDropInfo.ValidDropTypes = (Gtk.TargetEntry[]) table; OnSetDragTarget (DragDropInfo.ValidDropTypes, DragDropInfo.DestDragAction); }
public void SetDragSource(TransferDataType[] types, DragDropAction dragAction) { AllocEventBox (); DragDropInfo.SourceDragAction = ConvertDragAction (dragAction); var table = Util.BuildTargetTable (types); OnSetDragSource (Gdk.ModifierType.Button1Mask, (Gtk.TargetEntry[]) table, DragDropInfo.SourceDragAction); }
void IWidgetBackend.SetDragSource (TransferDataType[] types, DragDropAction dragAction) { this.SetDragSource (dragAction, types); }
public void SetDragSource(TransferDataType [] types, DragDropAction dragAction) { throw new NotImplementedException(); }
Gdk.DragAction ConvertDragAction(DragDropAction dragAction) { Gdk.DragAction action = (Gdk.DragAction)0; if ((dragAction & DragDropAction.Copy) != 0) action |= Gdk.DragAction.Copy; if ((dragAction & DragDropAction.Move) != 0) action |= Gdk.DragAction.Move; if ((dragAction & DragDropAction.Link) != 0) action |= Gdk.DragAction.Link; return action; }
public void SetDragSource(string[] types, DragDropAction dragAction) { sourceDragAction = ConvertDragAction (dragAction); var table = Util.BuildTargetTable (types); Gtk.Drag.SourceSet (Widget, (Gdk.ModifierType)0, (Gtk.TargetEntry[]) table, sourceDragAction); }
public void SetDragSource(DragDropAction dragAction, params string[] types) { Backend.SetDragSource (types, dragAction); }
public DragOverEventArgs(Point position, ITransferData dataStore, DragDropAction action) { Position = position; Data = dataStore; Action = action; AllowedAction = DragDropAction.Default; }
public void SetDragSource(DragDropAction dragAction, params Type[] types) { Backend.SetDragSource (types.Select (t => TransferDataType.FromType (t)).ToArray(), dragAction); }
public void SetDragSource(DragDropAction dragAction, params TransferDataType[] types) { Backend.SetDragSource (types, dragAction); }
protected override IEnumerable<DragDropAction> CreateDragDropActions() { /* var stashDD = new DragDropAction<StashNode>( (draggedStash) => IsActive, (draggedStash) => { // normal -> Pop // Alt -> Apply UICommands.StartStashDialog(); }); */ var branchDD = new DragDropAction<BranchNode>(draggedBranch => { string activeBranch = UICommands.Module.GetSelectedBranch(); if (Equals(FullPath, activeBranch)) {// target is active -> merge dropped return true; } if (Equals(draggedBranch.FullPath, activeBranch)) {// dragged is active -> merge dragged return true; } return false; }, draggedBranch => { string activeBranch = UICommands.Module.GetSelectedBranch(); if (Equals(FullPath, activeBranch)) {// target is active -> merge dropped UICommands.StartMergeBranchDialog(draggedBranch.FullPath); } if (Equals(draggedBranch.FullPath, activeBranch)) {// dropped is active -> merge target UICommands.StartMergeBranchDialog(FullPath); } }); return new DragDropAction[] { /*stashDD,*/ branchDD }; }
public void SetDragDropTarget(DragDropAction dragAction, params Type[] types) { Backend.SetDragTarget (types.Select (t => TransferDataType.GetDataType (t)).ToArray(), dragAction); }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object imageBackend, double hotX, double hotY) { Gdk.DragAction action = ConvertDragAction (dragAction); currentDragData = data; Widget.DragBegin += HandleDragBegin; IconInitializer.Init (Widget, (Gdk.Pixbuf) imageBackend, hotX, hotY); Gtk.Drag.Begin (Widget, Util.BuildTargetTable (data.DataTypes), action, 1, Gtk.Global.CurrentEvent); }
public void SetDragSource(TransferDataType [] types, DragDropAction dragAction) { if (DragDropInfo.AutodetectDrag) return; // Drag auto detect has been already activated. DragDropInfo.AutodetectDrag = true; Widget.MouseUp += WidgetMouseUpForDragHandler; Widget.MouseMove += WidgetMouseMoveForDragHandler; }
public void SetDragTarget(string[] types, DragDropAction dragAction) { destDragAction = ConvertDragAction (dragAction); var table = Util.BuildTargetTable (types); validDropTypes = (Gtk.TargetEntry[]) table; Gtk.Drag.DestSet (Widget, Gtk.DestDefaults.Highlight, validDropTypes, destDragAction); }
public void SetDragSource(DragDropAction dragAction, params Type[] types) { Backend.SetDragSource (types.Select (t => t.FullName).ToArray(), dragAction); }
public void DragStart(TransferDataSource data, DragDropAction dragAction, object imageBackend, double hotX, double hotY) { throw new NotImplementedException (); }
/// <summary> /// Initializes a new instance of the <see cref="Xwt.Backends.DragStartData"/> class. /// </summary> /// <param name="data">The collection of data to be transferred through drag operation.</param> /// <param name="action">The type of the drag action.</param> /// <param name="imageBackend">The image backend of the drag image.</param> /// <param name="hotX">The image hotspot X coordinate.</param> /// <param name="hotY">The image hotspot Y coordinate.</param> internal DragStartData (TransferDataSource data, DragDropAction action, object imageBackend, double hotX, double hotY) { Data = data; DragAction = action; ImageBackend = imageBackend; HotX = hotX; HotY = hotY; }
public void SetDragTarget(string [] types, DragDropAction dragAction) { throw new NotImplementedException (); }
public void SetDragDropTarget(DragDropAction dragAction, params string[] types) { Backend.SetDragTarget (types, dragAction); }
internal void DragStart(TransferDataSource data, DragDropAction allowedDragActions, object image, double hotX, double hotY) { Backend.DragStart (data, allowedDragActions, image, hotX, hotY); }
/// <summary> /// Sets a widget as a potential drop destination /// </summary> /// <param name='types'> /// Types. /// </param> /// <param name='dragAction'> /// Drag action. /// </param> public override void SetDragTarget(DragDropAction dragAction, params TransferDataType[] types) { DragDropInfo.TargetTypes = types == null ? new TransferDataType[0] : types; Backend.AllowDrop = true; }
public void SetDragTarget(TransferDataType [] types, DragDropAction dragAction) { throw new NotImplementedException (); }
public void SetDragTarget(TransferDataType [] types, DragDropAction dragAction) { DragDropInfo.TargetTypes = types == null ? new TransferDataType [0] : types; Widget.AllowDrop = true; }
public void SetDragDropTarget(DragDropAction dragAction, params TransferDataType[] types) { Backend.SetDragTarget (types, dragAction); }