예제 #1
0
 private void editBrushToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Document.ContainsBrush(brushNameBox.Text))
     {
         BrushDialog bd = new BrushDialog(brushNameBox.Text);
         bd.Show();
     }
 }
예제 #2
0
 //Brushes
 private void brushNameBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Return)
     {
         if (!Document.ContainsBrush(brushNameBox.Text))
         {
             if (Document.SetBrush(brushNameBox.Text, new HeightBrush(64, 64, 1, 8)))
             {
                 BrushDialog bd = new BrushDialog(brushNameBox.Text);
                 bd.Show();
             }
         }
         e.SuppressKeyPress = true;
     }
 }
예제 #3
0
 private void newBrushToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (!Document.ContainsBrush(brushNameBox.Text))
     {
         if (Document.SetBrush(brushNameBox.Text, new HeightBrush(64, 64, 1, 8)))
         {
             BrushDialog bd = new BrushDialog(brushNameBox.Text, this);
             bd.Show();
         }
         else
         {
             MessageBox.Show("Please enter a valid name for your brush in the box above.", "Naming Error");
         }
     }
     else
     {
         MessageBox.Show(string.Format("A brush named {0} already exists. Type a new name in the box above, or remove the existing brush.", brushNameBox.Text), "Naming Conflict");
     }
 }