Пример #1
0
 private void OnIconViewDragDrop(object o, DragDropArgs args)
 {
     Console.WriteLine("iFolderWindow.OnIconViewDragDrop()");
        args.RetVal = true;
 }
Пример #2
0
 private void OnIconViewDragDrop(object o, DragDropArgs args)
 {
     args.RetVal = true;
 }
Пример #3
0
        /// <summary>Node has been dropped. Send to presenter.</summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event data.</param>
        private void OnDragDrop(object sender, DragDropArgs e)
        {
            // Get the drop location
            TreePath path;
            TreeIter dest;
            bool success = false;
            if (treeview1.GetPathAtPos(e.X, e.Y, out path) && treemodel.GetIter(out dest, path))
            {
                AllowDropArgs Args = new AllowDropArgs();
                Args.NodePath = FullPath(path);

                Drag.GetData(treeview1, e.Context, e.Context.Targets[0], e.Time);
                if (DragDropData != null)
                {
                    DropArgs args = new DropArgs();
                    args.NodePath = FullPath(path);

                    args.DragObject = DragDropData;
                    if (e.Context.Action == Gdk.DragAction.Copy)
                        args.Copied = true;
                    else if (e.Context.Action == Gdk.DragAction.Move)
                        args.Moved = true;
                    else
                        args.Linked = true;
                    Droped(this, args);
                    success = true;
                }
            }
            Gtk.Drag.Finish(e.Context, success, e.Context.Action == Gdk.DragAction.Move, e.Time);
            e.RetVal = success;
        }
Пример #4
0
 protected void OnCubeListDragDrop(object o, DragDropArgs args)
 {
     logger.Debug ("Drop to CubeList");
     if (CurrentDrag.FromList)
         Gtk.Drag.Finish(args.Context, false, false, args.Time);
     else {
         Gtk.Drag.Finish(args.Context, true, true, args.Time);
         drawCupboard.QueueDraw();
     }
     args.RetVal = true;
 }
Пример #5
0
 protected void OnDrawCupboardDragDrop(object o, DragDropArgs args)
 {
     logger.Debug ("Drop");
     int CubePosX = (args.X + (int)(CubePxSize * 1.5) - CurrentDrag.IconPosX - OrderCupboard.CupboardZeroX) / CubePxSize;
     int CubePosY = (args.Y + (int)(CubePxSize * 1.5) - CurrentDrag.IconPosY - OrderCupboard.CupboardZeroY) / CubePxSize;
     //Для того что бы корректно посчитать 0 ячейку добавли 1, сейчас онимаем.
     CubePosX--; CubePosY--;
     logger.Debug ("CupBoard pos x={0} y={1}", CubePosX, CubePosY);
     bool CanDrag = OrderCupboard.TestPutCube(CurrentDrag.cube, CubePosX, CubePosY);
     if (CanDrag) {
         if(CurrentDrag.FromList) {
             Cube NewCube = CurrentDrag.cube.Clone();
             NewCube.BoardPositionX = CubePosX;
             NewCube.BoardPositionY = CubePosY;
             OrderCupboard.Cubes.Add(NewCube);
             UpdateCubeComponents();
         }
         else {
             CurrentDrag.cube.BoardPositionX = CubePosX;
             CurrentDrag.cube.BoardPositionY = CubePosY;
         }
         Gtk.Drag.Finish(args.Context, true, false, args.Time);
     }
     else
         Gtk.Drag.Finish(args.Context, false, true, args.Time);
     drawCupboard.QueueDraw();
 }
	void HandleTagSelectionDragDrop (object sender, DragDropArgs args)
	{
		args.RetVal = true;
	}
	//
	// PhotoView drag handlers.
	//

	void HandlePhotoViewDragDrop (object sender, DragDropArgs args)
	{
		//Widget source = Gtk.Drag.GetSourceWidget (args.Context);
		//Console.WriteLine ("Drag Drop {0}", source == null ? "null" : source.TypeName);

		args.RetVal = true;
	}
Пример #8
0
		/// <summary>
		/// Emitted on the drop site when the user drops data on the widget.
		/// </summary>
		void HandleDragDrop (object o, DragDropArgs args)
		{
			args.RetVal = true;
			Gtk.Drag.Finish (args.Context, true, false, args.Time);
			
			if (drag_data == null)
				return;
			
			AbstractDockItem item = Owner.HoveredItem;
			
			if (ItemAcceptsDrop ()) {
				item.AcceptDrop (drag_data);
			} else if (providersAcceptDrops) {
				AbstractDockItem rightMost = Owner.RightMostItem;
				int newPosition = rightMost != null ? rightMost.Position : 0;
			
				foreach (string s in drag_data) {
					AbstractDockItemProvider provider;
					if (Owner.HoveredProvider != null && Owner.HoveredProvider.CanAcceptDrop (s))
						provider = Owner.HoveredProvider;
					else if (Owner.Preferences.DefaultProvider.CanAcceptDrop (s))
						provider = Owner.Preferences.DefaultProvider;
					else
						// nothing will take it, continue!
						continue;
					
					provider.AcceptDrop (s, newPosition);
					
					if (FileApplicationProvider.WindowManager != null)
						FileApplicationProvider.WindowManager.UpdateTransientItems ();
				}
			}
			
			ExternalDragActive = false;
		}
Пример #9
0
		void HandleDragDrop (object sender, DragDropArgs args)
		{
			args.RetVal = true;
		}
Пример #10
0
		void HandlePhotoViewDragDrop (object sender, DragDropArgs args)
		{
			//Widget source = Gtk.Drag.GetSourceWidget (args.Context);

			args.RetVal = true;
		}
Пример #11
0
 void HandleDragDrop(object o, Gtk.DragDropArgs args)
 {
 }
Пример #12
0
        void Treeview1_DragDrop (object o, DragDropArgs args)
        {
            args.RetVal = true;

            #if GTK3
            if(args.Context.ListTargets().Length > 0)
                Drag.GetData ((Widget)o, args.Context, args.Context.ListTargets()[0], args.Time);
            #else
            if(args.Context.Targets.Length > 0)
                Drag.GetData ((Widget)o, args.Context, args.Context.Targets[0], args.Time);
            #endif

            var siters = this.siters;
            this.siters = new List<TreeIter>();

            if (siters.Count == 0)
                return;
            
            TreeViewDropPosition pos;
            TreePath path;
            TreeIter iter;

            if (treeview1.GetDestRowAtPos(args.X, args.Y, out path, out pos))
            {
                if (!listStore.GetIter(out iter, path))
                    return;
            }
            else
            {
                iter = GetBaseIter();
                pos = TreeViewDropPosition.IntoOrAfter;
            }

            if (treeview1.Model.GetValue(iter, 2).ToString() == ID_FILE)
            {
                if (pos == TreeViewDropPosition.IntoOrBefore || pos == TreeViewDropPosition.Before)
                    pos = TreeViewDropPosition.Before;
                else
                    pos = TreeViewDropPosition.After;
            }

            if (pos == TreeViewDropPosition.After || pos == TreeViewDropPosition.Before)
                if (!treeview1.Model.IterParent(out iter, iter))
                    return;

            string dest_folder = (iter.Equals(GetBaseIter())) ? "" : GetPathFromIter(iter) + "/";

            List<string> sourcedata = new List<string>();
            List<string> destdata = new List<string>();
            List<FileType> types = new List<FileType>();

            foreach(var si in siters)
            {
                string spath = GetPathFromIter(si);
                string dpath = dest_folder + System.IO.Path.GetFileName(spath);

                sourcedata.Add(spath);
                destdata.Add(dpath);

                types.Add((treeview1.Model.GetValue(si, 2).ToString() == ID_FILE) ? FileType.File : FileType.Folder);
            }

            window._controller.Move(sourcedata.ToArray(), destdata.ToArray(), types.ToArray());
            window.UpdateMenus();
        }
Пример #13
0
	private static void HandleTargetDragDrop (object sender, DragDropArgs args)
	{
		Console.WriteLine ("drop");
		have_drag = false;
		(sender as Gtk.Image).FromPixbuf = trashcan_closed_pixbuf;

#if BROKEN			// Context.Targets is not defined in the bindings
		if (Context.Targets.Length != 0) {
			Drag.GetData (sender, context, Context.Targets.Data as Gdk.Atom, args.Time);
			args.RetVal = true;
		}
#endif

		args.RetVal = false;
	}
Пример #14
0
 protected virtual void OnNodeview1DragDrop(object o, Gtk.DragDropArgs args)
 {
     Console.WriteLine(o);
     Console.WriteLine(args);
 }