Esempio n. 1
0
 public void OnRrfresh()
 {
     if (this.data == null)
     {
         return;
     }
     unitUIEventArgs = this.data as MouseClickEventArgs;
     if (Unit == unitUIEventArgs.dataGameobject || unitUIEventArgs.dataGameobject == null)
     {
         return;
     }
     Unit             = unitUIEventArgs.dataGameobject;
     unitUIData       = UIManager.Instance.GetUnitUIData(unitUIEventArgs.dataGameobject.tag);
     txtUnitName.text = unitUIData.unit_UIName;
     unit_Icon.url    = "ui://UI/" + unitUIData.unit_Icon;
     txtUnitInf.text  = "        " + unitUIData.unit_UIInf;
     string[] icon = unitUIData.unit_ProdIcon.Split(',');
     string[, ] name = new string[icon.Length, 2];
     for (int i = 0; i < icon.Length; ++i)
     {
         name[i, 0] = icon[i].Split('|')[0];
         name[i, 1] = icon[i].Split('|')[1];
     }
     listProducting.numItems = icon.Length;
     for (int i = 0; i < icon.Length; i++)
     {
         GComponent gComponent = listProducting.GetChildAt(i).asCom;
         gComponent.data = new ComponentData(name[i, 0], unitUIEventArgs.dataGameobject, Convert.ToBoolean(Convert.ToInt32(name[i, 1])));
     }
 }
Esempio n. 2
0
        private async void FileSave_Click(object sender, MouseClickEventArgs e)
        {
            if (string.IsNullOrEmpty(this._CurrentFileName))
            {
                SaveFileDialog sfd = new SaveFileDialog
                {
                    Title              = "Save file as...",
                    Filter             = "All Files(*.*)\0*.*\0Text(*.txt)\0*.txt\0",
                    DefaultFilterIndex = 2
                };
                if (sfd.Show(this))
                {
                    this._CurrentFileName = sfd.File;
                    string text = this._TextBox.Text;

                    await File.WriteAllTextAsync(this._CurrentFileName, text);

                    this.Text = "Little Edit:" + this._CurrentFileName;
                }
            }
            else
            {
                string text = this._TextBox.Text;
                File.WriteAllText(this._CurrentFileName, text);
                this.Text = "Little Edit:" + this._CurrentFileName;
            }
        }
Esempio n. 3
0
        private void onMouseClicked(MouseClickEventArgs args)
        {
            var dragHandle = _dragHandle;

            if (args.Button != MouseButton.Left || dragHandle == null)
            {
                return;
            }
            const long millis = 300;

            if (args.ClickTimeInMilliseconds > millis && dragHandle.LastDragged > DateTime.Now.AddMilliseconds(-millis))
            {
                //Checking against "false alarms" -> the user meant to do a quick drag of the object, not to change between scale/rotate handles
                return;
            }
            _resizeVisible = !_resizeVisible;
            foreach (var handle in _resizeHandles)
            {
                handle.SetVisible(_resizeVisible);
            }
            foreach (var handle in _rotateHandles)
            {
                handle.SetVisible(!_resizeVisible);
            }
        }
Esempio n. 4
0
 protected override void MouseDownEvent(MouseClickEventArgs args)
 {
     if (Start != null && args.Button == MouseButton.Left)
     {
         AudioStateGraphEditor editor = Start.FindInParents <AudioStateGraphEditor>();
         if (editor != null)
         {
             if (args.Ctrl)
             {
                 if (this.IsSelected)
                 {
                     editor.Selection.Remove(this);
                 }
                 else
                 {
                     editor.Selection.Add(this);
                 }
             }
             else if (args.Shift)
             {
                 if (!this.IsSelected)
                 {
                     editor.Selection.Add(this);
                 }
             }
             else
             {
                 editor.Selection.Select(this);
             }
             args.Handled = true;
         }
     }
     base.MouseDownEvent(args);
 }
Esempio n. 5
0
 public void HandleMouseClick(MouseClickEventArgs e)
 {
     if (MouseClick != null)
     {
         MouseClick.Invoke(this, e);
     }
 }
Esempio n. 6
0
 protected override void MouseDownEvent(MouseClickEventArgs args)
 {
     if (args.Button == MouseButton.Left)
     {
         GraphEditor editor = _Item.FindInParents <GraphEditor>();
         if (editor != null)
         {
             if (args.Ctrl)
             {
                 if (_Item.IsSelected)
                 {
                     editor.Selection.Remove(_Item);
                 }
                 else
                 {
                     editor.Selection.Add(_Item);
                 }
             }
             else if (args.Shift)
             {
                 if (!_Item.IsSelected)
                 {
                     editor.Selection.Add(_Item);
                 }
             }
             else
             {
                 editor.Selection.Select(_Item);
             }
         }
     }
     base.MouseDownEvent(args);
 }
Esempio n. 7
0
        public override void ClickRightMouseEvent(object sender, GameEventArgs e)
        {
            if (!IsSelected || !IsPlayerCamp)
            {
                return;
            }
            MouseClickEventArgs m = e as MouseClickEventArgs;

            if (m.dataGameobject.layer == 11)
            {
                MoveToTarget(m.ClickPosition);
            }
            else if (m.dataGameobject.layer == EnemyLayer)
            {
                enemyDetection.SetPlayerSelectEnemy(m.dataGameobject);
                float distance = Vector3.Distance(gameObject.transform.position, m.dataGameobject.transform.position);
                if (distance > StopToAttackDistance)
                {
                    MoveToTarget(m.dataGameobject.transform.position, true, distance, StopToAttackDistance);
                }
                else
                {
                    navMeshAgent.enabled = false;
                    IsMove = false;
                }
            }
        }
Esempio n. 8
0
 protected virtual void OnClick(MouseClickEventArgs e)
 {
     if (MouseClick != null)
     {
         MouseClick(this, e);
     }
 }
Esempio n. 9
0
 private void OnJoinMouseClick(object sender, MouseClickEventArgs e)
 {
     if (box[0].Text().Length > 0 && box[1].Text().Length > 0 && box[2].Text().Length > 0)
     {
         name = box[1].Text();
         try
         {
             port = Convert.ToInt32(box[0].Text());
             joinButton.MouseClick -= OnJoinMouseClick;
             box[0].IsSelect        = false;
             box[1].IsSelect        = false;
             box[2].IsSelect        = false;
             IsJoin = true;
             box.Add(new TextBox(new Vector2(Bounds.X + 20, box[2].Bound.Bottom + 10), 20, 10,
                                 TexturesManager.Menu, Color.Blue, Color.Red));
             client = new Client(name);
             client.Connect(box[2].Text(), port);
             client.SendData();
             client.StartReadThread();
             //client.StartWaitStart();
         }
         catch (Exception)
         {
             box[0].RemoveAll();
         }
     }
 }
Esempio n. 10
0
    private void MouseButtonPressed(MouseClickEventArgs e)
    {
        if (e.buttonType == ButtonType.LeftButton && e.buttonEventType == ButtonEventType.Down)
        {
            dragLocationStart = e.screenPosition;
        }
        else if (e.buttonType == ButtonType.LeftButton && e.buttonEventType == ButtonEventType.Holding)
        {
            dragLocationEnd = e.screenPosition;
        }
        else if (e.buttonType == ButtonType.LeftButton && e.buttonEventType == ButtonEventType.Up)
        {
            dragLocationStart = Vector2.zero;
            dragLocationEnd   = Vector2.zero;
        }


        if (Mathf.Abs(dragLocationStart.x - dragLocationEnd.x) > threshold || Mathf.Abs(dragLocationStart.y - dragLocationEnd.y) > threshold)
        {
            if (dragLocationEnd != Vector2.zero)
            {
                isDragging = true;
            }
        }
        else
        {
            isDragging = false;
        }
    }
Esempio n. 11
0
 private void OnCreateMouseClick(object sender, MouseClickEventArgs e)
 {
     if (box[0].Text().Length > 0 && box[1].Text().Length > 0)
     {
         name = box[1].Text();
         try
         {
             port = Convert.ToInt32(box[0].Text());
             StartButton.MouseClick  += OnStartMouseClick;
             createButton.MouseClick -= OnCreateMouseClick;
             isCreate        = true;
             box[0].IsSelect = false;
             box[1].IsSelect = false;
             serveur         = new Serveur("test", port, 100);
             serveur.Start();
             localClient = new Client(name, true);
             localClient.Connect("127.0.0.1", port);
             localClient.SendData();
             localClient.StartReadThread();
             //localClient.StartWaitStart();
             box.Add(new TextBox(new Vector2(Bounds.X + 20, box[0].Bound.Bottom + 10), 20, 10,
                                 TexturesManager.Menu, Color.Blue, Color.Red));
         }
         catch (Exception)
         {
             box[0].RemoveAll();
         }
     }
 }
Esempio n. 12
0
 private void Window1_DblClick(object sender, MouseClickEventArgs e)
 {
     Window2 win2 = new Window2(this);
     //this.Controls.Add(win2);
     win2.Show();
     MessageBox.Show("Nach Show");
 }
        public override Boolean OnInput(MouseClickEventArgs args)
        {
            base.OnInput(args);

            IsChecked = !IsChecked;
            return(true);
        }
Esempio n. 14
0
 private void ManagerMouse_MouseClickEventHandler(object sender, MouseClickEventArgs e)
 {
     if (selected)
     {
         target = new Point(e.XTile, e.YTile);
     }
 }
        public override void ClickRightMouseEvent(object sender, GameEventArgs e)
        {
            base.ClickRightMouseEvent(sender, e);
            if (!IsSelected || IsOnBuilding)
            {
                return;
            }
            MouseClickEventArgs m = e as MouseClickEventArgs;

            if (m.dataGameobject.layer == 11)
            {
                _navMeshAgent.enabled = false;
                _FSMSystemManager.ControlStateTransition(StateID.Move);
                Vector3 pos = CrowdBehaviorManager.Instance.GetBattle_FormationPos();
                Debug.Log(pos);
                moveState.SetMoveTargetPos(m.ClickPosition);
            }
            else if (m.dataGameobject.tag == "Mine")
            {
                _navMeshAgent.enabled    = false;
                miningState.MinePosition = m.dataGameobject.transform.position;
                _FSMSystemManager.ControlStateTransition(StateID.Mining);
                harvesterState = HarvesterState.mine;
            }
        }
Esempio n. 16
0
        private async void FileOpen_Click(object sender, MouseClickEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog
            {
                Title              = "Open a Text File...",
                Filter             = "All File(*.*)\0*.*\0Text(*.txt)\0*.txt\0",
                DefaultFilterIndex = 2
            };

            //Title of the Dialog

            //All Values have to be separated with \0

            //Shows Text(*.txt) as default

            //Show the Dialog modal to the current Form.
            if (ofd.Show(this))
            {
                this._TextBox.Enabled = false;
                //Read the selected Path
                string fileName = ofd.File;
                //File Actions.
                string text = await File.ReadAllTextAsync(fileName);

                this._CurrentFileName = fileName;
                this._TextBox.Text    = text;
                this._TextBox.Enabled = true;
                this.Text             = "Little Edit:" + fileName;
            }
        }
Esempio n. 17
0
        private void MouseClicked(object o, MouseClickEventArgs e)
        {
            player.holdingBall = false;
            if (player.canShoot)
            {
                GameEvent(GameEventEnum.SHOOT);
                listOfLasers.Add(new Laser(new Rectangle(paddle.position.Center.X, paddle.position.Y - 20, 4, 15)));
            }

            if (showScoreboard)
            {
                if (option != 0)
                {
                    showScoreboard = false;
                }
                if (option == 1)
                {
                    game.ShowGameMode();
                }
                if (option == 2)
                {
                    game.ShowMainMenu();
                }
            }
        }
Esempio n. 18
0
 /// <summary>
 /// MouseDownEvent
 /// </summary>
 /// <param name="args">args</param>
 protected override void MouseDownEvent(MouseClickEventArgs args)
 {
     if (args.Button == MouseButton.Left)
     {
         Frame of = OwnerFrame;
         if (of != null)
         {
             _IsMouseDown    = OwnerFrame.RegisterPrecedenceEvent(this);
             _StartSelection = _EndSelection = args.MousePosition;
             _DeltaSelection = Vector2.zero;
             _Shift          = args.Shift;
             _KeepKeysSelected.Clear();
             if (!_Shift)
             {
                 _Selection.Clear();
             }
             else
             {
                 foreach (var ki in _Selection)
                 {
                     _KeepKeysSelected.Add(ki);
                 }
             }
             args.Handled = true;
         }
     }
     base.MouseDownEvent(args);
 }
Esempio n. 19
0
 /// <summary>
 /// Occurs when mouse button was released.(if WantsMouseEvents = true)
 /// </summary>
 /// <param name="args"> MouseClickEventArgs </param>
 protected override void MouseUpEvent(MouseClickEventArgs args)
 {
     if (args.Button == MouseButton.Left)
     {
         _IsMouseDown = false;
     }
     base.MouseUpEvent(args);
 }
Esempio n. 20
0
 protected override void MouseDownEvent(MouseClickEventArgs args)
 {
     if (args.Button == MouseButton.Left)
     {
         OnClick();
     }
     base.MouseDownEvent(args);
 }
Esempio n. 21
0
 public void Notify(object sender, MouseClickEventArgs args)
 {
     if (Rectangle.Intersects(new Rectangle((int)args.ClickPosition.X, (int)args.ClickPosition.Y, 1, 1)))
     {
         // TODO: Make a button for many clicks.
         MouseClickDetector.LeftButtonDown -= Notify;
         Click?.Invoke();
     }
 }
Esempio n. 22
0
 /// <summary>
 /// MouseDownEvent
 /// </summary>
 /// <param name="args">args</param>
 protected override void MouseDownEvent(MouseClickEventArgs args)
 {
     if (args.Button == MouseButton.Left && args.Ctrl)
     {
         _IsMouseDown = true;
         _DeltaX      = 0;
         _StartTime   = OwnerEvent.FireTime;
     }
     base.MouseDownEvent(args);
 }
 /// <inheritdoc />
 protected override void OnClick(object sender, MouseClickEventArgs e)
 {
     base.OnClick(sender, e);
     if (Checked)
     {
         return;
     }
     UncheckNeighbors();
     Checked = true;
 }
Esempio n. 24
0
        protected override void OnMouseClick(MouseEventArgs e)
        {
            base.OnMouseClick(e);

            if (null != MouseClickEvent)
            {
                MouseClickEventArgs args = new MouseClickEventArgs();
                args.ScreenLocation = PointToScreen(e.Location);
                MouseClickEvent(this, args);
            }
        }
Esempio n. 25
0
        public override void Click(MouseClickEventArgs e)
        {
            if (!displayRectangle.Contains(e.location))
            {
                return;
            }

            check = !check;

            OnClickHandler(e);
        }
Esempio n. 26
0
        /// <summary>
        /// MouseDownEvent
        /// </summary>
        /// <param name="args">args</param>
        protected override void MouseDownEvent(MouseClickEventArgs args)
        {
            if (args.Button == MouseButton.Left)
            {
                if (Contains(args.MousePosition))
                {
                    if (OwnerFrame.RegisterPrecedenceEvent(this))
                    {
                        _MouseButton = MouseButton.Left;
                    }
                    TimeLine.TimePosition = GetTime(args.MousePosition.x);
                    args.Handled          = true;
                }
                else
                {
                    if (_MouseButton != MouseButton.None)
                    {
                        OwnerFrame.UnregisterPrecedenceEvent(this);
                    }
                    _MouseButton = MouseButton.None;
                }
            }
            else if (args.Button == MouseButton.Right)
            {
                if (Contains(args.MousePosition))
                {
                    double time = GetTime(args.MousePosition.x);
                    if (args.Shift && TimeLine.SelectionLenght > 0)
                    {
                        AddTime(time);
                    }
                    else
                    {
                        _StartSelectionTime = time;
                        TimeLine.SelectTime(time, time);
                    }
                    if (OwnerFrame.RegisterPrecedenceEvent(this))
                    {
                        _MouseButton = MouseButton.Right;
                    }
                    args.Handled = true;
                }
                else
                {
                    if (_MouseButton != MouseButton.None)
                    {
                        OwnerFrame.UnregisterPrecedenceEvent(this);
                    }
                    _MouseButton = MouseButton.None;
                }
            }

            base.MouseDownEvent(args);
        }
Esempio n. 27
0
        /// <summary>Invokes the onClick event</summary>
        /// <param name="e">The Mouse Click Event Args of the event</param>
        protected void OnClickHandler(MouseClickEventArgs e)
        {
            if (timeSinceLastClick.TotalSeconds <= TIME_FOR_DOUBLE_CLICK_IN_SECONDS)
            {
                DoubleClick(e);
            }

            onClick?.Invoke(this, e);

            timeSinceLastClick = TimeSpan.Zero;
        }
Esempio n. 28
0
 public void OnInfoPlayerMouseClick(object sender, MouseClickEventArgs e)
 {
     showInfoWindow.IsOpened = !showInfoWindow.IsOpened;
     if (showInfoWindow.IsOpened)
     {
         Parent.Windows.Add(showInfoWindow);
     }
     else
     {
         Parent.Windows.Remove(showInfoWindow);
     }
 }
Esempio n. 29
0
 /// <summary>
 /// Occurs when mouse button was released.(if WantsMouseEvents = true)
 /// </summary>
 /// <param name="args"> MouseClickEventArgs </param>
 protected override void MouseUpEvent(MouseClickEventArgs args)
 {
     if (args.Button == _MouseButton)
     {
         if (_MouseButton != MouseButton.None)
         {
             OwnerFrame.UnregisterPrecedenceEvent(this);
         }
         _MouseButton = MouseButton.None;
         args.Handled = true;
     }
     base.MouseUpEvent(args);
 }
Esempio n. 30
0
 private void OnResolutionMouseClick(object sender, MouseClickEventArgs e)
 {
     //    if (MainGame.ScreenX != 1024)
     //    {
     //        MainGame.GetInstance().graphics.IsFullScreen = false;
     //        MainGame.SetGraphics(1024, 768);
     //    }
     //    else
     //    {
     //        MainGame.GetInstance().graphics.IsFullScreen = true;
     //        MainGame.SetGraphics(MainGame.GetInstance().graphics.GraphicsDevice.DisplayMode.Width, MainGame.GetInstance().graphics.GraphicsDevice.DisplayMode.Height);
     //    }
 }
Esempio n. 31
0
 /// <summary>
 /// The 'done' button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 public virtual void OnDoneButtonClick(object obj, MouseClickEventArgs e)
 {
     //If an animation has been selected for loading, invoke the event.
     if (_Textbox.Text != null) { AnimationSavedInvoke(_Textbox.Text); }
     //Invoke the dispose event.
     DisposeInvoke();
 }
Esempio n. 32
0
 /// <summary>
 /// The 'done' button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 public virtual void OnDoneButtonClick(object obj, MouseClickEventArgs e)
 {
     //Invoke the sprite picked event.
     SpritePickedInvoke(_Picturebox.Name, CalculateSpriteOrigin(), CalculateSpriteEnd());
     //Invoke the dispose event.
     DisposeInvoke();
 }
Esempio n. 33
0
        /// <summary>
        /// The label has been clicked.
        /// </summary>
        /// <param name="obj">The object that fired the event.</param>
        /// <param name="e">The event's arguments.</param>
        private void OnLabelClick(object obj, MouseClickEventArgs e)
        {
            //Bring the list to front.
            _List.DrawOrder = 0;

            //Request a change in focus.
            _GUI.RequestFocus(_List);
        }
Esempio n. 34
0
        /// <summary>
        /// The picturebox has been clicked.
        /// </summary>
        /// <param name="obj">The object that fired the event.</param>
        /// <param name="e">The event's arguments.</param>
        private void OnPictureboxClick(object obj, MouseClickEventArgs e)
        {
            //If the left button was pressed, update the origin.
            if (e.Button == MouseButton.Left)
            {
                _StartPosition = e.Position;
                _BoneSprite[0].Origin = CalculateSpriteOrigin();
            }
            //If the right button was pressed, update the end position.
            else if (e.Button == MouseButton.Right)
            {
                _EndPosition = e.Position;
                _BoneSprite.RotationOffset = Helper.CalculateRotationOffset(CalculateSpriteOrigin(), CalculateSpriteEnd());
            }

            //Update the bone length.
            _Bone.Length = Vector2.Distance(CalculateSpriteOrigin(), CalculateSpriteEnd());
        }
Esempio n. 35
0
 /// <summary>
 /// When the button has been pressed, check the checkbox.
 /// </summary>
 /// <param name="obj">The object whose bounds changed.</param>
 /// <param name="e">The event arguments.</param>
 private void OnButtonClicked(object obj, MouseClickEventArgs e)
 {
     //Tick the checkbox.
     CheckboxTickedInvoke(!_IsChecked);
 }
Esempio n. 36
0
 /// <summary>
 /// The 'add sprite' button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnAddSpriteButtonClick(object obj, MouseClickEventArgs e)
 {
     //Display a sprite dialog.
     GUI.AddItem(new SpriteDialog(GUI, new Vector2(350, 150), 500, 400));
     (GUI.LastItem as SpriteDialog).LoadContent();
     //Subscribe to some events.
     (GUI.LastItem as SpriteDialog).SpritePicked += OnSpritePicked;
 }
Esempio n. 37
0
 /// <summary>
 /// The 'close' button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnCloseButtonClick(object obj, MouseClickEventArgs e)
 {
     //Invoke the bone created event.
     BoneEditedInvoke();
     //Invoke the dispose event.
     DisposeInvoke();
 }
Esempio n. 38
0
 /// <summary>
 /// The picturebox has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnPictureboxClick(object obj, MouseClickEventArgs e)
 {
     //If the left button was pressed, update the origin.
     if (e.Button == MouseButton.Left) { _StartPosition = e.Position; }
     //If the right button was pressed, update the end position.
     else if (e.Button == MouseButton.Right) { _EndPosition = e.Position; }
 }
Esempio n. 39
0
 /// <summary>
 /// The 'done' button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 public virtual void OnDoneButtonClick(object obj, MouseClickEventArgs e)
 {
     //If an animation hasbeen selected for loading, invoke the event.
     if (_SelectedIndex != -1) { AnimationLoadedInvoke(_Animations[_SelectedIndex]); }
     //Invoke the dispose event.
     DisposeInvoke();
 }
Esempio n. 40
0
 /// <summary>
 /// The backward button has been held down by the mouse.
 /// </summary>
 /// <param name="obj">The object that fired this event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnBackwardDown(object obj, MouseClickEventArgs e)
 {
     //Scroll backward a bit.
     ValueChangeInvoke(_Value - 1);
 }
 /// <summary>
 /// An item of this GUI has been clicked on, deal with it.
 /// </summary>
 /// <param name="obj">The object that fired this event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnItemClick(object obj, MouseClickEventArgs e)
 {
     //Invoke the appropriate event.
     ItemClickedInvoke(e.Position, e.Button);
 }
Esempio n. 42
0
        /// <summary>
        /// The thumb button has been held down by the mouse.
        /// </summary>
        /// <param name="obj">The object that fired this event.</param>
        /// <param name="e">The event's arguments.</param>
        private void OnThumbDown(object obj, MouseClickEventArgs e)
        {
            //The thumb is down.
            _IsThumbDown = true;

            //Check the scroller type and set the correct value.
            if (_Type == ScrollerType.Horizontal) { ValueChangeInvoke(((e.Position.X - (Position.X + 25)) / (Width - 50)) * 100); }
            else { ValueChangeInvoke(((e.Position.Y - (Position.Y + 25)) / (Height - 50)) * 100); }
        }
Esempio n. 43
0
 /// <summary>
 /// A tab has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnTabClick(object obj, MouseClickEventArgs e)
 {
     //Select the tab's item.
     TabSelectInvoke((TabPage)obj);
 }
Esempio n. 44
0
        /// <summary>
        /// If the node's button has been clicked, either expand or collapse its list of children.
        /// </summary>
        /// <param name="obj">The object that fired the event.</param>
        /// <param name="e">The event arguments.</param>
        private void OnButtonMouseClick(object obj, MouseClickEventArgs e)
        {
            //Change the sprite of the button.
            if (_Button.Sprite[0].CurrentFrameIndex < (_Button.Sprite[0].Frames.Count - 1)) { _Button.Sprite[0].IncrementFrameIndex(); }
            else { _Button.Sprite[0].CurrentFrameIndex = 0; }

            //Change the NodeState.
            if (_NodeState == TreeNodeState.Collapsed) { NodeStateChangedInvoke(TreeNodeState.Expanded); }
            else { NodeStateChangedInvoke(TreeNodeState.Collapsed); }
        }
Esempio n. 45
0
 /// <summary>
 /// This tab page's button has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 protected void OnButtonClick(object obj, MouseClickEventArgs e)
 {
     //Invoke the tab page's mouse click method.
     MouseClickInvoke(e.Position, e.Button);
 }
Esempio n. 46
0
 /// <summary>
 /// A menu item has been clicked on by a mouse.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event arguments.</param>
 private void OnMenuItemClick(object obj, MouseClickEventArgs e)
 {
     //Save the clicked node as the selected node.
     MenuItemSelectInvoke(obj as MenuItem);
 }
Esempio n. 47
0
 /// <summary>
 /// The forward button has been held down by the mouse.
 /// </summary>
 /// <param name="obj">The object that fired this event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnForwardDown(object obj, MouseClickEventArgs e)
 {
     //Scroll forward a bit.
     ValueChangeInvoke(_Value + 1);
 }
Esempio n. 48
0
 /// <summary>
 /// The 'done' button has been clicked, close the form.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 public virtual void OnDoneButtonClick(object obj, MouseClickEventArgs e)
 {
     Close();
 }
Esempio n. 49
0
 /// <summary>
 /// A node has been clicked on by a mouse.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event arguments.</param>
 private void OnChildNodeMouseClick(object obj, MouseClickEventArgs e)
 {
     //Save the clicked node as the selected node.
     _SelectedNode = (obj as TreeNode);
 }
Esempio n. 50
0
 /// <summary>
 /// The header has been clicked.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event's arguments.</param>
 private void OnHeaderClick(object obj, MouseClickEventArgs e)
 {
     //Either expand or contract the control.
     SwitchState();
 }
Esempio n. 51
0
 /// <summary>
 /// The play button has been clicked on by a mouse.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event arguments.</param>
 private void OnPlayButtonClick(object obj, MouseClickEventArgs e)
 {
     //Either turn on or off the animation.
     PlayStateChangeInvoke(!_IsPlaying);
 }
Esempio n. 52
0
 /// <summary>
 /// An item has been clicked on by a mouse.
 /// </summary>
 /// <param name="obj">The object that fired the event.</param>
 /// <param name="e">The event arguments.</param>
 protected virtual void OnItemClick(object obj, MouseClickEventArgs e)
 {
     //Save the clicked node as the selected node.
     ItemSelectInvoke(obj as ListItem);
 }