protected void InitializeExtraWidget() { PlaylistFormatDescription [] formats = PlaylistFileUtil.ExportFormats; int default_export_index = PlaylistFileUtil.GetFormatIndex(formats, playlist); // Build custom widget used to select the export format. store = new ListStore(typeof(string), typeof(PlaylistFormatDescription)); foreach (PlaylistFormatDescription format in formats) { store.AppendValues(format.FormatName, format); } HBox hBox = new HBox(false, 2); combobox = new ComboBox(store); CellRendererText crt = new CellRendererText(); combobox.PackStart(crt, true); combobox.SetAttributes(crt, "text", 0); combobox.Active = default_export_index; combobox.Changed += OnComboBoxChange; hBox.PackStart(new Label(Catalog.GetString("Select Format: ")), false, false, 0); hBox.PackStart(combobox, true, true, 0); combobox.ShowAll(); hBox.ShowAll(); ExtraWidget = hBox; }
private Gtk.ComboBox FilterComboBox() { filter_data = new Gtk.ListStore(new Type[] { typeof(string), typeof(string) }); Gtk.TreeIter iter; iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("Anywhere")); filter_data.SetValue(iter, 1, null); iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("in Files")); filter_data.SetValue(iter, 1, "File"); iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("in Addressbook")); filter_data.SetValue(iter, 1, "Contact"); iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("in Mail")); filter_data.SetValue(iter, 1, "MailMessage"); iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("in Web Pages")); filter_data.SetValue(iter, 1, "WebHistory"); iter = filter_data.Append(); filter_data.SetValue(iter, 0, Catalog.GetString("in Chats")); filter_data.SetValue(iter, 1, "IMLog"); Gtk.ComboBox combo = new Gtk.ComboBox(filter_data); combo.Active = 0; Gtk.CellRendererText renderer = new Gtk.CellRendererText(); combo.PackStart(renderer, false); combo.SetAttributes(renderer, new object[] { "text", 0 }); return(combo); }
private Gtk.ComboBox FilterComboBox () { filter_data = new Gtk.ListStore (new Type[] { typeof (string), typeof (string) }); Gtk.TreeIter iter; iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("Anywhere")); filter_data.SetValue (iter, 1, null); iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("in Files")); filter_data.SetValue (iter, 1, "File"); iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("in Addressbook")); filter_data.SetValue (iter, 1, "Contact"); iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("in Mail")); filter_data.SetValue (iter, 1, "MailMessage"); iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("in Web Pages")); filter_data.SetValue (iter, 1, "WebHistory"); iter = filter_data.Append (); filter_data.SetValue (iter, 0, Catalog.GetString ("in Chats")); filter_data.SetValue (iter, 1, "IMLog"); Gtk.ComboBox combo = new Gtk.ComboBox (filter_data); combo.Active = 0; Gtk.CellRendererText renderer = new Gtk.CellRendererText (); combo.PackStart (renderer, false); combo.SetAttributes (renderer, new object[] { "text", 0 }); return combo; }
void BuildLayout () { var primary_vbox = new VBox () { Spacing = 6 }; // Source selector var combo_align = new Alignment (0, .5f, 0, 0); var combo_hbox = new HBox (false, 6); combo_hbox.Add (new Label (Catalog.GetString ("Import from:"))); sources_combo = new ComboBox (sources_model); var render = new CellRendererText (); sources_combo.PackStart (render, true); sources_combo.SetAttributes (render, "text", 1); combo_hbox.Add (sources_combo); combo_align.Add (combo_hbox); combo_align.ShowAll (); primary_vbox.Add (combo_align); // Button row near the top var align = new Alignment (1, .5f, 0, 0); var button_box = new HButtonBox () { Spacing = 6 }; button_box.Add (cancel_button = new Button (Stock.Cancel)); button_box.Add (import_button = new Button (Stock.Add)); align.Add (button_box); align.ShowAll (); primary_vbox.Add (align); primary_vbox.Show (); Add (primary_vbox); }