private void FireOnSelect(ArcadeDisk disk, Mod mod) { if (OnSelect != null) { OnSelect.Invoke(this, new DiskSelectEventArgs(disk, mod)); } }
public void Update(float diff) { bool stopDrag = dragging && !inputManager.Mouse.IsMouseDown(MouseButton.Left); dragging = dragging && inputManager.Mouse.IsMouseDown(MouseButton.Left); if (stopDrag) { var min = new Vector2(Math.Min(startDragPositionNormalized.X, currentDragPositionNormalized.X), Math.Min(startDragPositionNormalized.Y, currentDragPositionNormalized.Y)); var max = new Vector2(Math.Max(startDragPositionNormalized.X, currentDragPositionNormalized.X), Math.Max(startDragPositionNormalized.Y, currentDragPositionNormalized.Y)); OnSelect?.Invoke(min, max); } if (inputManager.Mouse.HasJustClicked(MouseButton.Left) && inputManager.Keyboard.IsDown(Key.LeftShift)) { startDragPosition = inputManager.Mouse.ScreenPoint; startDragPositionNormalized = inputManager.Mouse.NormalizedPosition; dragging = true; } if (dragging) { currentDragPosition = inputManager.Mouse.ScreenPoint; currentDragPositionNormalized = inputManager.Mouse.NormalizedPosition; } }
private void BuildLayout() { var main = new StackLayout(); main.Spacing = 0; main.BackgroundColor = Color.White; var rl = new RelativeLayout(); rl.Children.Add(main, Constraint.Constant(0), Constraint.Constant(0), Constraint.RelativeToParent(p => p.Width), Constraint.RelativeToParent(p => p.Height)); Content = rl; BuildHeader(main, "Where + When"); BuildLocationLayout(main); BuildTimeLayout(main); var btn = UIUtils.MakeButton("CONFIRM", UIUtils.FONT_SFUIDISPLAY_MEDIUM); btn.VerticalOptions = LayoutOptions.EndAndExpand; btn.Clicked += (o, a) => { this.Navigation.PopAsync(); OnSelect?.Invoke(this, EventArgs.Empty); }; main.Children.Add(btn); }
public TreeViewController(MultiselectTreeView treeView) { this.treeView = treeView; treeView.BeforeExpand += (s, e) => { if (updating) { return; } e.Cancel = true; OnExpand?.Invoke(Map(e.Node)); }; treeView.BeforeCollapse += (s, e) => { if (updating) { return; } e.Cancel = true; OnCollapse?.Invoke(Map(e.Node)); }; treeView.BeforeMultiSelect += (s, e) => { if (updating) { return; } e.Cancel = true; OnSelect?.Invoke(e.Nodes.OfType <ViewNode>().Select(n => n.Node).ToArray()); }; }
/// <summary> /// Clears the current selected. /// </summary> private void ClearSelected() { selectedControllableUnits.ForEach(unit => unit.SetSelected(false)); selectedControllableUnits = Enumerable.Empty <Unit>(); SetLastSelected(null); OnSelect?.Invoke(null); }
public void Select(IOption <T>?o, bool update = true) { if (o == null || _selectedSet.Contains(o.Value)) { return; } _combobox.Deselect(); // o.Selected = true; _selected.Add(o); _selectedSet.Add(o.Value); // o.Disabled = true; // InvalidateOptions(); // _options.Invalidate(); // _combobox.InvalidateOptions(); // _combobox.Deselect(false); _stateHasChanged.Invoke(); if (update) { OnSelect?.Invoke(_selected); } }
protected override void OnObjectSelect() { IsOn = isSelected; base.OnObjectSelect(); onSelect?.Invoke(); OnSelect?.Invoke(); }
public override void OnMouseDown(MouseButton button, int x, int y) { if (ScrollThumbRect.Translated(0, TranslateY).Contains(x, y)) { _scrolling = true; _lastMouseY = y; } else { if (HoveredIndex > -1) { if (HoveredIndex == SelectedIndex) { SelectedIndex = -1; } else { SelectedIndex = HoveredIndex; SelectedItem = Items[SelectedIndex]; OnSelect?.Invoke(SelectedItem); } } } }
protected void OnCarbolistItemClick(object target, EventArgs e) { CarbolistItem item = ((Button)target).Parent as CarbolistItem; if (item == SelectedItem) { if (CanDeselect) { item.Selected = false; SelectedItem = null; } } else { if (SelectedItem != null) { SelectedItem.Selected = false; } item.Selected = true; SelectedItem = item; } // callback event listener OnSelect?.Invoke(item); }
internal override void Handle(DiscordSocketClient client, DiscordInteraction interaction) { if (OnSelect != null) { Task.Run(() => OnSelect.Invoke(this, new FormSelectMenuEventArgs(client, interaction))); } }
protected override void KeyboardInput(InputEventArgs <TInput> args) { var key = args.Input; if (KeyboardAdapter.IsUp(key)) { _unselectedItemIndex = _selectedItemIndex; _selectedItemIndex--; if (_selectedItemIndex < 0) { _selectedItemIndex = _items.Count - 1; } OnSelectionChanged?.Invoke(this, _items[_unselectedItemIndex.Value], _items[_selectedItemIndex]); } else if (KeyboardAdapter.IsDown(key)) { _unselectedItemIndex = _selectedItemIndex; _selectedItemIndex++; if (_selectedItemIndex >= _items.Count) { _selectedItemIndex = 0; } OnSelectionChanged?.Invoke(this, _items[_unselectedItemIndex.Value], _items[_selectedItemIndex]); } else if (KeyboardAdapter.IsEnter(key)) { OnSelect?.Invoke(this, _items[_selectedItemIndex]); } }
protected override void ItemSelected(AdvancedDropdownItem item) { if (item is ProductDropdownItem productItem) { OnSelect?.Invoke(productItem.Product); } }
private void Container_MouseDown(object sender, MouseButtonEventArgs e) { //assign the node as a mask if possible if (UINodePoint.SelectOrigin != null) { var point = UINodePoint.SelectOrigin; if (point.Output != null && Item != null) { Item.Mask = point.Output.Node; MaskRemoveButton.Visibility = Visibility.Visible; Item.ParentGraph?.CombineLayers(); } } else { moveX = 0; moveY = 0; moveStart = e.GetPosition(this); moveDown = true; OnSelect?.Invoke(this); if (state == LayerItemState.None) { State = LayerItemState.Selected; } else if (state == LayerItemState.Viewing) { State = LayerItemState.SelectedViewing; } } }
public void Select(SelectableInputEventArgs args) { if (!_isSelectable) { return; } OnSelect?.Invoke(args); }
public void Select() { if (isHidden && !isTurning) { TurnArround(); OnSelect.Invoke(this); } }
public void OnMouseDown() { if (EventSystem.current.IsPointerOverGameObject()) { return; } OnSelect?.Invoke(this, new EventArgs()); }
private void ChangeSelected(T selected) { if (Selected == selected) { return; } Selected = selected; OnSelect?.Invoke(); }
public void Deselect(bool update = true) { _selected = null; if (update) { OnSelect?.Invoke(null); } }
private void SelectCard(object card) { UnselectAllCards(); Select(card as TV_Card); if (OnSelect != null) { OnSelect.Invoke(card as TV_Card); } }
protected void Dropdown_Click(object sender, EventArgs e) { int Idx = int.Parse(((Button)sender).CommandName); DropdownEntry Entry = Entries[Idx]; OnSelect?.Invoke(Entry); Entry.OnClick?.Invoke(); }
public void SetScript(BattleCardScript script) { BattleCardScript = script; BattleCardScript.OnSelectCard += delegate { OnSelect?.Invoke(this); }; }
internal override void Request() { OnSelect?.Invoke(this, new EventArgs()); foreach (PluginItem it in Items.Values) { Plugin.addDirectoryItem(Convert.ToInt32(Sys.argv[1]), Sys.argv[0], it); } Plugin.endOfDirectory(Convert.ToInt32(Sys.argv[1])); }
public ISelectable Select(object source) { if (Highlight != null) { Highlight.SetActive(true); } OnSelect?.Invoke(); return(this); }
void Setup(GpioPin portX, GpioPin portY, GpioPin portA, GpioPin portB, GpioPin portSelect, GpioPin portJoyHorizontal, GpioPin portJoyVertical) { ButtonA.PressEnded += (s, e) => OnA?.Invoke(s, e); ButtonB.PressEnded += (s, e) => OnB?.Invoke(s, e); ButtonX.PressEnded += (s, e) => OnX?.Invoke(s, e); ButtonY.PressEnded += (s, e) => OnY?.Invoke(s, e); ButtonSelect.PressEnded += (s, e) => OnSelect?.Invoke(s, e); }
private void btn_Click(object sender, RoutedEventArgs e) { MapButton btn = (MapButton)sender; if (OnSelect != null) { OnSelect.Invoke(btn.X, btn.Y); } }
void IPostBackEventHandler.RaisePostBackEvent(string eventArgument) { IdLider = Convert.ToInt32(eventArgument); // Verifica se existe algum Evento relacionado if (OnSelect != null) { OnSelect.Invoke(this, new EventArgs()); } }
private void DoSelect(SkillKindId skillId) { if (_selected == skillId) { return; } OnSelect?.Invoke(_wordIdx, skillId); _selected = skillId; UpdateSelected(); }
public void Select(GameObject obj) { if (_selectedObject != null) { // Deselect(); } _selectedObject = obj; OnSelect.Invoke(obj); }
// It is okay for Select() and similar methods to invoke immediately since the invocation methods only alter // visual states. In fact, because they modify the queue, they should not be queued unless a queue swap clone // is made. And even in that case, the swap queue would need to be invoked immediately after the regular // queue. public void Select() { parent.Active = true; /* * if (OnSelect != null) * parent.Scene.QueueMethod(OnSelect, parent); */ OnSelect?.Invoke(parent); }
private void ActiveCheck_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) { if (activeCheck.IsChecked != null && activeCheck.IsChecked.Value) { OnSelect?.Invoke(Region, Realm); } else { OnUnselect?.Invoke(Region, Realm); } }