Exemplo n.º 1
0
        // On a mouse up, record that that mouse is in an unpressed state and force a repaint
        // Also check to see if any all other mice are unpressed. If so, then generate a click event.
        private void SDGButton_SdgMouseUp(object sender, Sdgt.SdgMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (this.UseLock == false || (this.UseLock == true && pressed[e.ID] == true))
                {
                    pressed[e.ID] = false;
                    this.Invalidate();

                    bool none_pressed = true;
                    foreach (bool b in pressed)
                    {
                        if (b == true)
                        {
                            none_pressed = false;
                        }
                    }

                    if (none_pressed && sdgClick != null)
                    {
                        sdgClick(this, e.ID);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void sdgManager1_MouseWheel(object sender, Sdgt.SdgMouseEventArgs e)
        {
            if (e.ID == 0)
            {
                magGlass.setPicture(Utilities.RotateImage(magGlass.getPicture().Image, 90));
            }
            else
            {
                if (e.Delta > 0)
                {
                    counter += 5;
                }
                else
                {
                    counter -= 5;
                }
                counter = mirror.rotate(counter);
            }



            if (magGlass.Location.X <= norm_x && norm_x <= magGlass.Location.X + 50 &&
                magGlass.Location.Y < +norm_y && norm_y <= magGlass.Location.Y + 110)
            {
                attemptKill();
            }
        }
Exemplo n.º 3
0
 // On a mouse down, record that that mouse is in a pressed state and force a repaint
 private void SDGButton_SdgMouseDown(object sender, Sdgt.SdgMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (this.UseLock == false) //simultaneous use allowed
         {
             pressed[e.ID] = true;
             this.Invalidate();
         }
         else // Only allow this person to press it if no one else has.
         {
             bool none_pressed = true;
             foreach (bool b in pressed)
             {
                 if (b == true)
                 {
                     none_pressed = false;
                 }
             }
             if (none_pressed)
             {
                 pressed[e.ID] = true;
                 this.Invalidate();
             }
         }
     }
 }
Exemplo n.º 4
0
        private void sdgManager1_MouseMove(object sender, Sdgt.SdgMouseEventArgs e)
        {
            if (e.ID == 0)
            {
                magGlass.Location = new Point(sdgManager1.Mice[e.ID].Xabs, sdgManager1.Mice[e.ID].Yabs);
            }
            else
            {
                mirror.Location = new Point(sdgManager1.Mice[e.ID].Xabs, sdgManager1.Mice[e.ID].Yabs);
            }



            if (magGlass.Location.X <= norm_x && norm_x <= magGlass.Location.X + 50 &&
                magGlass.Location.Y < +norm_y && norm_y <= magGlass.Location.Y + 110)
            {
                //magnfiying glass
                if (e.ID == 0)
                {
                    attemptKill();
                }
            }
        }