private void _treeList_OnSelect(UIActionEvent e, UIElement sender) { var list = (UIBrowserTreeList)sender; var target = (BrowserTreeDisplayNode)list.SelectedElement; OnSelectionChange?.Invoke(new UIActionEvent(target.BindingElement, e.TimeStamp), this); }
public static void Select(DocumentObject documentObject, bool silently = false) { if (currentObject == documentObject) { return; } currentObject = documentObject; if (!silently) { OnSelectionChange?.Invoke(documentObject); } #if DEBUG // For Debug if (documentObject != null) { Console.WriteLine("Selected object : " + currentObject.Name); } else { Console.WriteLine("UnSelecting object"); } #endif }
void UpdateSelected() { if (onSelectionChangeCallback != null) { onSelectionChangeCallback.Invoke(selected); } }
public void ClearSelection() { foreach (NodeUi node in UiManager.GetNodes()) { node.selected = false; node.preSelected = false; } OnSelectionChange.Invoke(box.GetAllSelected()); }
protected override void OnMouseUp(MouseButtonEventArgs e) { base.OnMouseUp(e); if (isSelected) { isSelected = false; } if (Core.IsDragging) { if (isDragging) { onMouseUpTimestamp = e.Timestamp & Int32.MaxValue; isDragging = false; Debug.WriteLine("IsDragging = " + isDragging); Cursor = cursorBefore; Mouse.Capture(null); } Core.EndDrag(); if (BoundsOfMap.HasValue && !BoundsOfMap.Value.Contains(Position)) { if (Core.LastLocationInBounds.HasValue) { Position = Core.LastLocationInBounds.Value; } } } else { if (e.ChangedButton == DragButton) { Core.mouseDown = GPoint.Empty; } if (!selectionEnd.IsEmpty && !selectionStart.IsEmpty) { bool zoomtofit = false; if (!SelectedArea.IsEmpty && Keyboard.Modifiers == ModifierKeys.Shift) { zoomtofit = SetZoomToFitRect(SelectedArea); } OnSelectionChange?.Invoke(SelectedArea, zoomtofit); } else { InvalidateVisual(); } } }
public void ChangeSelection(PlanetNode node) { if (isCursorActive) { currentSelectedNode = node; if (OnSelectionChange != null) { OnSelectionChange.Invoke(node); } UpdateSelectionUI(); } }
/// <summary> /// If your item is within our list, we will set the current item to it. /// </summary> /// <param name="_itemInList"></param> public bool Select(T _itemInList) { if (!items.Contains(_itemInList)) { Debug.LogWarning("Item not set! Unable to find the provided item."); return(false); } ChangeSelection(_itemInList); onSelectionChange?.Invoke(lastSelectedItem, currentItem); return(true); }
public void OnClick(object sender, MouseButtonEventArgs e) { if (e.Button == MouseButton.Left) { _selectedObject = GetNearestObject(GetOnRaycast(GetVisibleObjects())); if (_selectedObject != null) { OnSelectionChange?.Invoke(this, new SelectObjectEventArgs() { SelectedObject = _selectedObject }); } } }
private void changeSelection(PixControl obj) { if (DisableSelection) { return; } radios.ForEach(s => s.Active = false); var radio = obj as IndexedButton; radio.Active = true; Selection = radios.IndexOf(radio); OnSelectionChange?.Invoke(this, new SelectionEventArgs(radio)); }
public override void UpdateSelf(GameTime gameTime) { base.UpdateSelf(gameTime); Browser.Position = new Vector2(0, Navigator.Position.Y + Navigator.Height); Browser.Size = new Vector2(0f, -(Navigator.Position.Y + Navigator.Height)); Viewer.Position = new Vector2(Browser.Width, Navigator.Position.Y + Navigator.Height); Viewer.Size = new Vector2(0, -(Navigator.Position.Y + Navigator.Height)); Inspecter.Position = new Vector2(Browser.Width, Viewer.Height + Navigator.Position.Y + Navigator.Height); var selected = (BrowserTreeDisplayNode)Browser.SelectedElement; var e = (selected == null) ? null : selected.BindingElement; if (_lastFocusElement != e) { OnSelectionChange.Invoke(new UIActionEvent(e, gameTime.TotalGameTime), this); _lastFocusElement = e; } }
public void SelectionChanged(int id) { OnSelectionChange?.Invoke(id); }
public void NotifySelectionChange() { OnSelectionChange.Invoke(new UIActionEvent(_lastFocusElement, Main._drawInterfaceGameTime.TotalGameTime), this); }
/// <summary> /// Adds Listener to Selection-Event /// </summary> /// <param name="listener">Listener to Add</param> public void AddSelectionListener(OnSelectionChange listener) { selectionEvent += listener; // Set initial value listener.Invoke(selectedSpellIndex); }