예제 #1
0
 private void ShowObjButton_Click(object sender, EventArgs e)
 {
     if (isSelected())
     {
         CEmblem figure = (CEmblem)comboBox1.SelectedItem;
         figure.Show();
         figure.Draw(pictureBox1);
     }
 }
예제 #2
0
        private void CreateNewObjButton_Click(object sender, EventArgs e)
        {
            count++;
            int randSize = r.Next(40, 200);
            int rand     = r.Next(0, 737 - randSize);
            int rand2    = r.Next(0, 560 - randSize);

            CEmblem figure = new CEmblem(rand, rand2, randSize, "Figure " + count, Color.Red);

            figure.Show();
            figure.Draw(pictureBox1);
            comboBox1.Items.Add(figure);
            comboBox1.SelectedItem = figure;
        }
예제 #3
0
        private void UpSize_Click(object sender, EventArgs e)
        {
            if (isSelected())
            {
                CEmblem figure = (CEmblem)comboBox1.SelectedItem;
                if (figure.CurrentColor == Color.White)
                {
                    return;
                }

                DownSize.Enabled = true;
                figure.Hide();
                figure.Draw(pictureBox1);
                figure.Enlarge();
                figure.Show();
                figure.Draw(pictureBox1);
            }
        }
예제 #4
0
        private void MoveDown_Click(object sender, EventArgs e)
        {
            if (isSelected())
            {
                CEmblem figure = (CEmblem)comboBox1.SelectedItem;
                if (figure.CurrentColor == Color.White)
                {
                    return;
                }

                figure.Hide();
                figure.Draw(pictureBox1);
                figure.MoveDown();
                figure.Show();
                figure.Draw(pictureBox1);
                MoveTopMax.Enabled = true;
                MoveTop.Enabled    = true;
            }
        }
예제 #5
0
        private void MoveRighMax_Click(object sender, EventArgs e)
        {
            if (isSelected())
            {
                CEmblem figure = (CEmblem)comboBox1.SelectedItem;
                if (figure.CurrentColor == Color.White)
                {
                    return;
                }

                figure.Hide();
                figure.Draw(pictureBox1);
                figure.EndRight();
                figure.Show();
                figure.Draw(pictureBox1);
                MoveRighMax.Enabled = false;
                MoveRight.Enabled   = false;
                MoveLeftMax.Enabled = true;
                MoveLeft.Enabled    = true;
            }
        }
예제 #6
0
        private void DownSize_Click(object sender, EventArgs e)
        {
            if (isSelected())
            {
                CEmblem figure = (CEmblem)comboBox1.SelectedItem;
                if (figure.CurrentColor == Color.White)
                {
                    return;
                }

                if (figure.Size > 0)
                {
                    figure.Hide();
                    figure.Draw(pictureBox1);
                    figure.Reduce();
                    figure.Show();
                    figure.Draw(pictureBox1);
                }
                else
                {
                    DownSize.Enabled = false;
                }
            }
        }