예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Eto.Forms.GridDragInfo"/> class.
 /// </summary>
 /// <param name="control">The parent widget that this info belongs to</param>
 /// <param name="item">Item user is dragging to.</param>
 /// <param name="index">Index where the item should be inserted, or -1 if dragging ontop of item.</param>
 /// <param name="position">The position of the cursor relative to the item under the cursor.</param>
 public GridViewDragInfo(GridView control, object item, int index, GridDragPosition position)
 {
     Control   = control;
     _item     = item;
     _index    = index;
     _position = position;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Eto.Forms.TreeGridDragInfo"/> class.
 /// </summary>
 /// <param name="control">The parent widget that this info belongs to</param>
 /// <param name="parent">Parent of the item dragging to.</param>
 /// <param name="item">Item user is dragging to, or null if dragging as a child of the parent node.</param>
 /// <param name="childIndex">Index of the item relative to the parent if known, otherwise null to determine the index when requsted.</param>
 /// <param name="position">The position of the cursor relative to the item or parent if item is null.</param>
 public TreeGridViewDragInfo(TreeGridView control, object parent, object item, int?childIndex, GridDragPosition position)
 {
     Control     = control;
     _parent     = parent;
     _childIndex = childIndex;
     _position   = position;
     _item       = item;
 }
예제 #3
0
        public static Gtk.TreeViewDropPosition ToGtk(this GridDragPosition position)
        {
            switch (position)
            {
            case GridDragPosition.Before:
                return(Gtk.TreeViewDropPosition.Before);

            case GridDragPosition.After:
                return(Gtk.TreeViewDropPosition.After);

            case GridDragPosition.Over:
                return(Gtk.TreeViewDropPosition.IntoOrBefore);

            default:
                throw new NotSupportedException();
            }
        }