private void OnBrushRemoved(BasePaintBrush brush) { var handler = BrushRemoved; if (handler != null) { handler(this, new BrushEventArgs(brush)); } }
/// <summary> /// Register a new brush. /// </summary> public void AddPaintBrush(BasePaintBrush paintBrush) { paint_brushes.Add(paintBrush); paint_brushes.Sort(new BrushSorter()); OnBrushAdded(paintBrush); }
/// <summary> /// Rebuild the list of brushes. /// </summary> private void RebuildBrushComboBox() { brush_combo_box.Model.Clear (); default_brush = null; foreach (var brush in PintaCore.PaintBrushes) { if (default_brush == null) default_brush = (BasePaintBrush)brush; brush_combo_box.Model.AppendValues (brush.Name, brush); } brush_combo_box.ComboBox.Active = 0; }
protected override void OnBuildToolBar(Toolbar tb) { base.OnBuildToolBar (tb); // Change the cursor when the BrushWidth is changed. brush_width.ComboBox.Changed += (sender, e) => SetCursor (DefaultCursor); tb.AppendItem (new Gtk.SeparatorToolItem ()); if (brush_label == null) brush_label = new ToolBarLabel (string.Format (" {0}: ", Catalog.GetString ("Type"))); if (brush_combo_box == null) { brush_combo_box = new ToolBarComboBox (100, 0, false); brush_combo_box.ComboBox.Changed += (o, e) => { Gtk.TreeIter iter; if (brush_combo_box.ComboBox.GetActiveIter (out iter)) { active_brush = (BasePaintBrush)brush_combo_box.Model.GetValue (iter, 1); } else { active_brush = default_brush; } }; RebuildBrushComboBox (); } tb.AppendItem (brush_label); tb.AppendItem (brush_combo_box); }
public BrushEventArgs (BasePaintBrush brush) { Brush = brush; }
public BrushEventArgs(BasePaintBrush brush) { Brush = brush; }