DemiLib
A collection of Demigiant's utility libraries for Unity (https://github.com/Demigiant/demilib)
DG.DemiEditor.DeGUIDrag Class Reference

Manages the dragging of GUI elements More...

Static Public Member Functions

static DeDragResult Drag (int dragId, IList draggableList, int currDraggableItemIndex)
 Call this after each draggable GUI block, to calculate and draw the current drag state (or complete it if the mouse was released). More...
 
static DeDragResult Drag (int dragId, IList draggableList, int currDraggableItemIndex, Color dragEvidenceColor)
 Call this after each draggable GUI block, to calculate and draw the current drag state (or complete it if the mouse was released). More...
 
static DeDragResult EndDrag (bool applyDrag)
 Ends the drag operations, and eventually applies the drag outcome. Returns TRUE if the position of the dragged item actually changed. Called automatically by Drag method. Use it only if you want to force the end of a drag operation. More...
 
static void StartDrag (int dragId, Editor editor, IList draggableList, int draggedItemIndex, object optionalData=null)
 Starts a drag operation on a GUI element. More...
 
static void StartDrag (int dragId, EditorWindow editorWindow, IList draggableList, int draggedItemIndex, object optionalData=null)
 Starts a drag operation on a GUI element. More...
 

Static Public Attributes

static readonly Color DefaultDragColor = new Color(0.1720873f, 0.4236527f, 0.7686567f, 0.35f)
 

Properties

static object draggedItem [get]
 Return the current item being dragged, or NULL if there is none More...
 
static int draggedItemOriginalIndex [get]
 Starting index of current item being dragged, or NULL if there is none More...
 
static Type draggedItemType [get]
 Type of current item being dragged, or NULL if there is none More...
 
static bool isDragging [get]
 True if a GUI element is currently being dragged More...
 
static object optionalDragData [get]
 Retrieves the eventual optional data stored via the StartDrag method More...
 

Detailed Description

Manages the dragging of GUI elements

Member Function Documentation

static DeDragResult DG.DemiEditor.DeGUIDrag.Drag ( int  dragId,
IList  draggableList,
int  currDraggableItemIndex 
)
static

Call this after each draggable GUI block, to calculate and draw the current drag state (or complete it if the mouse was released).

Parameters
dragIdID for this drag operation (must be the same for both StartDrag and Drag
draggableListList containing the draggable item and all other relative draggable items
currDraggableItemIndexCurrent index of the draggable item being drawn
static DeDragResult DG.DemiEditor.DeGUIDrag.Drag ( int  dragId,
IList  draggableList,
int  currDraggableItemIndex,
Color  dragEvidenceColor 
)
static

Call this after each draggable GUI block, to calculate and draw the current drag state (or complete it if the mouse was released).

Parameters
dragIdID for this drag operation (must be the same for both StartDrag and Drag
draggableListList containing the draggable item and all other relative draggable items
currDraggableItemIndexCurrent index of the draggable item being drawn
dragEvidenceColorColor to use for drag divider and selection
static DeDragResult DG.DemiEditor.DeGUIDrag.EndDrag ( bool  applyDrag)
static

Ends the drag operations, and eventually applies the drag outcome. Returns TRUE if the position of the dragged item actually changed. Called automatically by Drag method. Use it only if you want to force the end of a drag operation.

Parameters
applyDragIf TRUE applies the drag results, otherwise simply cancels the drag
static void DG.DemiEditor.DeGUIDrag.StartDrag ( int  dragId,
Editor  editor,
IList  draggableList,
int  draggedItemIndex,
object  optionalData = null 
)
static

Starts a drag operation on a GUI element.

Parameters
dragIdID for this drag operation (must be the same for both StartDrag and Drag
editorReference to the current editor drawing the GUI (used when a Repaint is needed)
draggableListList containing the dragged item and all other relative draggable items
draggedItemIndexDraggableList index of the item being dragged
optionalDataOptional data that can be retrieved via the optionalDragData static property
static void DG.DemiEditor.DeGUIDrag.StartDrag ( int  dragId,
EditorWindow  editorWindow,
IList  draggableList,
int  draggedItemIndex,
object  optionalData = null 
)
static

Starts a drag operation on a GUI element.

Parameters
dragIdID for this drag operation (must be the same for both StartDrag and Drag
editorWindowReference to the current editor drawing the GUI (used when a Repaint is needed)
draggableListList containing the dragged item and all other relative draggable items
draggedItemIndexDraggableList index of the item being dragged
optionalDataOptional data that can be retrieved via the optionalDragData static property

Member Data Documentation

readonly Color DG.DemiEditor.DeGUIDrag.DefaultDragColor = new Color(0.1720873f, 0.4236527f, 0.7686567f, 0.35f)
static

Property Documentation

object DG.DemiEditor.DeGUIDrag.draggedItem
staticget

Return the current item being dragged, or NULL if there is none

int DG.DemiEditor.DeGUIDrag.draggedItemOriginalIndex
staticget

Starting index of current item being dragged, or NULL if there is none

Type DG.DemiEditor.DeGUIDrag.draggedItemType
staticget

Type of current item being dragged, or NULL if there is none

bool DG.DemiEditor.DeGUIDrag.isDragging
staticget

True if a GUI element is currently being dragged

object DG.DemiEditor.DeGUIDrag.optionalDragData
staticget

Retrieves the eventual optional data stored via the StartDrag method


The documentation for this class was generated from the following file: