예제 #1
0
        /// <summary>
        /// Lock all Buttons for a single table
        /// </summary>
        public void lockAllButtons()
        {
            foreach (PlayerButton b in buttons)
            {
                if (b.Text != null)
                {
                    CustomPictureBox cpbOld = (CustomPictureBox)b.lockImage;
                    if (cpbOld == null) // dont attach two lock icons
                    {
                        CustomPictureBox imageLock = new CustomPictureBox();
                        imageLock.Image    = GlobalSettings.Images.lockImage;
                        imageLock.Width    = GlobalSettings.Images.lockImage.Width;
                        imageLock.Height   = GlobalSettings.Images.lockImage.Height;
                        imageLock.Location = new System.Drawing.Point(b.Location.X - imageLock.Width - 1, b.Location.Y);
                        imageLock.Visible  = true;
                        b.lockImage        = imageLock;
                        imageLock.SetParent(b.TableHandle);

                        PlayerButtonContextMenuStrip pbcms = (PlayerButtonContextMenuStrip)b.ContextMenuStrip;
                        if (pbcms == null)
                        {
                            continue;
                        }
                        // Reset toolstrip to "unlock" text
                        resetLockToolstrip("Unlock");
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Set Similar images for buttons if necessary
        /// </summary>
        /// <param name="button">Which button should we attach similar nicks to?</param>
        /// <param name="similar">List of similar nicks</param>
        private void setSimilarNickImage(PlayerButton button, List <Note> similar)
        {
            // Create picture box with settings from GlobalSettings and Set location according to PlayerButton
            CustomPictureBox imageSimilar = new CustomPictureBox();

            imageSimilar.Image        = GlobalSettings.Images.questionImage;
            imageSimilar.Width        = GlobalSettings.Images.lockImage.Width;
            imageSimilar.Height       = GlobalSettings.Images.lockImage.Height;
            imageSimilar.Location     = new System.Drawing.Point(button.Location.X, button.Location.Y - imageSimilar.Width - 1);
            imageSimilar.Visible      = true;
            button.similarImage       = imageSimilar;
            imageSimilar.SimilarNicks = similar;
            imageSimilar.PlayerButton = button;
            imageSimilar.MouseDown   += new MouseEventHandler(PlayerButton.similarImage_Click);
            imageSimilar.SetParent(button.TableHandle);
        }
예제 #3
0
 /// <summary>
 /// Set LockImage for single seat
 /// </summary>
 /// <param name="seatName"></param>
 /// <param name="tablePointer"></param>
 public void setLockImage(string seatName, IntPtr tablePointer)
 {
     foreach (PlayerButton b in buttons)
     {
         if (b.SeatName.Equals(seatName))
         {
             CustomPictureBox imageLock = new CustomPictureBox();
             imageLock.Image    = GlobalSettings.Images.lockImage;
             imageLock.Width    = GlobalSettings.Images.lockImage.Width;
             imageLock.Height   = GlobalSettings.Images.lockImage.Height;
             imageLock.Location = new System.Drawing.Point(b.Location.X - imageLock.Width - 1, b.Location.Y);
             imageLock.Visible  = true;
             b.lockImage        = imageLock;
             imageLock.SetParent(tablePointer);
             break;
         }
     }
 }