OSDN Git Service

slider
[psychlops/silverlight.git] / dev3 / psychlops / core / graphic / canvas.cs
index bffa5c4..0df4d7b 100644 (file)
@@ -72,10 +72,10 @@ namespace Psychlops
                        public void msg(string str, double x, double y) { msg(str, x, y, Color.white); }\r
                        public virtual void msg(string str, double x, double y, Color col)\r
                        {\r
-                               var let = new Letters(str);\r
-                               let.locate(x, y);\r
-                               let.fill = col;\r
-                               this.letters(let);\r
+                               //var let = new Letters(str);\r
+                               //let.locate(x, y);\r
+                               //let.fill = col;\r
+                               //this.letters(let);\r
                        }\r
                        public void var<Type>(Type val, double x, double y) { msg(val.ToString(), x, y, Color.white); }\r
                        public void var<Type>(Type val, double x, double y, Color col) { msg(val.ToString(), x, y, col); }\r
@@ -186,7 +186,7 @@ namespace Psychlops
                        rect(back_panel);\r
                }\r
 \r
-               int nextIntervalFrame = 1;\r
+               int nextIntervalFrame = 1, chacked = 0;\r
                public void flip()\r
                {\r
                        //api_canvas.Dispatcher.BeginInvoke(flipexec);\r
@@ -195,6 +195,7 @@ namespace Psychlops
                        lock (this)\r
                        {\r
                                nextIntervalFrame = 1;\r
+                               chacked = 1;\r
                        }\r
                        Internal.Main.canvas_flag.WaitOne();\r
                }\r
@@ -206,18 +207,26 @@ namespace Psychlops
                        }\r
                        if (nextIntervalFrame <= 0)\r
                        {\r
-                               var tmp = new System.Windows.Controls.Canvas();\r
-                               if (stack.Count > 0)\r
+                               //Psychlops.AppState.statusBar = chacked.ToString();\r
+                               if (chacked > 0)\r
                                {\r
-                                       foreach (Internal.PrimitiveFigure f in stack)\r
+                                       var tmp = new System.Windows.Controls.Canvas();\r
+                                       if (stack.Count > 0)\r
                                        {\r
-                                               tmp.Children.Add(f.toNative());\r
+                                               foreach (Internal.PrimitiveFigure f in stack)\r
+                                               {\r
+                                                       tmp.Children.Add(f.toNative());\r
+                                               }\r
                                        }\r
+                                       api_canvas.Children.Clear();\r
+                                       api_canvas.Children.Add(tmp);\r
+                                       stack.Clear();\r
+                                       lock (this)\r
+                                       {\r
+                                               chacked = 0;\r
+                                       }\r
+                                       Psychlops.Internal.Main.canvas_flag.Set();\r
                                }\r
-                               api_canvas.Children.Clear();\r
-                               api_canvas.Children.Add(tmp);\r
-                               stack.Clear();\r
-                               Psychlops.Internal.Main.canvas_flag.Set();\r
                        }\r
                        System.Threading.Thread.Sleep(0);\r
                }\r