public Dialog(Image image, Drawable drawable, SliceData sliceData) : base(_("Slice Tool"), _("SliceTool"), IntPtr.Zero, 0, null, _("SliceTool"), Stock.SaveAs, (Gtk.ResponseType) 2, Stock.Save, (Gtk.ResponseType) 3, Stock.Close, ResponseType.Close) { _image = image; _drawable = drawable; _sliceData = sliceData; SetTitle(null); var vbox = new VBox(false, 12) { BorderWidth = 12 }; VBox.PackStart(vbox, true, true, 0); var hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); var preview = CreatePreview(drawable, sliceData); var toolbox = Preview.CreateToolbox(sliceData); hbox.PackStart(toolbox, false, true, 0); hbox.PackStart(preview, true, true, 0); hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); hbox.PackStart(new CoordinatesDisplay(Preview), false, false, 0); hbox = new HBox(false, 24); vbox.PackStart(hbox, true, true, 0); var properties = new CellPropertiesFrame(sliceData.Rectangles); hbox.PackStart(properties, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var rollover = new RolloversFrame(sliceData); vbox.PackStart(rollover, false, true, 0); _format = new Format(sliceData.Rectangles); _format.Extension = System.IO.Path.GetExtension(image.Name).ToLower(); vbox.PackStart(_format, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var save = new SaveSettingsButton(this, sliceData); vbox.PackStart(save, false, true, 0); var load = new LoadSettingsButton(this, sliceData); vbox.PackStart(load, false, true, 0); var preferences = new PreferencesButton(_("Preferences"), Preview); vbox.PackStart(preferences, false, true, 0); sliceData.Rectangles.SelectedRectangleChanged += delegate { Redraw(); }; sliceData.Init(drawable); }
public Dialog(Image image, Drawable drawable, SliceData sliceData) : base(_("Slice Tool"), _("SliceTool"), IntPtr.Zero, 0, null, _("SliceTool"), Stock.SaveAs, (Gtk.ResponseType) 2, Stock.Save, (Gtk.ResponseType) 3, Stock.Close, ResponseType.Close) { _image = image; _drawable = drawable; _sliceData = sliceData; SetTitle(null); var vbox = new VBox(false, 12) {BorderWidth = 12}; VBox.PackStart(vbox, true, true, 0); var hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); var preview = CreatePreview(drawable, sliceData); var toolbox = Preview.CreateToolbox(sliceData); hbox.PackStart(toolbox, false, true, 0); hbox.PackStart(preview, true, true, 0); hbox = new HBox(); vbox.PackStart(hbox, true, true, 0); hbox.PackStart(new CoordinatesDisplay(Preview), false, false, 0); hbox = new HBox(false, 24); vbox.PackStart(hbox, true, true, 0); var properties = new CellPropertiesFrame(sliceData.Rectangles); hbox.PackStart(properties, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var rollover = new RolloversFrame(sliceData); vbox.PackStart(rollover, false, true, 0); _format = new Format(sliceData.Rectangles); _format.Extension = System.IO.Path.GetExtension(image.Name).ToLower(); vbox.PackStart(_format, false, true, 0); vbox = new VBox(false, 12); hbox.PackStart(vbox, false, true, 0); var save = new SaveSettingsButton(this, sliceData); vbox.PackStart(save, false, true, 0); var load = new LoadSettingsButton(this, sliceData); vbox.PackStart(load, false, true, 0); var preferences = new PreferencesButton(_("Preferences"), Preview); vbox.PackStart(preferences, false, true, 0); sliceData.Rectangles.SelectedRectangleChanged += delegate {Redraw();}; sliceData.Init(drawable); }