[chronojump/FS-TFT-Menu] CairoBarplot shows message at capture start



commit da4120fc85241d2f125ef3563b0964a621fbb559
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 1 16:13:27 2022 +0200

    CairoBarplot shows message at capture start

 src/gui/app1/encoder.cs |  9 +++++++++
 src/gui/cairo/bars.cs   |  6 +++---
 src/gui/eventExecute.cs | 31 ++++++++++++++++++++++++-------
 3 files changed, 36 insertions(+), 10 deletions(-)
---
diff --git a/src/gui/app1/encoder.cs b/src/gui/app1/encoder.cs
index 24119e009..ba593e891 100644
--- a/src/gui/app1/encoder.cs
+++ b/src/gui/app1/encoder.cs
@@ -6191,9 +6191,18 @@ public partial class ChronoJumpWindow
                                if(encoder_capture_curves_bars_pixmap != null)
                                        UtilGtk.ErasePaint(encoder_capture_curves_bars_drawingarea, 
encoder_capture_curves_bars_pixmap);
 
+                               cairoPaintBarsPre = new CairoPaintBarplotPreEncoder (
+                                               encoder_capture_curves_bars_drawingarea_cairo,
+                                               preferences.fontType.ToString());//, "--capturing--");
+
                                if(encoderGraphDoPlot != null)
                                        encoderGraphDoPlot.ShowMessage(Catalog.GetString("Capturing") + " …", 
false, true);
 
+                               cairoPaintBarsPre.ShowMessage (
+                                               encoder_capture_curves_bars_drawingarea_cairo,
+                                               preferences.fontType.ToString(),
+                                               Catalog.GetString("Capturing") + " …");
+
                                encoderCaptureStringR = new List<string>();
                                encoderCaptureStringR.Add(
                                                ",series,exercise,mass,start,width,height," + 
diff --git a/src/gui/cairo/bars.cs b/src/gui/cairo/bars.cs
index 5f4f191ba..eedfb6dbf 100644
--- a/src/gui/cairo/bars.cs
+++ b/src/gui/cairo/bars.cs
@@ -988,7 +988,7 @@ public class CairoBars1Series : CairoBars
        private List<string> names_l;
 
        //constructor when there are no points
-       public CairoBars1Series (DrawingArea area, Type type, string font, string testsNotFoundMessage)
+       public CairoBars1Series (DrawingArea area, Type type, string font, string message)
        {
                this.area = area;
                this.type = type;
@@ -997,8 +997,8 @@ public class CairoBars1Series : CairoBars
                LogB.Information("constructor without points, area.GdkWindow is null:" + (area.GdkWindow == 
null).ToString());
                initGraph(font, 1); //.8 to have title at right
 
-               if(testsNotFoundMessage != "")
-                       writeMessageAtCenter(testsNotFoundMessage);
+               if(message != "")
+                       writeMessageAtCenter(message);
 
                endGraphDisposing(g, surface, area.GdkWindow);
        }
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index bb130f9dc..9336319d5 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -2145,6 +2145,7 @@ public abstract class CairoPaintBarsPre
        protected string testName;
        protected string title;
        protected int pDN; //preferences.digitsNumber
+       //protected string messageNoStoreCreated;
 
        protected void initialize (DrawingArea darea, string fontStr, Constants.Modes mode,
                        string personName, string testName, int pDN)
@@ -2178,6 +2179,10 @@ public abstract class CairoPaintBarsPre
        {
        }
 
+       public virtual void ShowMessage (DrawingArea darea, string fontTypeStr, string message)
+       {
+       }
+
        /*
        public void Prepare ()
        {
@@ -2194,7 +2199,7 @@ public abstract class CairoPaintBarsPre
                try {
                        new CairoBars1Series (darea, CairoBars.Type.NORMAL, fontStr, "");
                } catch {
-                       LogB.Information("saved crash at with cairo paint (blank screen)");
+                       LogB.Information("Saved crash at with cairo paint (blank screen)");
                }
        }
 
@@ -2204,14 +2209,21 @@ public abstract class CairoPaintBarsPre
                        return;
 
                if(! storeCreated())
+               {
+                       try {
+                               new CairoBars1Series (darea, CairoBars.Type.NORMAL, fontStr, ""); 
//messageNoStoreCreated);
+                       } catch {
+                               LogB.Information("saved crash at with cairo paint at !storeCreated");
+                       }
                        return;
+               }
 
                if(! haveDataToPlot())
                {
                        try {
                                new CairoBars1Series (darea, CairoBars.Type.NORMAL, fontStr, testsNotFound());
                        } catch {
-                               LogB.Information("saved crash at with cairo paint");
+                               LogB.Information("saved crash at with cairo paint at !haveDataToPlot");
                        }
                        return;
                }
@@ -3425,10 +3437,20 @@ public class CairoPaintBarplotPreEncoder : CairoPaintBarsPre
        {
                this.pegbe = pegbe;
                NewPreferences (preferences);
+               //messageNoStoreCreated = " no criteria ";
 
                initialize (darea, fontStr, mode, personName, testName, pDN);
        }
 
+       public override void ShowMessage (DrawingArea darea, string fontTypeStr, string message)
+       {
+               if(darea == null)
+                       return;
+
+               this.darea = darea;
+               cb = new CairoBars1Series (darea, CairoBars.Type.ENCODER, fontTypeStr, message);
+       }
+
        protected override bool storeCreated ()
        {
                //return (eventGraphEncoderBarplotStored != null);
@@ -3466,11 +3488,6 @@ public class CairoPaintBarplotPreEncoder : CairoPaintBarsPre
                */
        }
 
-       public void ShowMessage(string message, bool showLine, bool big)
-       {
-               //TODO
-       }
-
        private void fillDataVariables1 () //copied from gui/encoderGraphObjects fillDataVariables()
        {
                data = new ArrayList (pegbe.data9Variables.Count); //data is related to mainVariable (barplot)


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