public void updateCurrentPenImage()
        {
            bitmapSwitchButton cb = pen1Btn.getSelected();

            if ((cb != null) && (cb != eraserBtn) && (cb != pen7Btn))
            {
                cb.Image = getPenImage(surface.PenImg);
            }
        }
Example #2
0
 public void addToGroup(bitmapSwitchButton primary)
 {
     group.Remove(this);
     group = primary.group;
     foreach (bitmapSwitchButton bt in group)
     {
         if ((bt != this) && (bt.selected))
         {
             this.selected = false;
         }
     }
     group.Add(this);
 }
 private void sizeSelect_ValueChanged(object sender, EventArgs e)
 {
     if ((!switchingPen) && (this.surface != null))
     {
         bitmapSwitchButton cb = pen1Btn.getSelected();
         cb.data = new penInfo((int)sizeSelect.Value, colourBtn.BackColor, (OverlayPaintArea.penType)(typeSelect.SelectedIndex + 1));
         this.surface.setPen((int)sizeSelect.Value, colourBtn.BackColor, (OverlayPaintArea.penType)(typeSelect.SelectedIndex + 1));
         updateCurrentPenImage();
         if ((OnPenUpdated != null) && (!settingPenInfo))
         {
             OnPenUpdated(sender, e);
         }
     }
 }
Example #4
0
 public bitmapSwitchButton(bitmapSwitchButton primary)
 {
     InitializeComponent();
     if (primary == null)
     {
         group = new List <bitmapSwitchButton>();
     }
     else
     {
         group = primary.group;
     }
     group.Add(this);
     Enabled  = true;
     selected = false;
 }
 private void colourBtn_Click(object sender, EventArgs e)
 {
     if (colorDialog1.ShowDialog() == DialogResult.OK)
     {
         if (this.surface != null)
         {
             colourBtn.BackColor = colorDialog1.Color;
             bitmapSwitchButton cb = pen1Btn.getSelected();
             cb.data = new penInfo((int)sizeSelect.Value, colorDialog1.Color, (OverlayPaintArea.penType)(typeSelect.SelectedIndex + 1));
             this.surface.setPen((int)sizeSelect.Value, colorDialog1.Color, (OverlayPaintArea.penType)(typeSelect.SelectedIndex + 1));
             updateCurrentPenImage();
             if ((OnPenUpdated != null) && (!settingPenInfo))
             {
                 OnPenUpdated(sender, e);
             }
         }
     }
 }