OSDN Git Service

enable
[psychlops/silverlight.git] / dev4 / psychlops / core / graphic / canvas.cs
index e037ef7..5b58b03 100644 (file)
@@ -47,7 +47,6 @@ namespace Psychlops
                        internal Group[] groupStack;\r
                        internal int groupStackN = 0;\r
 \r
-\r
                        public StackableDrawable()\r
                        {\r
                                stack = new Internal.PrimitiveFigure[CONST.MAX_OBJ_N];\r
@@ -71,8 +70,8 @@ namespace Psychlops
                                }\r
                                for (int i = 0; i < CONST.HOBJ_N; i++)\r
                                {\r
-                                       imageStack[i] = new Image(1, 1);\r
-                                       groupStack[i] = new Group();\r
+                                       imageStack[i] = new Image();\r
+//                                     groupStack[i] = new Group();\r
                                }\r
                        }\r
 \r
@@ -82,6 +81,7 @@ namespace Psychlops
                        public virtual void line(Line drawee) { drawee.copyToStack(this); }\r
                        public virtual void rect(Rectangle drawee) { drawee.copyToStack(this); }\r
                        public virtual void ellipse(Ellipse drawee) { drawee.copyToStack(this); }\r
+                       public virtual void oval(Ellipse drawee) { drawee.copyToStack(this); }\r
                        public virtual void polygon(Polygon drawee) { drawee.copyToStack(this); }\r
                        public virtual void letters(Letters drawee) { drawee.copyToStack(this); }\r
                        public virtual void image(Image drawee) { drawee.copyToStack(this); }\r
@@ -165,12 +165,15 @@ namespace Psychlops
                {\r
                        before = new Clock();\r
                        before.update();\r
+                       var after = new Clock();\r
                        AsyncInitBool = false;\r
                        width_ = wid;\r
                        height_ = hei;\r
                        api_canvas.Dispatcher.BeginInvoke(new TwoIntProcedure(initialize__), wid, hei);\r
-                       while(!AsyncInitBool)\r
+                       while (!AsyncInitBool)\r
                        {\r
+                               after.update();\r
+                               if ((after - before).at_msec() > 1000) break;\r
                        }\r
                        Mouse._prime = api_canvas;\r
                        Main.drawable = this;\r
@@ -179,7 +182,6 @@ namespace Psychlops
                        back_panel = new Rectangle(wid, hei);\r
 \r
                        flipexec = new SimpleProcedure(executeFlip);\r
-                       AppState.statusBar = "";\r
                }\r
                protected void initialize__(int wid, int hei)\r
                {\r
@@ -195,7 +197,7 @@ namespace Psychlops
                        HtmlElement htmlHost = HtmlPage.Document.GetElementById("silverlightControlHost");\r
                        //if (htmlHost != null) HtmlPage.Window.Alert("silverlightControlHost is null");\r
                        htmlHost.SetStyleAttribute("width", (wid).ToString()+"px");\r
-                       htmlHost.SetStyleAttribute("height", (20+hei).ToString() + "px");\r
+                       htmlHost.SetStyleAttribute("height", (hei).ToString() + "px");\r
                        htmlHost.SetStyleAttribute("margin", "2em auto auto auto");\r
 \r
                        pointPool = new System.Windows.Point[CONST.MOBJ_N];\r
@@ -251,7 +253,6 @@ namespace Psychlops
                                dummyRectPool[i].Visibility = Visibility.Collapsed;\r
                        }\r
 \r
-\r
                        AsyncInitBool = true;\r
                }\r
 \r
@@ -326,9 +327,9 @@ namespace Psychlops
                #region version modifyNative2\r
                public void executeFlip()\r
                {\r
-                       Clock after = new Clock();\r
-                       after.update();\r
-                       AppState.statusBar = ((after - before).at_msec().ToString()) + " msec";\r
+//                     Clock after = new Clock();\r
+//                     after.update();\r
+//                     AppState.statusBar = ((after - before).at_msec().ToString()) + " msec";\r
 \r
                        Line lineS;\r
                        Rectangle rectS;\r
@@ -466,6 +467,8 @@ namespace Psychlops
                }\r
                #endregion\r
 \r
+\r
+\r
                #region version modifyNative\r
                /*\r
                public void executeFlip()\r