Arguments for a starting drag&drop operation.
예제 #1
0
파일: WidgetBackend.cs 프로젝트: garuma/xwt
        public void DragStart(DragStartData data)
        {
            if (data.Data == null)
                throw new ArgumentNullException ("data");

            DataObject dataObj = data.Data.ToDataObject();

            if (data.ImageBackend != null) {
                AdornedWindow = GetParentWindow ();
                AdornedWindow.AllowDrop = true;

                var e = (UIElement)AdornedWindow.Content;

                Adorner = new ImageAdorner (e, data.ImageBackend);

                AdornedLayer = AdornerLayer.GetAdornerLayer (e);
                AdornedLayer.Add (Adorner);

                AdornedWindow.DragOver += AdornedWindowOnDragOver;
            }

            Widget.Dispatcher.BeginInvoke ((Action)(() => {
                var effect = DragDrop.DoDragDrop (Widget, dataObj, data.DragAction.ToWpfDropEffect ());

                OnDragFinished (this, new DragFinishedEventArgs (effect == DragDropEffects.Move));

                if (Adorner != null) {
                    AdornedLayer.Remove (Adorner);
                    AdornedLayer = null;
                    Adorner = null;

                    AdornedWindow.AllowDrop = false;
                    AdornedWindow.DragOver -= AdornedWindowOnDragOver;
                    AdornedWindow = null;
                }
            }));
        }
예제 #2
0
파일: Widget.cs 프로젝트: joncham/xwt
 internal void DragStart(DragStartData sdata)
 {
     Backend.DragStart (sdata);
 }
예제 #3
0
 public void DragStart(DragStartData sdata)
 {
     AllocEventBox ();
     Gdk.DragAction action = ConvertDragAction (sdata.DragAction);
     DragDropInfo.CurrentDragData = sdata.Data;
     EventsRootWidget.DragBegin += HandleDragBegin;
     if (sdata.ImageBackend != null) {
         var img = ((GtkImage)sdata.ImageBackend).ToPixbuf (ApplicationContext, Widget);
         IconInitializer.Init (EventsRootWidget, img, sdata.HotX, sdata.HotY);
     }
     Gtk.Drag.Begin (EventsRootWidget, Util.BuildTargetTable (sdata.Data.DataTypes), action, 1, Gtk.Global.CurrentEvent ?? new Gdk.Event (IntPtr.Zero));
 }
예제 #4
0
 public void DragStart(DragStartData data)
 {
     throw new NotImplementedException ();
 }
예제 #5
0
 public void DragStart(DragStartData sdata)
 {
     Gdk.DragAction action = ConvertDragAction (sdata.DragAction);
     DragDropInfo.CurrentDragData = sdata.Data;
     Widget.DragBegin += HandleDragBegin;
     if (sdata.ImageBackend != null)
         IconInitializer.Init (Widget, (Gdk.Pixbuf) sdata.ImageBackend, sdata.HotX, sdata.HotY);
     Gtk.Drag.Begin (Widget, Util.BuildTargetTable (sdata.Data.DataTypes), action, 1, Gtk.Global.CurrentEvent);
 }
예제 #6
0
		void IWidgetBackend.DragStart (DragStartData data)
		{
			BackendHost.Backend.DragStart (data);
		}
예제 #7
0
 void IWidgetBackend.DragStart(DragStartData data)
 {
     BackendHost.Backend.DragStart(data);
 }
예제 #8
0
        public void DragStart(DragStartData data)
        {
            if (data.Data == null)
                throw new ArgumentNullException ("data");

            DataObject dataObj = data.Data.ToDataObject();

            Widget.Dispatcher.BeginInvoke (
                (Func<DependencyObject, object, DragDropEffects, DragDropEffects>)DragDrop.DoDragDrop,
                Widget, dataObj, data.DragAction.ToWpfDropEffect ()
            );
        }