Пример #1
0
    //can be done manually by clicking on add
    //or automatically when loading sequence
    private void on_button_add_exercise_do(int selectedPos, int treeviewNum)
    {
        TrCombo tc = (TrCombo)selectArray[selectedPos];

        //Log.WriteLine(tc.ToString());

        if (treeviewNum == 1)
        {
            treeviewSerie1Array.Add(tc);
            UtilGtk.TreeviewAddRow(treeview_serie1, store_serie1,
                                   new String [] { treeviewSerie1Array.Count.ToString(), tc.trName }, false);       //at end
        }
        else if (treeviewNum == 2)
        {
            treeviewSerie2Array.Add(tc);
            UtilGtk.TreeviewAddRow(treeview_serie2, store_serie2,
                                   new String [] { treeviewSerie2Array.Count.ToString(), tc.trName }, false);       //at end
        }
        else
        {               //treeviewNum == 3
            treeviewSerie3Array.Add(tc);
            UtilGtk.TreeviewAddRow(treeview_serie3, store_serie3,
                                   new String [] { treeviewSerie3Array.Count.ToString(), tc.trName }, false);       //at end
        }

        button_save.Sensitive = (treeviewSerie1Array.Count > 0 && entry_save_name.Text.ToString().Length > 0);

        //a test is added, sensitivize "next" button
        button_next.Sensitive = true;
    }
Пример #2
0
    private void createComboSelect()
    {
        combo_select = ComboBox.NewText();

        selectArray = new ArrayList(jumpTypes.Length);
        string [] jumpNamesToCombo = new String [jumpTypes.Length];
        int       i = 0;

        foreach (string jumpType in jumpTypes)
        {
            string [] j = jumpType.Split(new char[] { ':' });
            string    nameTranslated = Catalog.GetString(j[1]);

            jumpNamesToCombo[i] = nameTranslated;
            i++;

            ArrayList options = new ArrayList(3);
            options.Add("startIn:" + j[2]);                     //startIn
            options.Add("weight:" + j[3]);                      //weight
            options.Add("description:" + j[4]);                 //description
            TrCombo tc = new TrCombo(
                Convert.ToInt32(j[0]), j[1],                    //uniqueID, name
                nameTranslated, options);
            selectArray.Add(tc);
        }

        UtilGtk.ComboUpdate(combo_select, jumpNamesToCombo, "");
        combo_select.Active = 0;

        hbox_combo_select.PackStart(combo_select, true, true, 0);
        hbox_combo_select.ShowAll();
    }
Пример #3
0
    private void createComboSelect()
    {
        combo_select = ComboBox.NewText ();

        selectArray = new ArrayList(jumpTypes.Length);
        string [] jumpNamesToCombo = new String [jumpTypes.Length];
        int i =0;
        foreach(string jumpType in jumpTypes) {
            string [] j = jumpType.Split(new char[] {':'});
            string nameTranslated = Catalog.GetString(j[1]);

            jumpNamesToCombo[i] = nameTranslated;
            i++;

            ArrayList options = new ArrayList(3);
            options.Add("startIn:" + j[2]); 	//startIn
            options.Add("weight:" + j[3]);		//weight
            options.Add("description:" + j[4]);	//description
            TrCombo tc = new TrCombo(
                    Convert.ToInt32(j[0]), j[1], 		//uniqueID, name
                    nameTranslated, options);
            selectArray.Add(tc);
        }

        UtilGtk.ComboUpdate(combo_select, jumpNamesToCombo, "");
        combo_select.Active = 0;

        hbox_combo_select.PackStart(combo_select, true, true, 0);
        hbox_combo_select.ShowAll();
    }