/// <summary> /// Starts dragging item /// </summary> /// <param name="dropHandleType">On which action released drop event</param> /// <param name="draggingItem">Item which is dragging</param> /// <param name="draggingFrom">Information about item's origin</param> public void StartDragging(MyDropHandleType dropHandleType, MyGuiControlListboxItem draggingItem, MyDragAndDropInfo draggingFrom) { m_currentDropHandleType = dropHandleType; m_draggingListboxItem = draggingItem; m_draggingFrom = draggingFrom; m_toolTip = draggingItem.ToolTip; }
/// <summary> /// Starts dragging item /// </summary> /// <param name="dropHandleType">On which action released drop event</param> /// <param name="draggingItem">Item which is dragging</param> /// <param name="draggingFrom">Information about item's origin</param> public void StartDragging(MyDropHandleType dropHandleType, MySharedButtonsEnum dragButton, MyGuiControlGrid.Item draggingItem, MyDragAndDropInfo draggingFrom, bool includeTooltip = true) { m_currentDropHandleType = dropHandleType; m_dragButton = dragButton; m_draggingGridItem = draggingItem; m_draggingFrom = draggingFrom; m_toolTip = (includeTooltip) ? draggingItem.ToolTip : null; }
private void StartDragging(MyDropHandleType dropHandlingType, MyGuiControlGrid gridControl, ref MyGuiControlGrid.EventArgs args) { m_dragAndDropInfo = new MyDragAndDropInfo(); m_dragAndDropInfo.Grid = gridControl; m_dragAndDropInfo.ItemIndex = args.ItemIndex; var draggingItem = m_dragAndDropInfo.Grid.GetItemAt(m_dragAndDropInfo.ItemIndex); m_dragAndDrop.StartDragging(dropHandlingType, args.Button, draggingItem, m_dragAndDropInfo, includeTooltip: false); }
private void StartDragging(MyDropHandleType dropHandlingType, MyGuiControlListbox listbox, int rowIndex, int itemIndex) { MyDragAndDropInfo dragAndDropInfo = new MyDragAndDropInfo(); dragAndDropInfo.Listbox = listbox; dragAndDropInfo.RowIndex = rowIndex; dragAndDropInfo.ItemIndex = itemIndex; MyGuiControlListboxItem draggingItem = dragAndDropInfo.Listbox.GetItem(dragAndDropInfo.RowIndex, dragAndDropInfo.ItemIndex); // if inventory screen is in god editor mode, then we want use other side inventory items as templates if (m_inventoryScreenType == MyGuiScreenInventoryType.GodEditor && listbox == m_otherSideInventoryListBox) { draggingItem = CreateCopyOfListboxItem(draggingItem); } else { dragAndDropInfo.Listbox.RemoveItem(dragAndDropInfo.RowIndex, dragAndDropInfo.ItemIndex, false); } m_dragAndDrop.StartDragging(dropHandlingType, draggingItem, dragAndDropInfo); listbox.HideToolTip(); DisabledInvalidListboxesForDrop(m_itemsRepository.GetItem(draggingItem.Key)); if (listbox != m_shipInventoryListBox && IsListboxFull(m_shipInventoryListBox)) { m_shipInventoryListBox.Enabled = false; } else if (listbox != m_otherSideInventoryListBox && IsListboxFull(m_otherSideInventoryListBox)) { m_otherSideInventoryListBox.Enabled = false; } }
private void StartDragging(MyDropHandleType dropHandlingType, MyGuiControlGrid gridControl, ref MyGuiControlGrid.EventArgs args) { m_dragAndDropInfo = new MyDragAndDropInfo(); m_dragAndDropInfo.Grid = gridControl; m_dragAndDropInfo.ItemIndex = args.ItemIndex; DisableInvalidWhileDragging(); var draggingItem = m_dragAndDropInfo.Grid.GetItemAt(m_dragAndDropInfo.ItemIndex); m_dragAndDrop.StartDragging(dropHandlingType, args.Button, draggingItem, m_dragAndDropInfo, includeTooltip: false); }