Bug 12700 fixed: edit_curv function and CURV_f was broken 13/14513/3
steer [Wed, 19 Jun 2013 15:53:21 +0000 (17:53 +0200)]
Change-Id: Ie8c3162a1c7f329f8afd7aec4552d3a17a78def5

scilab/CHANGES_5.5.X
scilab/modules/graphics/macros/edit_curv.sci

index 70d449b..1102492 100644 (file)
@@ -8,6 +8,8 @@ Scilab Bug Fixes
 
 * Bug #10555 fixed - Scilab failed to build with some configure options.
 
+* Bug #12700 fixed - edit_curv (used by CURV_f) was broken.
+
 * Bug #13291 fixed - xmltojar([],[],'ja_JP') might lead to a crash when the
                      locale was not available system-wide.
 
index 03043e0..7391df5 100644 (file)
@@ -99,7 +99,7 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
 
     // Set menus and callbacks
     menu_d = ["Read","Save","Clear"]
-    menu_e = ["Undo","Size","Ok","Abort"]
+    menu_e = ["Undo","Size","Replot","Ok","Abort"]
     menus  = list(["Edit","Data"],menu_e,menu_d)
     w="menus(2)(";rpar=")"
     Edit=w(ones(menu_e))+string(1:size(menu_e,"*"))+rpar(ones(menu_e))
@@ -157,13 +157,13 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
         case "Ok" then    //    -- ok menu
             rect = matrix(a.data_bounds',1,4);
             gc   = list(rect,axisdata);
-            xdel(curwin);
+            delete(f)
             return;
 
         case "Abort" then //    -- abort menu
             x = xsav
             y = ysav
-            xdel(curwin)
+            delete(f)
             ok = %f;
             return
 
@@ -174,9 +174,8 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
             return
 
         case "Undo" then
-            if hdl<>[] then hdl.visible = "on";end //erase
             x=xs;y=ys
-            if x<>[] then hdl.data=[x y];hdl.visible = "on";end
+            if x<>[] then hdl.data=[x y]; end
 
         case "Size" then
             while %t
@@ -199,15 +198,6 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
                 a.data_bounds=[rect(1),rect(2);rect(3),rect(4)]
             end
 
-        case "Grids" then //no more used
-            rep=x_mdialog("entrez les nouveaux nombres d''intervalles",..
-            ["axe des x";"axe des y"],..
-            string([axisdata(2);axisdata(4)]))
-            if rep<>[] then
-                rep=evstr(rep)
-                axisdata(2)=rep(1);axisdata(4)=rep(2);
-            end
-
         case "Clear" then
             if hdl<>[] then delete(hdl),hdl=[];end
             x=[];y=[];
@@ -240,6 +230,9 @@ function [x,y,ok,gc]=edit_curv(x,y,job,tit,gc)
         case "Save" then
             savexy(x,y)
 
+        case "Replot" then
+            // for compatibility only, perform nothing on purpose
+
         case "edit" then
             npt=prod(size(x))
             if npt<>0 then
@@ -333,7 +326,7 @@ function [x,y] = addpt(c1,x,y)
                 pp=pp(:,i)
                 x=x([1:k k:npt]);x(k+1)=pp(1);
                 y=y([1:k k:npt]);y(k+1)=pp(2);
-                hdl;drawlater();hdl.data=[x y];hdl.visible = "on"; drawnow();
+                hdl.data=[x y];
                 return
             end
         end
@@ -349,7 +342,7 @@ function [x,y] = addpt(c1,x,y)
         x(npt+1)=c1(1)
         y(npt+1)=c1(2)
     end
-    hdl;drawlater();hdl.data=[x y];hdl.visible = "on"; drawnow();
+    hdl.data=[x y];
 endfunction
 
 function [x,y]=movept(x,y)