Exemplo n.º 1
0
		public override void RightMouseUp (NSEvent theEvent)
		{
			base.RightMouseUp (theEvent);
			var p = ConvertPointFromView (theEvent.LocationInWindow, null);
			ButtonEventArgs args = new ButtonEventArgs ();
			args.X = p.X;
			args.Y = p.Y;
			args.Button = PointerButton.Right;
			context.InvokeUserCode (delegate {
				eventSink.OnButtonReleased (args);
			});
		}
Exemplo n.º 2
0
 void HandleWiiremoteButtonReleased(object sender, ButtonEventArgs args)
 {
     LayoutRoot.Dispatcher.BeginInvoke(()=>{
         WiiKey.Text = "";
     });
 }
Exemplo n.º 3
0
		public override void MouseDown (NSEvent theEvent)
		{
			var p = ConvertPointFromView (theEvent.LocationInWindow, null);
			ButtonEventArgs args = new ButtonEventArgs ();
			args.X = p.X;
			args.Y = p.Y;
			args.Button = PointerButton.Left;
			context.InvokeUserCode (delegate {
				eventSink.OnButtonPressed (args);
			});
		}
Exemplo n.º 4
0
 private void OnButtonStateChanged(ButtonEventArgs args)
 {
     if (enabled && ButtonStateChanged != null) ButtonStateChanged(this, args);
 }
Exemplo n.º 5
0
        void ClientObject_ButtonUp(Object sender,ButtonEventArgs<bool> e )
        {
            Buttonspressed[e.Button] = false;
            if (e.Button == ButtonConstants.Button_A)
            {
                //GravityEffect = new PointF(0, 1f);

            }
            e.Result = true;
        }
Exemplo n.º 6
0
 private void OnButtonUp(object sender, ButtonEventArgs eventArguments)
 {
 }
Exemplo n.º 7
0
 void HandleWidgetButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     var a = new ButtonEventArgs ();
     a.X = args.Event.X;
     a.Y = args.Event.Y;
     a.Button = (int) args.Event.Button;
     if (args.Event.Type == Gdk.EventType.TwoButtonPress)
         a.MultiplePress = 2;
     else if (args.Event.Type == Gdk.EventType.ThreeButtonPress)
         a.MultiplePress = 3;
     else
         a.MultiplePress = 1;
     EventSink.OnButtonPressed (a);
 }
Exemplo n.º 8
0
 public abstract void ButtonPressed(ButtonEventArgs args);
Exemplo n.º 9
0
 private void ClientObject_ButtonDown(Object sender, ButtonEventArgs<bool> e)
 {
     if (e.Button==ButtonConstants.Button_A)
     {
         buttonApressed = true;
         Debug.Print("StickyPaddle detected a Button Press");
         //ReleaseAllBalls();
         //only release the top ball... unless shift is pressed...
         if(attachedstate.ClientObject.getPressedButtons().HasFlag(ButtonConstants.Button_Shift))
             ReleaseAllBalls();
         else
             ReleaseBall();
     }
 }
Exemplo n.º 10
0
 private void ClientObject_ButtonUp(Object sender, ButtonEventArgs<bool> e)
 {
     //throw new NotImplementedException();
     if (e.Button == ButtonConstants.Button_A)
     {
         buttonApressed = false;
     }
 }
        public void Button(ButtonEventArgs e)
        {
            if (e.Button == Buttons.A)
            {
                if (var_Cooldown_Timer <= 0)
                {
                    ShootLaser();
                }
            }

            if (e.Button == Buttons.B)
            {
                if ((var_Cooldown_Timer <= 0) && (var_Bomb_Count > 0))
                {
                    ShootBomb();
                }
            }

            if (e.Button == Buttons.X)
            {
                var_Accellerate = true;
            }

            if (e.Button == Buttons.Y) { }
        }
Exemplo n.º 12
0
        // Keypad event handling
        void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            var btn = args.Button;
            var uo = btn.UserObject;

            // CrestronConsole.PrintLine("Event sig: {0}, Type: {1}, State: {2}", btn.Number, btn.GetType(), btn.State);

            #region UserObject Action<> invocation
            // I have a big issue to contend with in these methods - what do you pass as arguments to the methods
            // I want to keep things decoupled but how do you get access to devices created, resgitered in control system
            // class when you in in classes that are outside the scope  e.g. Versiports, IRPorts etc.
            // Need to fix this section so the action is not fired more than once on button press - for now it does.
            // for some reason
            if (uo is System.Action<Button>)            //if this userObject has been defined and is correct type
                (uo as System.Action<Button>)(btn);
            else if (uo is System.Action)
                (uo as System.Action)();

            ButtonInterfaceController myBIC = new ButtonInterfaceController();
            #endregion

            #region "Hardcoded* button invocation
            /*
            // Call direction until UserObject stuff working
            if (btn.State == eButtonState.Pressed)
            {
                this.VersiPorts[args.Button.Number].DigitalOut = true;
                switch (btn.Number)
                {
                    case 1:
                        myIRPort1.Press("UP_ARROW");
                        ComPorts[1].Send("Test transmition, please ignore");
                        break;
                    case 2:
                        myIRPort1.Press("DN_ARROW");
                        ComPorts[1].Send("\n");
                        break;
                    default:
                        CrestronConsole.PrintLine("Key Not Programmed: {0}", args.Button.Number);
                        break;
                }
            }

            if (args.Button.State == eButtonState.Released)
            {
                myIRPort1.Release();
                this.VersiPorts[args.Button.Number].DigitalOut = false;
            }
            */
            #endregion
        } // Event Handler
Exemplo n.º 13
0
        private void ClientObject_ButtonDown(Object sender, ButtonEventArgs<bool> e)
        {
            if (gstate.PlayerPaddle != null && !gstate.PlayerPaddle.Behaviours.Contains(this))
            {
                //unhook
                gstate.ClientObject.ButtonDown -= ClientObject_ButtonDown;

                return;
            }
            //don't shoot if we are not in the "run" state.
            if (gstate.ClientObject.ActiveState is StateRunning)
            {
                if (e.Button == ButtonConstants.Button_B)
                {
                    ShootBuilder();
                }
            }
            e.Result = true;
        }
Exemplo n.º 14
0
 void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
 {
     switch (args.Button.Number)
     {
         case 1:
             {
                 if (args.Button.State == eButtonState.Pressed)
                     if (mFC.OpenLocalFile(@"\NVRAM\Books.xml") == 0)
                         CrestronConsole.PrintLine("Error Loading Books.xml");
                 break;
             }
         case 2:
             {
                 if (args.Button.State == eButtonState.Pressed)
                     if (mFC.OpenHTTPFile(@"http://textfiles.com/computers/1pt4mb.inf") == 0)
                         CrestronConsole.PrintLine("Error Opening HTTP File");
                 break;
             }
         case 3:
             {
                 if (args.Button.State == eButtonState.Pressed)
                     if (mFC.OpenSFTPFile("Crestron", "", "127.0.0.1", @"/NVRAM/Books.xml") == 0)
                         CrestronConsole.PrintLine("Error Transferring File via sFTP");
                 break;
             }
         default:
             {
                 CrestronConsole.PrintLine("Keypad Button Triggered: {0}, {1}, {2}", device.ID, args.Button.Number, args.Button.State);
                 break;
             }
     }
 }
Exemplo n.º 15
0
 void HandleWidgetButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args)
 {
     var a = new ButtonEventArgs ();
     a.X = args.Event.X;
     a.Y = args.Event.Y;
     a.Button = (int) args.Event.Button;
     EventSink.OnButtonReleased (a);
 }
Exemplo n.º 16
0
        public MenuButton(SpriteFont font, string label, Vector2 pos, Color inactiveColor, Color activeColor, ButtonEventArgs args)
        {
            this.font  = font;
            this.label = label;
            // Find dimensions of the text adn set position to be the center of the text
            Vector2 size      = font.MeasureString(label);
            Vector2 centerPos = new Vector2(pos.X - size.X / 2, pos.Y - size.Y / 2);

            this.centerPos     = centerPos;
            this.pos           = pos;
            this.size          = size;
            this.inactiveColor = inactiveColor;
            this.activeColor   = activeColor;
            this.args          = args;

            prevMouseButton = ButtonState.Released;
        }
Exemplo n.º 17
0
 void Do_ScrollDown(object sender, ButtonEventArgs e)
 {
     OnScrollDown(this, new EventArgs());
 }
Exemplo n.º 18
0
 public static void RaiseButtonReleased(this CellView cellView, ButtonEventArgs args)
 {
     cellView.OnButtonReleased(args);
 }
Exemplo n.º 19
0
 /// <summary>
 ///     Triggered when the <see cref="FirstPageButton"/> is triggered.
 /// </summary>
 /// <param name="e"> The event data. </param>
 /// <returns>
 ///     A <see cref="ValueTask"/> representing the callback work.
 /// </returns>
 protected virtual ValueTask OnFirstPageButtonAsync(ButtonEventArgs e)
 {
     CurrentPageIndex = 0;
     return(default);
Exemplo n.º 20
0
 void onPlay(object sender, ButtonEventArgs e)
 {
     Player.play(Beatmap, Database);
 }
Exemplo n.º 21
0
        private void RefreshPlayerList(ButtonEventArgs args)
        {
            PlayerList.RemoveAllChildren();
            var playerManager = IoCManager.Resolve <IPlayerManager>();
            var sessions      = playerManager.Sessions;

            PlayerCount.Text = $"Players: {playerManager.PlayerCount}";

            Color altColor     = Color.FromHex("#292B38");
            Color defaultColor = Color.FromHex("#2F2F3B");

            var header = new HBoxContainer
            {
                SizeFlagsHorizontal = SizeFlags.FillExpand,
                SeparationOverride  = 4,
                Children            =
                {
                    new Label {
                        Text = "Name",
                        SizeFlagsStretchRatio = 2f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new VSeperator(),
                    new Label {
                        Text = "Player",
                        SizeFlagsStretchRatio = 2f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new VSeperator(),
                    new Label {
                        Text = "Status",
                        SizeFlagsStretchRatio = 1f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new VSeperator(),
                    new Label {
                        Text = "Ping",
                        SizeFlagsStretchRatio = 1f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand,
                        Align = Label.AlignMode.Right
                    },
                }
            };

            PlayerList.AddChild(new PanelContainer
            {
                PanelOverride = new StyleBoxFlat
                {
                    BackgroundColor = altColor,
                },
                Children =
                {
                    header
                }
            });
            PlayerList.AddChild(new HSeparator());

            var useAltColor = false;

            foreach (var player in sessions)
            {
                var hbox = new HBoxContainer
                {
                    SizeFlagsHorizontal = SizeFlags.FillExpand,
                    SeparationOverride  = 4,
                    Children            =
                    {
                        new Label {
                            Text = player.Name,
                            SizeFlagsStretchRatio = 2f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand,
                            ClipText = true
                        },
                        new VSeperator(),
                        new Label {
                            Text = player.AttachedEntity?.Name,
                            SizeFlagsStretchRatio = 2f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand,
                            ClipText = true
                        },
                        new VSeperator(),
                        new Label {
                            Text = player.Status.ToString(),
                            SizeFlagsStretchRatio = 1f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand
                        },
                        new VSeperator(),
                        new Label {
                            Text = player.Ping.ToString(),
                            SizeFlagsStretchRatio = 1f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand,
                            Align = Label.AlignMode.Right
                        },
                    }
                };
                PlayerList.AddChild(new PanelContainer
                {
                    PanelOverride = new StyleBoxFlat
                    {
                        BackgroundColor = useAltColor ? altColor : defaultColor,
                    },
                    Children =
                    {
                        hbox
                    }
                });
                useAltColor ^= true;
            }
        }
Exemplo n.º 22
0
 private void windowsUIButtonPanelCloseButton_ButtonClick(object sender, ButtonEventArgs e)
 {
     this.Close();
 }
Exemplo n.º 23
0
        protected override void OnButtonPressed(ButtonEventArgs args)
        {
            var node   = GetValue(BuildOutputNodeField);
            var status = GetViewStatus(node);

            if (args.Button == PointerButton.Left && args.MultiplePress == 0)
            {
                if (status.TaskLinkRenderRectangle.Contains(args.Position))
                {
                    GoToTask?.Invoke(this, node);
                    return;
                }

                if (status.ErrorsRectangle.Contains(args.Position))
                {
                    ExpandErrors?.Invoke(this, node);
                    return;
                }

                if (status.WarningsRectangle.Contains(args.Position))
                {
                    ExpandWarnings?.Invoke(this, node);
                    return;
                }
            }

            status.CalculateLayout(status.LastRenderBounds);

            if (status.LastRenderExpanderBounds != Rectangle.Zero && status.LastRenderExpanderBounds.Contains(args.Position))
            {
                if (DateTime.Now.Subtract(lastExpanderClick).TotalMilliseconds < DefaultExpandClickDelay)
                {
                    return;
                }
                status.Expanded   = !status.Expanded;
                lastExpanderClick = DateTime.Now;
                QueueResize();
                return;
            }

            if (args.Button == PointerButton.Left && status.LastRenderLayoutBounds.Contains(args.Position))
            {
                var pos = status.layout.GetIndexFromCoordinates(args.Position.X - status.LastRenderLayoutBounds.X, args.Position.Y - status.LastRenderLayoutBounds.Y);
                if (pos != -1)
                {
                    if (TextSelection == null)
                    {
                        TextSelection = new TextSelection <BuildOutputNode> ();
                    }
                    TextSelection.Start(args.Position, pos, node);
                }
                else
                {
                    TextSelection = null;
                }

                QueueDraw();
            }

            //HACK: to avoid automatic scroll behaviour in Gtk (we handle the behaviour)
            //we only want break the normal click behaviour of treeview, in cases when label size is bigger than tree height
            var treeView = ParentWidget as TreeView;

            if (treeView != null && status.Expanded && status.LastRenderBounds.Height > treeView.Size.Height)
            {
                args.Handled = true;
                treeView.SelectRow(node);
            }
            base.OnButtonPressed(args);
        }
Exemplo n.º 24
0
 /// <summary>
 ///     An event reporting a button was released.
 /// </summary>
 protected virtual void OnPreviewButtonUp(ButtonEventArgs e)
 {
 }
 private void Clicked(ButtonEventArgs e)
 {
     _owner.SendAction(_playerAction);
 }
Exemplo n.º 26
0
        // Keypad state handler
        void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            var sig = args.Button;
            var uo = sig.UserObject;

            CrestronConsole.PrintLine("Event sig: {0}, Type: {1}, Name: {2}", sig.Number, sig.GetType(), sig.Name);

            // Read a file example
            CrestronConsole.PrintLine("File Read Example");
            MyFileReader myFileReader = new MyFileReader();
            string myFileContents;
            ushort i;

            CrestronConsole.PrintLine("Reading File example");
            i = myFileReader.OpenLocalFile("\\NVRAM\\Books.xml");
            myFileContents = myFileReader.myFileStringContents;
            CrestronConsole.PrintLine(myFileContents);

            // HTTP File Example
            CrestronConsole.PrintLine("HTTP Read Example");
            OpenHTTPFile myHTTPFile;

            myHTTPFile = new OpenHTTPFile();
            myHTTPFile.getHTTPPage();

            // SFTP{ File Example
            CrestronConsole.PrintLine("SFTP Read Example");
            CustomSFTP myCustomSFTP;

            myCustomSFTP = new CustomSFTP();
            myCustomSFTP.getFromSFTP(@"SFTP://127.0.0.1/Books.xml");
        }
 protected void Clear_OnClick(object sender, ButtonEventArgs e)
 {
     this.OrdersGrid.DataSource = ViewState["DataSource"] as List <Orders>;
     this.OrdersGrid.DataBind();
     serverEvent.InnerHtml = "";
 }
Exemplo n.º 28
0
 void HandleButtonPressEvent(object o, Gtk.ButtonPressEventArgs args)
 {
     int cx, cy;
     Gtk.TreeIter iter;
     if (rendererTarget.GetCellPosition (CellRenderer, (int)args.Event.X, (int)args.Event.Y, out cx, out cy, out iter)) {
         var rect = rendererTarget.GetCellBounds (target, CellRenderer, iter);
         if (rect.Contains (cx, cy)) {
             rendererTarget.PressedIter = iter;
             rendererTarget.PressedCell = this;
             pressX = (int)args.Event.X;
             pressY = (int)args.Event.Y;
             pressCX = cx;
             pressCY = cy;
             if (!buttonReleaseSubscribed) {
                 rendererTarget.EventRootWidget.AddEvents ((int)Gdk.EventMask.ButtonReleaseMask);
                 rendererTarget.EventRootWidget.ButtonReleaseEvent += HandleButtonReleaseEvent;
             }
             ApplicationContext.InvokeUserCode (delegate {
                 LoadData (rendererTarget.Model, iter);
                 var a = new ButtonEventArgs {
                     X = args.Event.X,
                     Y = args.Event.Y,
                     Button = (PointerButton) args.Event.Button
                 };
                 EventSink.OnButtonPressed (a);
                 if (a.Handled)
                     args.RetVal = true;
             });
         }
     }
 }
Exemplo n.º 29
0
 public MarginMouseEventArgs(HexEditor editor, Margin margin, ButtonEventArgs args)
 {
     this.Editor = editor;
     this.margin = margin;
     this.Args   = args;
 }
Exemplo n.º 30
0
        private void OnOnPressed(ButtonEventArgs obj)
        {
            var menu = new VoteCallMenu();

            menu.OpenCentered();
        }
Exemplo n.º 31
0
 public MarginMouseEventArgs(TextEditor editor, ButtonEventArgs e, double x, double y, ModifierKeys modifierState)
 {
     this.RawEvent      = e;
     this.Editor        = editor;
     this.ModifierState = modifierState;
 }
Exemplo n.º 32
0
 protected override void OnButtonReleased(ButtonEventArgs args)
 {
     Console.WriteLine("Release: " + args.Position);
     base.OnButtonReleased(args);
 }
Exemplo n.º 33
0
 private void OnButtonUp(object sender, ButtonEventArgs e)
 {
     throw new NotImplementedException();
 }
 protected void Clear_OnClick(object sender, ButtonEventArgs e)
 {
     serverEvent.InnerHtml = "";
 }
Exemplo n.º 35
0
        void wallDimmer_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            CrestronConsole.PrintLine("Button #{0} was {1}", args.Button.Number, args.NewButtonState.ToString());

            switch (args.Button.Number)
            {
                case 1:
                    // do something with button 1
                    break;

                case 2:
                    // etc...
                    break;

                case 3:
                    break;

                case 4:
                    break;

                default:
                    break;
            }
        }
Exemplo n.º 36
0
 public override void ButtonPressed(ButtonEventArgs args)
 {
     IoCManager.Resolve <IClientConsole>().ProcessCommand(RequiredCommand);
 }
Exemplo n.º 37
0
 /// <summary>
 ///     Called when the <see cref="ConfirmButton"/> is triggered.
 /// </summary>
 /// <param name="e"> The event data. </param>
 /// <returns>
 ///     A <see cref="ValueTask"/> representing the callback work.
 /// </returns>
 protected virtual ValueTask OnConfirmButtonAsync(ButtonEventArgs e)
     => CompleteAsync(true, e);
Exemplo n.º 38
0
        /*               case Keys.W:
                    return ButtonConstants.Button_E;
                case Keys.A:
                    return ButtonConstants.Button_F;
                case Keys.S:
                    return ButtonConstants.Button_G;
                case Keys.D:
                    return ButtonConstants.Button_H; */
        void ClientObject_ButtonDown(Object sender,ButtonEventArgs<bool> e)
        {
            lock (this)
            {

                Buttonspressed[e.Button] = true;
                if (_EnemyState == "DYING" || _EnemyState == "DEATH") { e.Result = false; return; }

                if (e.Button == ButtonConstants.Button_D)
                {
                    //GravityEffect = new PointF(0, 0.5f);
                    //jump...
                    if (_EnemyState != "JUMPLEFT" && _EnemyState != "JUMPRIGHT" && _EnemyState != "DYING" && _EnemyState != "DEATH")
                    {

                        if (_EnemyState == "IDLELEFT" || _EnemyState == "WALKLEFT")
                            _EnemyState = "JUMPLEFT";
                        else if (_EnemyState == "IDLERIGHT" || _EnemyState == "WALKRIGHT")
                            _EnemyState = "JUMPRIGHT";

                        BCBlockGameState.Soundman.PlaySound("SMBJUMP");
                        Velocity = new PointF(Velocity.X, -8 - (Math.Abs(Velocity.X / 3))); //jump!
                        Location = new PointF(Location.X, Location.Y - 3);
                        onground = false;
                        ongroundlastframe = false; //we need to set these otherwise jumping would suck.

                    }

                }
            }
            e.Result = true;
            return;
        }
Exemplo n.º 39
0
 /// <summary>
 ///     Called when the <see cref="DenyButton"/> is triggered.
 /// </summary>
 /// <param name="e"> The event data. </param>
 /// <returns>
 ///     A <see cref="ValueTask"/> representing the callback work.
 /// </returns>
 protected virtual ValueTask OnDenyButtonAsync(ButtonEventArgs e)
     => CompleteAsync(false, e);
Exemplo n.º 40
0
 protected void Clear_OnClick(object sender, ButtonEventArgs e)
 {
     this.FlatSpreadsheet.Sheets[0].RangeSetting[0].Datasource = ViewState["DataSource"] as List <Orders>;
     serverEvent.InnerHtml = "";
 }
Exemplo n.º 41
0
        private void ClientObject_ButtonDown(Object sender, ButtonEventArgs<bool> e)
        {
            //make sure we exist!

            Deflection=(e.Button == ButtonConstants.Button_Shift);
            if (mstate.PlayerPaddle != null && !mstate.PlayerPaddle.Behaviours.Contains(this))
            {
                //unhook
                mstate.ClientObject.ButtonDown -= ClientObject_ButtonDown;
                mstate.ClientObject.ButtonUp -= ClientObject_ButtonUp;
                return;
            }
            //don't shoot if we are not in the "run" state.
            if (mstate.ClientObject.ActiveState is StateRunning)
            {
                if (e.Button == ButtonConstants.Button_B)
                {
                    if (Allowcharge)
                    {
                        //button down waits until buttonup, using the charge amount.
                        ThreadStart threadfunction = () =>
                                                         {
                                                             int chargeticks = 0;
                                                             while (ButtonBPressed)
                                                             {
                                                                 Thread.Sleep(100);
                                                                 chargeticks++;
                                                             }
                                                             Shoot(chargeticks);
                                                         };

                        ChargeWatcher = new Thread(threadfunction);
                        ChargeWatcher.Start();
                    }
                    else
                    {
                        ButtonBPressed = true;

                        Shoot(0);
                    }
                }
            }
        }
Exemplo n.º 42
0
 protected override void ButtonPressedInternal(ButtonEventArgs a)
 {
     if (a.Button == PointerButton.Right && SelectedRows.Length > 1)
     {
         a.Handled = true;
     }
 }
Exemplo n.º 43
0
        private void ClientObject_ButtonUp(Object sender, ButtonEventArgs<bool> e)
        {
            if (e.Button == ButtonConstants.Button_Shift) Deflection = false;
            if (e.Button == ButtonConstants.Button_B)
            {
                if (MachineGunTimer != null)
                    MachineGunTimer.Dispose();

                ButtonBPressed = false;
            }
        }
Exemplo n.º 44
0
 private void _xlistener_ButtonReleased(object sender, ButtonEventArgs e)
 {
     //If any button is released, this means the T-bot should start.
     textBoxStatus.AppendText("-Stop\n");
     TBot.Write("E");
 }
Exemplo n.º 45
0
		public static void RaiseButtonReleased (this CellView cellView, ButtonEventArgs args)
		{
			cellView.OnButtonReleased (args);
		}
Exemplo n.º 46
0
        public Task SecondOptionAsync(ButtonEventArgs e)
        {
            var content = e.WasAdded ? "regular heel" : "trans heel";

            return(Message.ModifyAsync(x => x.Content = content));
        }
Exemplo n.º 47
0
 protected override void OnButtonPressed(ButtonEventArgs args)
 {
     base.OnButtonPressed(args);
     State = CellDisplayState.Pressed;
 }
Exemplo n.º 48
0
 /// <summary>
 ///     An event reporting a button was released.
 /// </summary>
 protected virtual void OnButtonUp(ButtonEventArgs e)
 {
 }
Exemplo n.º 49
0
 protected override void OnButtonReleased(ButtonEventArgs args)
 {
     base.OnButtonReleased(args);
     Click?.Invoke(this, args);
     State = CellDisplayState.Default;
 }
Exemplo n.º 50
0
        // Keypad event handler
        void myKeypad_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            var btn = args.Button;
            var uo = btn.UserObject;

            CrestronConsole.PrintLine("Event sig: {0}, Type: {1}, State: {2}", btn.Number, btn.GetType(), btn.State);

            #region UserObject Action<> invocation
            // Need to fix this section so the action is not fired more than once on button press - for now it does.
            // for some reason
            if (btn.State == eButtonState.Pressed)
            {
                if (uo is System.Action<Button>) //if this userObject has been defined and is correct type
                    (uo as System.Action<Button>)(btn);
                else if (uo is System.Action)
                    (uo as System.Action)();
            }
            #endregion

            #region "Hardcoded* button invocation
            /*
            // Call direction until UserObject stuff working
            ButtonInterfaceController myBIC = new ButtonInterfaceController();
            if (sig.State == eButtonState.Pressed)
            {
                switch (sig.Number)
                {
                    case 1:
                        myBIC.ReadFile();
                        break;
                    case 2:
                        myBIC.GetHTTPFile();
                        break;
                    default:
                        myBIC.GetSFTPFile();
                        break;
                }
            }
            */
            #endregion
            } // Event Handler
Exemplo n.º 51
0
 protected virtual internal void OnButtonPressed(ButtonEventArgs args)
 {
     pressLocation = args.Position;
     pressCount    = args.MultiplePress;
     State         = CellDisplayState.Pressed;
 }
Exemplo n.º 52
0
		protected override void OnButtonPress (ButtonEventArgs args)
		{
			if (args.Button == 1) {
				int location = PositionToOffset ((int)args.X, (int)args.Y);
				if (location >= 0) {
					CaretOffset = location;
					CaretHighlightOffset = -1;
				}
			}
			QueueDraw ();
		}
Exemplo n.º 53
0
        private void RefreshPlayerList(ButtonEventArgs args)
        {
            PlayerList.RemoveAllChildren();
            var sessions = IoCManager.Resolve <IPlayerManager>().Sessions;
            var header   = new HBoxContainer
            {
                SizeFlagsHorizontal = SizeFlags.FillExpand,
                Children            =
                {
                    new Label {
                        Text = "Name",
                        SizeFlagsStretchRatio = 2f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new Label {
                        Text = "Player",
                        SizeFlagsStretchRatio = 2f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new Label {
                        Text = "Status",
                        SizeFlagsStretchRatio = 1f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand
                    },
                    new Label {
                        Text = "Ping",
                        SizeFlagsStretchRatio = 1f,
                        SizeFlagsHorizontal   = SizeFlags.FillExpand,
                        Align = Label.AlignMode.Right
                    },
                }
            };

            PlayerList.AddChild(header);
            PlayerList.AddChild(new Controls.HighDivider());
            foreach (var player in sessions)
            {
                var hbox = new HBoxContainer
                {
                    SizeFlagsHorizontal = SizeFlags.FillExpand,
                    Children            =
                    {
                        new Label {
                            Text = player.Name,
                            SizeFlagsStretchRatio = 2f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand
                        },
                        new Label {
                            Text = player.AttachedEntity?.Name,
                            SizeFlagsStretchRatio = 2f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand
                        },
                        new Label {
                            Text = player.Status.ToString(),
                            SizeFlagsStretchRatio = 1f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand
                        },
                        new Label {
                            Text = player.Ping.ToString(),
                            SizeFlagsStretchRatio = 1f,
                            SizeFlagsHorizontal   = SizeFlags.FillExpand,
                            Align = Label.AlignMode.Right
                        },
                    }
                };
                PlayerList.AddChild(hbox);
            }
        }
Exemplo n.º 54
0
		public override void MouseUp (NSEvent theEvent)
		{
			var p = ConvertPointFromView (theEvent.LocationInWindow, null);
			ButtonEventArgs args = new ButtonEventArgs ();
			args.X = p.X;
			args.Y = p.Y;
			args.Button = (PointerButton) (int)theEvent.ButtonNumber + 1;
			args.MultiplePress = (int)theEvent.ClickCount;
			context.InvokeUserCode (delegate {
				eventSink.OnButtonReleased (args);
			});
		}
Exemplo n.º 55
0
 private void Communication_ButtonUp(object sender, ButtonEventArgs e)
 {
 }
Exemplo n.º 56
0
        /// <summary>
        /// Method to handle button press events from the TT-100 ConnectIt.
        /// </summary>
        /// <param name="device">Reference to the device raising this event.</param>
        /// <param name="args">Information about the event being raised.</param>
        void connectIt_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            // only process the press of the button, ignore the release
            if (args.NewButtonState == eButtonState.Released)
                return;

            // determine which button was pressed
            switch (args.Button.Number)
            {
                // handle both buttons the same way
                case (uint)eConnectItButtons.Left:
                case (uint)eConnectItButtons.Right:
                    CrestronConsole.PrintLine("{0} ConnectIt button pressed while system is in \"{1}\" mode",
                                            args.Button.Number == 1 ? "Left" : "Right",
                                            SystemState.ToString());

                    // determine what the system state was when the button was pressed
                    switch (SystemState)
                    {
                        case eSystemStates.PoweredOff:
                            ManualStartUp();
                            break;

                        case eSystemStates.InUse:
                            // determine what input is active, then check to see  if any other inputs have signal
                            if (dmTx.VideoSourceFeedback == BaseDmTx401.eSourceSelection.HDMI)
                            {
                                // if another input has signal, cycle to that input
                                if (dmTx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.DisplayPort;
                                else if (dmTx.VgaInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.VGA;
                                else
                                    CrestronConsole.PrintLine("no other inputs have sync, ignoring button press");
                            }
                            else if (dmTx.VideoSourceFeedback == BaseDmTx401.eSourceSelection.DisplayPort)
                            {
                                if (dmTx.HdmiInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.HDMI;
                                else if (dmTx.VgaInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.VGA;
                                else
                                    CrestronConsole.PrintLine("no other inputs have sync, ignoring button press");
                            }
                            else if (dmTx.VideoSourceFeedback == BaseDmTx401.eSourceSelection.VGA)
                            {
                                if (dmTx.HdmiInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.HDMI;
                                else if (dmTx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.DisplayPort;
                                else
                                    CrestronConsole.PrintLine("no other inputs have sync, ignoring button press");
                            }
                            else
                            {
                                /* the tx should never be on any input other than vga, hdmi or displayport. if is ever gets there,
                                 * check to see if any of the valid inputs have signal and then switch to it */
                                CrestronConsole.PrintLine("button pressed while on an invalid dm tx input ({0})", dmTx.VideoSourceFeedback.ToString());

                                if (dmTx.HdmiInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.HDMI;
                                else if (dmTx.DisplayPortInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.DisplayPort;
                                else if (dmTx.VgaInput.SyncDetectedFeedback.BoolValue)
                                    dmTx.VideoSource = BaseDmTx401.eSourceSelection.VGA;
                                else
                                    SetSystemState(eSystemStates.WaitingForInput);
                            }
                            break;

                        case eSystemStates.WaitingForInput:
                            connectIt.LedState1 = eLedStates.BlinksRedFiveTimes;
                            connectIt.LedState2 = eLedStates.BlinksRedFiveTimes;
                            break;

                        default:
                            break;
                    }

                    break;

                default:
                    break;
            }
        }
Exemplo n.º 57
0
 private void OnOnPressed(ButtonEventArgs obj)
 {
     _openTutorialWindow();
 }
Exemplo n.º 58
0
        void HandleButtonReleaseEvent(object o, Gtk.ButtonReleaseEventArgs args)
        {
            int cx, cy;
            Gtk.TreeIter iter;
            bool captured = false;

            if (rendererTarget.PressedCell != null) {
                if (rendererTarget.PressedCell == this) {
                    iter = rendererTarget.PressedIter;
                    cx = pressCX + (int)args.Event.X - pressX;
                    cy = pressCY + (int)args.Event.Y - pressY;
                    captured = true;
                }
                else
                    return;
            } else if (!rendererTarget.GetCellPosition (CellRenderer, (int)args.Event.X, (int)args.Event.Y, out cx, out cy, out iter))
                return;

            rendererTarget.PressedCell = null;
            rendererTarget.PressedIter = Gtk.TreeIter.Zero;

            if (!buttonReleaseSubscribed)
                rendererTarget.EventRootWidget.ButtonReleaseEvent -= HandleButtonReleaseEvent;

            var rect = rendererTarget.GetCellBounds (target, CellRenderer, iter);
            if (captured || rect.Contains (cx, cy)) {
                ApplicationContext.InvokeUserCode (delegate {
                    LoadData (rendererTarget.Model, iter);
                    var a = new ButtonEventArgs {
                        X = args.Event.X,
                        Y = args.Event.Y,
                        Button = (PointerButton) args.Event.Button
                    };
                    EventSink.OnButtonReleased (a);
                    if (a.Handled)
                        args.RetVal = true;
                });
            }
        }
Exemplo n.º 59
0
 void HandleWiiremoteButtonPressed(object sender, ButtonEventArgs args)
 {
     LayoutRoot.Dispatcher.BeginInvoke(()=>{
         WiiKey.Text = args.Button.ToString();
     });
 }