[chronojump] Fixed checkboxes genericWin. Working on encoder gui



commit eb2239dca5ee660fd4444cb0966b266eda73f1df
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Mar 16 01:25:00 2013 +0100

    Fixed checkboxes genericWin. Working on encoder gui

 src/encoder.cs           |    2 +-
 src/gui/encoder.cs       |   19 +++++++++----------
 src/gui/genericWindow.cs |    9 ++++-----
 3 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/src/encoder.cs b/src/encoder.cs
index fdb8282..94cef8f 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -354,7 +354,7 @@ public class EncoderPersonCurvesInDB
        }
 
        public string [] ToStringArray() {
-               string [] s = { "", sessionID.ToString(), sessionName, sessionDate,
+               string [] s = { sessionID.ToString(), "", sessionName, sessionDate,
                        countActive.ToString(), countAll.ToString()
                };
                return s;
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index f6131b9..e109659 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -472,8 +472,7 @@ public partial class ChronoJumpWindow
                genericWin.Button_accept.Clicked -= new EventHandler(on_encoder_show_curves_done);
 
                //get selected/deselected rows
-               string [] checkboxes = genericWin.GetCheckboxesStatus(0, false);
-               //Log.WriteLine(Util.StringArrayToString(checkboxes,";"));
+               string [] checkboxes = genericWin.GetCheckboxesStatus(1, false);
 
                ArrayList data = SqliteEncoder.Select(
                                false, -1, currentPerson.UniqueID, currentSession.UniqueID, "curve", false);
@@ -537,7 +536,7 @@ public partial class ChronoJumpWindow
                        if(p.UniqueID != currentPerson.UniqueID) {
                                ArrayList eSQLarray = SqliteEncoder.Select(
                                                false, -1, p.UniqueID, currentSession.UniqueID, "curve", 
false); 
-                               string [] s = { "", p.UniqueID.ToString(), p.Name,
+                               string [] s = { p.UniqueID.ToString(), "", p.Name,
                                        getActiveCurvesNum(eSQLarray).ToString(), eSQLarray.Count.ToString()
                                };
                                data.Add(s);
@@ -554,7 +553,7 @@ public partial class ChronoJumpWindow
                foreach(string [] sPersons in data) {
                        bool found = false;
                        foreach(string s2 in encoderCompareInterperson)
-                               if(Util.FetchID(s2).ToString() == sPersons[1])
+                               if(Util.FetchID(s2).ToString() == sPersons[0])
                                        found = true;
 
                        if(found)
@@ -564,8 +563,8 @@ public partial class ChronoJumpWindow
                }                       
                        
                string [] columnsString = {
-                       Catalog.GetString("hiddennothing"),
-                       Catalog.GetString("Person ID"),
+                       Catalog.GetString("ID"),
+                       "",                             //checkboxes
                        Catalog.GetString("Person name"),
                        Catalog.GetString("Selected\ncurves"),
                        Catalog.GetString("All\ncurves")
@@ -608,7 +607,7 @@ public partial class ChronoJumpWindow
                                on_encoder_analyze_data_compare_interperson_done);
        
                encoderCompareInterperson = new ArrayList ();
-               string [] selectedID = genericWin.GetCheckboxesStatus(1,true);
+               string [] selectedID = genericWin.GetCheckboxesStatus(0,true);
                string [] selectedName = genericWin.GetCheckboxesStatus(2,true);
 
                for (int i=0 ; i < selectedID.Length ; i ++)
@@ -656,8 +655,8 @@ public partial class ChronoJumpWindow
                }                       
                        
                string [] columnsString = {
-                       Catalog.GetString("hiddennothing"),
-                       Catalog.GetString("Session ID"),
+                       Catalog.GetString("ID"),
+                       "",                             //checkboxes
                        Catalog.GetString("Session name"),
                        Catalog.GetString("Session date"),
                        Catalog.GetString("Selected\ncurves"),
@@ -707,7 +706,7 @@ public partial class ChronoJumpWindow
                                on_encoder_analyze_data_compare_intersession_done);
        
                encoderCompareIntersession = new ArrayList ();
-               string [] selectedID = genericWin.GetCheckboxesStatus(1,true);
+               string [] selectedID = genericWin.GetCheckboxesStatus(0,true);
                string [] selectedDate = genericWin.GetCheckboxesStatus(3,true);
 
                for (int i=0 ; i < selectedID.Length ; i ++)
diff --git a/src/gui/genericWindow.cs b/src/gui/genericWindow.cs
index 1035fec..3d59a9d 100644
--- a/src/gui/genericWindow.cs
+++ b/src/gui/genericWindow.cs
@@ -298,7 +298,7 @@ public class GenericWindow
                                } while ( store.IterNext(ref iter) );
                        } else {        //encoderExercises
                                do {
-                                       if(selected == (string) store.GetValue (iter, 2) &&
+                                       if(selected == (string) store.GetValue (iter, 3) &&
                                                        ! Util.FoundInArrayList(nonSensitiveRows, i))
                                                store.SetValue (iter, 1, true);
                                        else
@@ -381,8 +381,7 @@ Log.WriteLine("aaaaaaaaaaaaaaaa2");
                treeviewRemoveColumns();
                treeview.HeadersVisible=true;
                int i=0;
-               //bool visible = false;
-bool visible = true;
+               bool visible = false;
                foreach(string myCol in columnsString) {
                        if(addCheckbox && i == 1)
                                createCheckboxes(treeview);
@@ -435,7 +434,7 @@ bool visible = true;
                
        }
        
-       //if column == 0 returns checkboxes column. If is 1 returns column 1...
+       //if column == 1 returns checkboxes column. If is 2 returns column 2...
        public string [] GetCheckboxesStatus(int column, bool onlyActive) 
        {
                //to store active or inactive status of curves
@@ -446,7 +445,7 @@ bool visible = true;
                bool okIter = store.GetIterFirst(out iter);
                if(okIter) {
                        do {
-                               if(column == 0) {
+                               if(column == 1) {
                                        if((bool) store.GetValue (iter, 1))
                                                checkboxes[count++] = "active";
                                        else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]