public void SetCursor(Item item, bool isServerTransaction) { var oldValue = _cursor; Cursor = item; CursorChanged?.Invoke(this, new SlotChangedEventArgs(InventoryId, 0, item, oldValue, isServerTransaction)); }
public void SetCursor(Item item, bool clientTransaction) { var oldValue = _cursor; Cursor = item; CursorChanged?.Invoke(this, new SlotChangedEventArgs(0, item, oldValue, clientTransaction)); }
public void OnCursorChange(IntPtr cursorPtr, CursorType type, CursorInfo customCursorInfo) { cursor = EncodeCursor(type); // If we're on background, don't flag a cursor change if (!cursorOnBackground) { CursorChanged?.Invoke(this, cursor); } }
/// <summary> /// Creates and initializes a new instance of the Entry class. /// </summary> /// <param name="parent">The EvasObject to which the new Entry will be attached as a child.</param> /// <since_tizen> preview </since_tizen> public Entry(EvasObject parent) : base(parent) { _clicked = new SmartEvent(this, this.RealHandle, "clicked"); _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty); _changedByUser = new SmartEvent(this, this.RealHandle, "changed,user"); _changedByUser.On += (s, e) => ChangedByUser?.Invoke(this, EventArgs.Empty); _cursorChanged = new SmartEvent(this, this.RealHandle, "cursor,changed"); _cursorChanged.On += (s, e) => CursorChanged?.Invoke(this, EventArgs.Empty); _activated = new SmartEvent(this, this.RealHandle, "activated"); _activated.On += (s, e) => Activated?.Invoke(this, EventArgs.Empty); }
public void SetMousePosition(int x, int y) { var alpha = GetAlphaAt(x, y); // We treat 0 alpha as click through - if changed, fire off the event var currentlyOnBackground = alpha == 0; if (currentlyOnBackground != cursorOnBackground) { cursorOnBackground = currentlyOnBackground; // EDGE CASE: if cursor transitions onto alpha:0 _and_ between two native cursor types, I guess this will be a race cond. // Not sure if should have two seperate upstreams for them, or try and prevent the race. consider. CursorChanged?.Invoke(this, currentlyOnBackground ? Cursor.BrowserHostNoCapture : cursor); } }
protected void SetCursor(int i) { if (i >= 0 && i < Items.Count) { MainMenuItem newItem = Items[i]; if (newItem.Enabled) { CurrentItem?.Deselect(); cursor = i; CurrentItem = newItem; CurrentItem.Select(); UpdateHelpText(); } CursorChanged?.Invoke(this); } }
protected void MoveCursor(bool up) { //We do not have any items so we can not change the selected item. if ((Items?.Count ?? 0) <= 0) { return; } CurrentItem?.Deselect(); for (int i = 0; i < Items.Count; i++) { if (up) { cursor--; if (cursor < 0) { cursor = Items.Count - 1; } } else { cursor++; if (cursor >= Items.Count) { cursor = 0; } } CurrentItem = Items[cursor]; if (CurrentItem.Enabled) { CurrentItem.Select(); UpdateHelpText(); break; } } PlaySound(sndBrowse); CursorChanged?.Invoke(this); }
protected virtual void OnCursorChanged() { CursorChanged?.Invoke(this, EventArgs.Empty); }
private void OnCursorChanged() => CursorChanged?.Invoke(this, EventArgs.Empty);
public virtual void OnMouseMove(MouseEventArgs e) { Cursor cursor = Cursors.Arrow; foreach (var item in _items) { if (item.Status == Status.None) { continue; } if (item.Status != Status.None) { if (_isMouseDown) { ////Console.WriteLine($"{e.Location.X},{e.Location.Y};{item.Bound}"); if (item.Status == Status.Resize) { //set mouse /////item.Status = Status.Resize; cursor = Cursors.SizeNWSE; //resize if (_isMouseDown) { var vector = ImageEditor.MeasureVector(_lastMousePoint, e.Location); item.ScaleTo(_lastMousePoint, e.Location); //resize } } else if (item.Status == Status.Pan) { ///item.Status = Status.Pan; cursor = Cursors.SizeAll; if (_isMouseDown) { var vector = ImageEditor.MeasureVector(_lastMousePoint, e.Location); item.Pan(_lastMousePoint, e.Location); //resize } } else if (item.Status == Status.Rotate) { /////item.Status = Status.Rotate; cursor = Cursors.AppStarting; } else { item.Status = Status.Selected; } } else { ////Console.WriteLine($"{e.Location.X},{e.Location.Y};{item.Bound}"); if (item.IsAroundJiao(e.Location)) { //set mouse item.Status = Status.Resize; cursor = Cursors.SizeNWSE; //resize if (_isMouseDown) { var vector = ImageEditor.MeasureVector(_lastMousePoint, e.Location); //resize } } else if (item.IsOnCenter(e.Location)) { item.Status = Status.Pan; cursor = Cursors.SizeAll; if (_isMouseDown) { var vector = ImageEditor.MeasureVector(_lastMousePoint, e.Location); item.Pan(_lastMousePoint, e.Location); //resize } } else if (item.IsOnLineCenter(e.Location)) { item.Status = Status.Rotate; cursor = Cursors.AppStarting; } else { ////item.Status = Status.Selected; } } } } _lastMousePoint = e.Location; CursorChanged?.Invoke(this, new CursorChangedEvenrArgs(cursor)); }
/// <summary> /// Raises the <see cref="E:CursorChanged"/> event. /// </summary> /// <param name="e">The <see cref="MarkerEventArgs"/> instance containing the event data.</param> protected virtual void OnCursorChanged(MarkerEventArgs e) { CursorChanged?.Invoke(this, e); }
public void SetCursor(IntPtr cursor, CefCursorType type) { CursorChanged.SafeInvoke(this, new CursorChangedEventArgs(cursor, type)); }