public Variable(Wrappers.Network network, Widgets.Window parent, Wrappers.Wrapper obj) { d_object = obj; DestroyWithParent = true; TransientFor = parent; HasSeparator = false; if (obj is Wrappers.Edge) { SetDefaultSize(600, 300); } else { SetDefaultSize(400, 300); } d_view = new Widgets.Editors.Wrapper(d_object, parent.Actions, network); d_view.BorderWidth = 6; VBox.PackStart(d_view, true, true, 0); d_object.VariableChanged += delegate(Wrappers.Wrapper source, Cdn.Variable name) { UpdateTitle(); }; VBox.ShowAll(); AddButton(Gtk.Stock.Close, ResponseType.Close); UpdateTitle(); }
public Import(Widgets.Window parent) : base("Import CDN Network", parent, FileChooserAction.Open) { AddButton(Gtk.Stock.Cancel, ResponseType.Cancel); AddButton("Import", ResponseType.Ok); LocalOnly = true; SelectMultiple = true; string path = parent.Network.Path; if (path != null) { SetCurrentFolder(System.IO.Path.GetDirectoryName(path)); } FileFilter cdn = new FileFilter(); cdn.AddPattern("*.cdn"); cdn.Name = "CDN Files (*.cdn)"; AddFilter(cdn); FileFilter all = new FileFilter(); all.AddPattern("*"); all.Name = "All Files (*)"; AddFilter(all); Table table = new Table(2, 2, false); table.ColumnSpacing = 6; table.RowSpacing = 3; Label lbl; lbl = new Label("Action:"); lbl.SetAlignment(0f, 0.5f); table.Attach(lbl, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0); lbl = new Label("Selection:"); lbl.SetAlignment(0f, 0.5f); table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0); d_comboAction = new ComboBox(new string[] { "Copy objects from file", "Reference objects in file" }); table.Attach(d_comboAction, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); d_comboAction.Changed += HandleActionChanged; d_comboSelection = new ComboBox(new string[] { "All objects", "Only templates" }); table.Attach(d_comboSelection, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 0); d_comboSelection.Changed += HandleSelectionChanged; table.ShowAll(); ExtraWidget = table; d_comboAction.Active = 0; d_comboSelection.Active = 0; }