示例#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);
                }
            }
        }
示例#2
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();
             }
         }
     }
 }
示例#3
0
文件: Form1.cs 项目: nstehr/BugZap
        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();
            }
            }
        }
示例#4
0
文件: Form1.cs 项目: nstehr/BugZap
        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();
            }
        }
示例#5
0
文件: Form1.cs 项目: nstehr/BugZap
 private void sdgManager1_KeyDown(object sender, Sdgt.SdgKeyEventArgs e)
 {
 }