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; }
protected void PopulateCategoryCombo() { SmugMugNet.Category[] categories = smugmug.GetCategories(); foreach (SmugMugNet.Category category in categories) { category_store.AppendValues(category.CategoryID, category.Title); } category_combo.Active = 0; category_combo.ShowAll(); }
private void populateComboBox(Database db) { // Set up the comboBox. CellRendererText combocell = new CellRendererText(); comboBox.PackStart(combocell, false); comboBox.AddAttribute(combocell, "text", 0); ListStore combostore = new ListStore(typeof(string)); comboBox.Model = combostore; // Take the names of the tables. for (int i = 0; i < db.Tables.Count; ++i) { Model.Table table = db.Tables[i]; combostore.AppendValues(table.Name); } comboBox.Changed += new EventHandler(OnComboBoxChanged); comboBox.ShowAll(); }
protected void createEncoderCombos() { //create combo exercises combo_encoder_exercise_capture = ComboBox.NewText (); combo_encoder_exercise_analyze = ComboBox.NewText (); createEncoderComboExerciseAndAnalyze(); combo_encoder_exercise_capture.Changed += new EventHandler (on_combo_encoder_exercise_capture_changed); combo_encoder_exercise_analyze.Changed += new EventHandler (on_combo_encoder_exercise_analyze_changed); /* ConcentricEccentric * unavailable until find while concentric data on concentric is the same than in ecc-con, * but is very different than in con-ecc */ //create combo eccon string [] comboEcconOptions = { Constants.Concentric, Constants.EccentricConcentric//, //Constants.ConcentricEccentric }; string [] comboEcconOptionsTranslated = { Catalog.GetString(Constants.Concentric), Catalog.GetString(Constants.EccentricConcentric)//, //Catalog.GetString(Constants.ConcentricEccentric) }; encoderEcconTranslation = new String [comboEcconOptions.Length]; //for(int j=0; j < 3 ; j++) for(int j=0; j < 2 ; j++) encoderEcconTranslation[j] = comboEcconOptions[j] + ":" + comboEcconOptionsTranslated[j]; combo_encoder_eccon = ComboBox.NewText (); UtilGtk.ComboUpdate(combo_encoder_eccon, comboEcconOptionsTranslated, ""); combo_encoder_eccon.Active = UtilGtk.ComboMakeActive(combo_encoder_eccon, Catalog.GetString(comboEcconOptions[0])); combo_encoder_eccon.Changed += new EventHandler (on_combo_encoder_eccon_changed); //create combo laterality. SqliteEncoder Inserts and Update in english. Select is done translated string [] comboLateralityOptions = { "RL", "R", "L" }; //attention: if this changes, change it also in encoder.cs (EncoderSQL) string [] comboLateralityOptionsTranslated = { Catalog.GetString("RL"), Catalog.GetString("R"), Catalog.GetString("L") }; encoderLateralityTranslation = new String [comboLateralityOptions.Length]; for(int j=0; j < 3 ; j++) encoderLateralityTranslation[j] = comboLateralityOptions[j] + ":" + comboLateralityOptionsTranslated[j]; combo_encoder_laterality = ComboBox.NewText (); UtilGtk.ComboUpdate(combo_encoder_laterality, comboLateralityOptionsTranslated, ""); combo_encoder_laterality.Active = UtilGtk.ComboMakeActive(combo_encoder_laterality, Catalog.GetString(comboLateralityOptions[0])); //create combo encoder anchorage combo_encoder_anchorage = Gtk.ComboBox.NewText(); combo_encoder_anchorage.Changed += new EventHandler(on_combo_encoder_anchorage_changed ); //create combo analyze cross createComboAnalyzeCross(true, false); //first creation, without "dateOnX" createComboEncoderAnalyzeWeights(true); //first creation //create combo analyze 1RM string [] comboAnalyze1RMOptions = { "1RM Any exercise", "1RM Bench Press", "1RM Squat", "1RM Indirect" }; string [] comboAnalyze1RMOptionsTranslated = { Catalog.GetString("1RM Any exercise"), Catalog.GetString("1RM Bench Press"), Catalog.GetString("1RM Squat"), Catalog.GetString("1RM Indirect") }; //if added more, change the int in the 'for' below encoderAnalyze1RMTranslation = new String [comboAnalyze1RMOptions.Length]; for(int j=0; j < 4 ; j++) encoderAnalyze1RMTranslation[j] = comboAnalyze1RMOptions[j] + ":" + comboAnalyze1RMOptionsTranslated[j]; combo_encoder_analyze_1RM = ComboBox.NewText (); UtilGtk.ComboUpdate(combo_encoder_analyze_1RM, comboAnalyze1RMOptionsTranslated, ""); combo_encoder_analyze_1RM.Active = UtilGtk.ComboMakeActive(combo_encoder_analyze_1RM, Catalog.GetString(comboAnalyze1RMOptions[0])); combo_encoder_analyze_1RM.Changed += new EventHandler (on_combo_encoder_analyze_1RM_changed); //create combo analyze curve num combo //is not an spinbutton because values can be separated: "3,4,7,21" combo_encoder_analyze_curve_num_combo = ComboBox.NewText (); UtilGtk.ComboUpdate(combo_encoder_analyze_curve_num_combo, Util.StringToStringArray(""), ""); //pack combos hbox_combo_encoder_exercise_capture.PackStart(combo_encoder_exercise_capture, true, true, 0); hbox_combo_encoder_exercise_capture.ShowAll(); combo_encoder_exercise_capture.Sensitive = true; hbox_combo_encoder_exercise_analyze.PackStart(combo_encoder_exercise_analyze, true, true, 0); //hbox_combo_encoder_exercise_analyze.ShowAll(); //hbox will be shown only on intersession & interperson combo_encoder_exercise_analyze.ShowAll(); combo_encoder_exercise_analyze.Sensitive = true; hbox_combo_encoder_eccon.PackStart(combo_encoder_eccon, true, true, 0); hbox_combo_encoder_eccon.ShowAll(); combo_encoder_eccon.Sensitive = true; hbox_combo_encoder_laterality.PackStart(combo_encoder_laterality, true, true, 0); hbox_combo_encoder_laterality.ShowAll(); combo_encoder_laterality.Sensitive = true; hbox_combo_encoder_anchorage.PackStart(combo_encoder_anchorage, false, true, 0); hbox_combo_encoder_anchorage.ShowAll(); combo_encoder_anchorage.Sensitive = true; hbox_combo_encoder_analyze_1RM.PackStart(combo_encoder_analyze_1RM, true, true, 0); hbox_combo_encoder_analyze_1RM.ShowAll(); combo_encoder_analyze_1RM.Sensitive = true; hbox_combo_encoder_analyze_1RM.Visible = false; //do not show hbox at start hbox_combo_encoder_analyze_curve_num_combo.PackStart(combo_encoder_analyze_curve_num_combo, true, true, 0); hbox_combo_encoder_analyze_curve_num_combo.ShowAll(); combo_encoder_analyze_curve_num_combo.Sensitive = true; hbox_combo_encoder_analyze_curve_num_combo.Visible = false; //do not show hbox at start }