protected override void OnDragStart(UIDragEventParameter p) { base.OnDragStart(p); DragDropState = MUIDragDropState.Dragging; if (m_draw != null && m_drag != null) { if (((options & Options.FullDragabled) == Options.FullDragabled) || m_draw.isHoverInTitle()) { DragDropState = MUIDragDropState.DragMoving; } // ** is not necessary //if ((options & Options.FullDragabled) != Options.FullDragabled) //{ // m_draw.states |= MUIWinDraw.States.HoverInTitlebar; //} if (m_draw.isHoverInClose() && ((options & Options.Transparent) != Options.Transparent)) { DragDropState = MUIDragDropState.None; m_drag.enabled = false; } } }
private void ButtonDragHandleOnEventDragEnd(UIComponent component, UIDragEventParameter eventparam) { _isDragging = false; // Also save position SavedToggleX.value = (int)_toolToggleButton.absolutePosition.x; SavedToggleY.value = (int)_toolToggleButton.absolutePosition.y; }
public DragEventArgs(UIDragEventParameter originalParams) : base(originalParams) { this.State = (DragDropState)originalParams.state; this.Data = originalParams.data; this.Position = originalParams.position; this.Target = originalParams.target.ToSkylineToolkitControl(); }
static void OnDragEnd(UIComponent component, UIDragEventParameter eventParam) { try { UICustomControl dpt = GetDPTInParent(component); DPTDrag.OnDragEnd(dpt, eventParam); } catch (Exception ex) { Log.Exception(ex); } }
static void OnOver(UIComponent c, UIDragEventParameter e) { try { LogCalled(); e.Use(); var groupPanel = c.GetComponentInParent <RoadEditorCollapsiblePanel>(); Bar.zOrder = CalculateZOrder(groupPanel, e); Bar.zOrder = CalculateZOrder(groupPanel, e); Bar.isVisible = true; } catch (Exception ex) { Log.Exception(ex); } }
static int CalculateZOrder(RoadEditorCollapsiblePanel groupPanel, UIDragEventParameter _) { var dpts = SortedDPTs(groupPanel); float mouseY = RoadEditorUtils.MouseGUIPosition().y; //Log.Debug(ThisMethod + "mouseY = " + mouseY); foreach (var dpt in dpts) { float dptY = dpt.component.absolutePosition.y + dpt.component.height; if (mouseY < dptY) { return(Mathf.Max(dpt.component.zOrder - 1, 0)); } } int lastZOrder = dpts[dpts.Length - 1].component.zOrder; return(lastZOrder + 1); }
static void OnDrop(UIComponent c, UIDragEventParameter e) { try { LogCalled(); var groupPanel = c.GetComponentInParent <RoadEditorCollapsiblePanel>(); int z = Bar.zOrder; foreach (var dpt in RoadEditorUtils.SelectedDPTsSorted) { dpt.component.zOrder = z; z = dpt.component.zOrder; // put next dpt after this } RearrangeArray(groupPanel); e.Use(); e.state = UIDragDropState.Dropped; } catch (Exception ex) { Log.Exception(ex); } }
public static void OnDragEnd(UICustomControl dpt, UIDragEventParameter e) { try { LogCalled(); e.Use(); GameObject.Destroy(Bar?.gameObject); Bar = null; foreach (var selectedDPT in RoadEditorUtils.SelectedDPTsSorted) { selectedDPT.component.isEnabled = true; selectedDPT.component.opacity = 1; } var groupPanel = dpt.GetComponentInParent <RoadEditorCollapsiblePanel>(); groupPanel.m_Panel.eventDragLeave -= OnLeave; groupPanel.m_Panel.eventDragEnter -= OnEnter; groupPanel.m_Panel.eventDragOver -= OnOver; groupPanel.m_Panel.eventDragDrop -= OnDrop; } catch (Exception ex) { Log.Exception(ex); } }
public static void OnDragStart(UICustomControl dpt, UIDragEventParameter eventParam) { if (RoadEditorUtils.IsDPTSelected(dpt)) { LogCalled(); eventParam.Use(); eventParam.state = UIDragDropState.Dragging; var groupPanel = dpt.GetComponentInParent <RoadEditorCollapsiblePanel>(); groupPanel.m_Panel.eventDragLeave -= OnLeave; groupPanel.m_Panel.eventDragEnter -= OnEnter; groupPanel.m_Panel.eventDragOver -= OnOver; groupPanel.m_Panel.eventDragDrop -= OnDrop; groupPanel.m_Panel.eventDragLeave += OnLeave; groupPanel.m_Panel.eventDragEnter += OnEnter; groupPanel.m_Panel.eventDragOver += OnOver; groupPanel.m_Panel.eventDragDrop += OnDrop; Log.Debug("creating `Add from template` button"); Bar = groupPanel.Container.AddUIComponent <UIPanel>(); Bar.width = groupPanel.m_Panel.width; Bar.height = 1; Bar.backgroundSprite = "TextFieldPanel"; Bar.atlas = KianCommons.UI.TextureUtil.Ingame; Bar.color = Color.red; Bar.name = "ARDragPointer"; Bar.Show(); Bar.zOrder = CalculateZOrder(groupPanel, eventParam); Bar.zOrder = CalculateZOrder(groupPanel, eventParam); // disable moving dpts foreach (var selectedDPT in RoadEditorUtils.SelectedDPTs) { selectedDPT.component.isEnabled = false; selectedDPT.component.opacity = 0.5f; } } }
static void OnEnter(UIComponent _, UIDragEventParameter __) => Bar?.Show();
static void OnLeave(UIComponent _, UIDragEventParameter __) => Bar?.Hide();
void timeSlider_eventDragStart(UIComponent component, UIDragEventParameter eventParam) { Debug.Log("drag start"); pauseUpdates = true; }
private void ButtonDragHandleOnEventDragStart(UIComponent component, UIDragEventParameter eventparam) { _isDragging = true; }
private void OnEventDragStart(UIComponent component, UIDragEventParameter eventparam) { eventDragStart?.Invoke(component, eventparam); }
private void draggingVehicle(UIComponent component, UIDragEventParameter eventParam) { component.GetComponentInChildren <DraggableVehicleInfo>().isDragging = true; }
void timeSlider_eventDragStart(UIComponent component, UIDragEventParameter eventParam) { Debug.Log("drag start"); pauseUpdates = true; }