[chronojump] Jump simple tests barchart selection will select on treeview. Mouse limits correctly mixed tests wit



commit f8022965db4304794ab4d598f47fa594acac3a69
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Apr 25 11:26:24 2022 +0200

    Jump simple tests barchart selection will select on treeview. Mouse limits correctly mixed tests with two 
bars with on bar

 src/gui/cairo/bars.cs   | 13 +++++++++----
 src/gui/eventExecute.cs | 25 +++++++++++++++++++------
 2 files changed, 28 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/cairo/bars.cs b/src/gui/cairo/bars.cs
index eef4c3645..e62d30200 100644
--- a/src/gui/cairo/bars.cs
+++ b/src/gui/cairo/bars.cs
@@ -1670,10 +1670,6 @@ public class CairoBarsNHSeries : CairoBars
 
                                        drawRoundedRectangle (true, x + adjustX, y, barWidth, graphHeight -y 
-bottomMargin, 4, g, barColor);
                                        resultOnBarsThisIteration_l.Add(new Point3F(x + adjustX + barWidth/2, 
y-4, pS.Y));
-                                       //add for the secondary and for the main bar, no problem both will 
work
-                                       mouseLimits.AddInPos (mouseLimitsPos1stBar, x+adjustX, 
x+adjustX+barWidth);
-                                       mouseLimitsPos1stBar += 2;
-
                                        //to print line variable if needed
                                        //barsXCenter_l.Add(x + adjustX + barWidth/2);
 
@@ -1697,6 +1693,15 @@ public class CairoBarsNHSeries : CairoBars
                                        secondaryHasData = true;
                                }
 
+                               //mouse limits stuff
+                               if(pS.Y > 0)
+                                       mouseLimits.AddInPos (mouseLimitsPos1stBar, x+adjustX, 
x+adjustX+barWidth);
+                               else {
+                                       //add it 0 width, to respect order when DJs are mixed with CMJs, but 
not be able to be selected
+                                       mouseLimits.AddInPos (mouseLimitsPos1stBar, x+adjustX, x+adjustX);
+                               }
+                               mouseLimitsPos1stBar += 2;
+
                                adjustX += barWidth;
                        }
 
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index 0b039e901..20eaa4fa2 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -579,7 +579,9 @@ public partial class ChronoJumpWindow
        private void on_event_execute_drawingarea_cairo_button_press_event (object o, ButtonPressEventArgs 
args)
        {
                LogB.Information("on_event_execute_drawingarea_cairo_button_press_event");
-               if (current_mode != Constants.Modes.JUMPSREACTIVE &&
+               if (
+                               current_mode != Constants.Modes.JUMPSSIMPLE &&
+                               current_mode != Constants.Modes.JUMPSREACTIVE &&
                                current_mode != Constants.Modes.RUNSSIMPLE &&
                                current_mode != Constants.Modes.RUNSINTERVALLIC)
                        return;
@@ -595,7 +597,12 @@ public partial class ChronoJumpWindow
                if(id < 0)
                        return;
 
-               if (current_mode == Constants.Modes.JUMPSREACTIVE && myTreeViewJumpsRj != null)
+               if (current_mode == Constants.Modes.JUMPSSIMPLE && myTreeViewJumps != null)
+               {
+                       myTreeViewJumps.ZoomToTestsIfNeeded ();
+                       myTreeViewJumps.SelectEvent (id, true); //scroll
+               }
+               else if (current_mode == Constants.Modes.JUMPSREACTIVE && myTreeViewJumpsRj != null)
                {
                        myTreeViewJumpsRj.ZoomToTestsIfNeeded ();
                        myTreeViewJumpsRj.SelectEvent (id, true); //scroll
@@ -605,7 +612,6 @@ public partial class ChronoJumpWindow
                {
                        myTreeViewRuns.ZoomToTestsIfNeeded ();
                        myTreeViewRuns.SelectEvent (id, true); //scroll
-                       on_treeview_runs_cursor_changed (new object (), new EventArgs ()); //in order to 
update top graph
                }
                else if (current_mode == Constants.Modes.RUNSINTERVALLIC && myTreeViewRunsInterval != null)
                {
@@ -2616,11 +2622,11 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
                        UseHeights = false;
 
                if(showBarA && showBarB) //Dja, Djna
-                       cb = new CairoBarsNHSeries (darea, CairoBars.Type.NORMAL, true, false, true, true);
+                       cb = new CairoBarsNHSeries (darea, CairoBars.Type.NORMAL, true, true, true, true);
                else if (showBarA) //takeOff, takeOffWeight
-                       cb = new CairoBars1Series (darea, CairoBars.Type.NORMAL, false, true, true);
+                       cb = new CairoBars1Series (darea, CairoBars.Type.NORMAL, true, true, true);
                else //rest of the jumps: sj, cmj, ..
-                       cb = new CairoBars1Series (darea, CairoBars.Type.NORMAL, false, true, true);
+                       cb = new CairoBars1Series (darea, CairoBars.Type.NORMAL, true, true, true);
 
                if(UseHeights) {
                        cb.YVariable = Catalog.GetString("Height");
@@ -2670,6 +2676,7 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
                List<PointF> pointA_l = new List<PointF>();
                List<PointF> pointB_l = new List<PointF>();
                List<string> names_l = new List<string>();
+               List<int> id_l = new List<int>(); //the uniqueIDs for knowing them on bar selection
 
                int countToDraw = eventGraphJumpsStored.jumpsAtSQL.Count;
                foreach(Jump jump in eventGraphJumpsStored.jumpsAtSQL)
@@ -2699,8 +2706,14 @@ public class CairoPaintBarsPreJumpSimple : CairoPaintBarsPre
                                                jump.Description,
                                                thereIsASimulated, (jump.Simulated == -1),
                                                longestWord.Length, maxRowsForText));
+
+                       id_l.Add(jump.UniqueID);
+                       if(showBarA && showBarB) //there are jumps like Dja, Djna
+                               id_l.Add(jump.UniqueID);
                }
 
+               cb.Id_l = id_l;
+
                cb.PassGuidesData (new CairoBarsGuideManage(
                                        ! ShowPersonNames, true, //usePersonGuides, useGroupGuides
                                        eventGraphJumpsStored.sessionMAXAtSQL,


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