コード例 #1
0
        public void SetCursor(Item item, bool isServerTransaction)
        {
            var oldValue = _cursor;

            Cursor = item;

            CursorChanged?.Invoke(this, new SlotChangedEventArgs(InventoryId, 0, item, oldValue, isServerTransaction));
        }
コード例 #2
0
ファイル: Inventory.cs プロジェクト: LegacyGamerHD/Alex
        public void SetCursor(Item item, bool clientTransaction)
        {
            var oldValue = _cursor;

            Cursor = item;

            CursorChanged?.Invoke(this, new SlotChangedEventArgs(0, item, oldValue, clientTransaction));
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
        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);
            }
        }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
        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);
        }
コード例 #8
0
ファイル: CanvasControl.cs プロジェクト: cyberjaxx/OpenPDN
 protected virtual void OnCursorChanged()
 {
     CursorChanged?.Invoke(this, EventArgs.Empty);
 }
コード例 #9
0
 private void OnCursorChanged()
 => CursorChanged?.Invoke(this, EventArgs.Empty);
コード例 #10
0
        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));
        }
コード例 #11
0
ファイル: GoogleMarkers.cs プロジェクト: alpozgur/google-maps
 /// <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);
 }
コード例 #12
0
 public void SetCursor(IntPtr cursor, CefCursorType type)
 {
     CursorChanged.SafeInvoke(this, new CursorChangedEventArgs(cursor, type));
 }