Graphics macros: delete obsolete macros 26/14326/1
Paul Bignier [Thu, 3 Apr 2014 12:56:28 +0000 (14:56 +0200)]
Forgot to delete them in https://codereview.scilab.org/#/c/14266/

Change-Id: Ie33728aa09ce7c0742e0e57b8a148f9a6101dba2

scilab/modules/graphics/macros/getfont.sci [deleted file]
scilab/modules/graphics/macros/getlinestyle.sci [deleted file]
scilab/modules/graphics/macros/getmark.sci [deleted file]
scilab/modules/graphics/macros/getsymbol.sci [deleted file]

diff --git a/scilab/modules/graphics/macros/getfont.sci b/scilab/modules/graphics/macros/getfont.sci
deleted file mode 100644 (file)
index 921db42..0000000
+++ /dev/null
@@ -1,152 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) INRIA
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-
-
-function [fontId,fontSize]=getfont(S,v1)
-
-    //returns the clicked font id and font size.
-    fontId=[];fontSize=[];
-
-    warnobsolete("ged", "5.5.0");
-
-    if exists("S","local")==0 then S="a";end
-    if type(S)<>10 then
-        error(msprintf(gettext("%s: Wrong type for input argument #%d: String array expected.\n"), "getfont", 1));
-    end
-    S=part(S(1),1)
-
-    win=max(winsid()+1);
-    f=scf(win);
-
-    //fnts=xlfont();nf=size(find(fnts<>''),'*')-1
-    fontnames=["Courrier";"Symbol";"Times";"Times Italic";
-    "Times Bold";"Times Bold Italic";
-    "Helvetica";"Helvetica Italic";
-    "Helvetica Bold";"Helvetica Bold Italic"];
-
-    nf=size(fontnames,"*")
-
-    font_sz=[0.5 1:6];
-    nz=size(font_sz,"*"); //number of font sizes
-    //Disabling standard menus
-
-    addmenu(win,"Ok",list(2,"menu_ok"));
-    addmenu(win,"Cancel",list(2,"menu_cancel"));
-    delmenu(win,"&?")
-    delmenu(win,_("&Edit"))
-    delmenu(win,_("&Tools"))
-    delmenu(win,_("&File"))
-    toolbar(win,"off")
-    x=2;
-    red=addcolor([1 0 0]);
-    W1=6 //first column width
-    H1=2 // first row height
-    H=3.5;W=2.5;
-
-    Hdl=drawchart();
-
-    done=%f;
-
-    deff("menu_ok(k,gwin)","done=%t;k=[-fontId,fontSize];")
-    deff("menu_cancel(k,gwin)","done=%t;k=[];")
-
-    if exists("font","local") then
-        fontId=max(0,min(nf,font(1)))
-        fontSize=max(0,min(5,font(2)))
-        selected=fontId+nf*fontSize+1;
-        t=Hdl(selected); t.foreground=red;
-    else
-        selected=0
-    end
-
-    while %t
-
-        [c_i,cx,cy,cw,str]=xclick();
-
-        if c_i==-2 then
-            if strindex(str,"menu_ok")==1 then xdel(win);break,end
-            if strindex(str,"menu_cancel")==1 then xdel(win);break,end
-
-        elseif c_i==-1000 then
-            fontId=[];
-            fontSize=[];
-            break,
-
-        elseif c_i>=0 & c_i<=12 then
-            if selected<>0 then
-                t=Hdl(selected)
-                t.foreground=-1;
-            end
-
-            fontId=max(0,min(nf,floor((cy)/H)));
-            fontSize=max(0,min(nz,floor((cx-W1)/W)));
-            selected=fontId+nf*fontSize+1;
-            t=Hdl(selected);t.foreground=red;
-
-            xinfo("You have chosen fontId = "+string(fontId)+" , fontSize =  "+string(fontSize))
-
-        elseif c_i>=32 & c_i<1032 then
-            S=ascii(c_i)
-            drawlater();Hdl.text=S;drawnow()
-        elseif c_i>=1032
-            S=ascii(c_i-1000)
-            drawlater();Hdl.text=S;;drawnow()
-        end
-    end
-
-    if strindex(str,"menu_cancel")==1 then
-        fontId=[];
-        fontSize=[];
-    end
-
-    if argn(1)<2 then
-        fontId=[fontId,fontSize];
-    end
-
-endfunction
-
-function Hdl=drawchart()
-    f=gcf();
-    a=gca();
-    drawlater()
-    a.margins([1:2 4])=0.1
-    a.data_bounds=[0 0;W1+nz*W H1+(nf)*H]
-    a.title.text=["Click to select font Id  and font size";
-    "or press a key to select a character"];
-
-    // Drawing first column
-    for k=0:nf-1
-        xstringb(0,H*k,fontnames(k+1)+" ("+string(k)+")",W1,H)
-        xrect(0, H*(k+1), W1, H);
-    end
-
-    // Drawing first row
-    for l=0:nz-1
-        xstringb(W1+l*W,(nf)*H ,string(font_sz(l+1)),W,H1)
-        xrect(W1+l*W, H1+(nf)*H, W, H1);
-    end
-
-    // drawing top left corner
-    xrect(0,H1+(nf)*H,W1,H1);
-    xstringb(0, (nf)*H,"Id (index)\Size",W1,H1)
-
-    Hdl=[]
-    for k=-(0:nf-1)
-        Hdll=[]
-        for x=1:nz
-            xstringb(W1+(x-1)*W,-H*k,S,W,H)
-            t=gce();t.font_size=font_sz(x);t.font_style=-k
-            Hdll=[Hdll t]
-        end
-        Hdl=[Hdl;Hdll]
-    end
-
-    glue(Hdl)
-    drawnow()
-
-endfunction
diff --git a/scilab/modules/graphics/macros/getlinestyle.sci b/scilab/modules/graphics/macros/getlinestyle.sci
deleted file mode 100644 (file)
index ef84eb3..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) INRIA
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-
-
-function k=getlinestyle()
-    [lhs,rhs]=argn(0)
-
-    warnobsolete("ged", "5.5.0");
-
-    win=max(winsid()+1)
-    scf(win);
-
-    toolbar(win, "off");
-    delmenu(win,_("&File"));
-    delmenu(win,_("&Edit"));
-    delmenu(win,_("&Tools"));
-    delmenu(win,_("&?"));
-
-    //Event handler and menu definition
-    deff("evh(gwin,x,y,ibut)",..
-    ["global pos done"
-    "if or(ibut==(0:5)) then "
-    "   [x,y]=xchange(x,y,''i2f'')"
-    "   pos=[x,y],done=0,"
-    "end"
-    "if ibut==-1000 then ,done=3,end"
-    ])
-    deff("menu_ok(k,gwin)","global done;done=1")
-    deff("menu_cancel(k,gwin)","global done;done=2")
-
-
-    f=gcf();
-    cur_draw_mode = f.immediate_drawing;
-    f.immediate_drawing="off"
-    a=gca();
-    a.axes_visible="off";
-    a.data_bounds=[0 0;5 12];
-    a.font_size=3;
-    a.title.text = "Select line style k by clicking in rectangle or line";
-    a.title.font_size=3;
-
-    x=(1:5)';
-    R=[]
-    for k=1:6
-        xstringb(0,2*k-2,"k = "+string(k),1,2);
-        s=gce();
-        s.font_size=3;
-        xrect(0, 2*k, 1, 2);R=[R,gce()]
-    end
-    a.thickness=2
-    for k=1:6
-        xpoly(x,2*k*ones(x) - 1);
-        p=gce();
-        p.mark_mode = "off";
-        p.line_style=k;
-    end
-    f.immediate_drawing=cur_draw_mode;
-
-    global pos done;done=-1;
-    ksel=1;
-    seteventhandler("evh")
-    addmenu(win,"Ok",list(2,"menu_ok"));
-    addmenu(win,"Cancel",list(2,"menu_cancel"));
-
-    k1=[]; //default
-
-    while %t
-        select done
-        case 0 then //click somehere
-            cx = pos(1);
-            cy = pos(2);
-            k1 = ceil(cy/2);k1=min(k1,6);k1=max(1,k1);
-            drawlater();
-            R(ksel).thickness=1;
-            R(k1).thickness=3;
-            ksel=k1
-            drawnow();
-        case 1 then  // ok button clicked
-            k=k1;break,
-        case 2 then   // cancel button clicked
-            k=[];break,
-        case 3 then //the window has been blosed
-            k=[],
-            clearglobal pos done
-            return
-        end
-        xpause(100)
-    end
-    seteventhandler("")
-    delete(f);
-    clearglobal pos done
-endfunction
diff --git a/scilab/modules/graphics/macros/getmark.sci b/scilab/modules/graphics/macros/getmark.sci
deleted file mode 100644 (file)
index 73c994a..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) INRIA
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-
-
-function [k1,k2]=getmark()
-
-    //returns the clicked markid (with a minus sign)
-    //and mark size.
-    [lhs,rhs]=argn(0)
-    k1=[];k2=[];
-
-    warnobsolete("ged", "5.5.0");
-
-    win=max(winsid()+1);
-    f=scf(win)
-
-
-
-    nbMarks = 14;
-    nbSizes = 6;
-
-    delmenu(win,_("&File"));
-    delmenu(win,_("&Edit"));
-    delmenu(win,_("&Tools"));
-    delmenu(win,_("&?"));
-
-    toolbar(win, "off");
-
-    //Event handler and menu definition
-
-    deff("evh(gwin,x,y,ibut)",..
-    ["global pos done"
-    "if or(ibut==(0:5)) then "
-    "   [x,y]=xchange(x,y,''i2f'')"
-    "   pos=[x,y],done=0,"
-    "end"
-    "if ibut==-1000 then ,done=3,end"
-    ])
-
-    deff("menu_ok(k,gwin)","global done;done=1")
-    deff("menu_cancel(k,gwin)","global done;done=2")
-    drawlater()
-    f.axes_size = [610,610]
-    f.auto_resize="off"
-
-    a=gca();
-
-    a.axes_visible="off";
-    a.data_bounds=[0 0;10 30];
-    a.font_size=2;
-    a.mark_size_unit="tabulated"
-    a.margins=[0.04 0.06 0.05 0.1];
-
-    a.title.text = " Select mark style k and mark size l";
-    a.title.font_size = 3;
-    for k=0:nbMarks
-        xstringb(0,2*k - 2,"k = "+msprintf("%2d",k),1.5,2)
-        xrect(0, 2*k, 1.5, 2);
-    end
-
-    for l=1:nbSizes
-        xstringb(l*1.5, 28,"l = "+msprintf("%2d",l-1),1.5,2)
-        xrect(l*1.5, 30, 1.5, 2);
-    end
-
-    H=[]
-    for x=1:nbSizes
-        Hc=[]
-        for k=(0:nbMarks)
-            xpoly(0.75+x*1.5,2*k - 1,"marks");
-            p=gce();p.mark_size=x-1;p.mark_style=k;
-            Hc=[Hc;p];
-        end
-        H=[H Hc]
-    end
-    drawnow()
-    seteventhandler("evh")
-
-    addmenu(win,"Ok",list(2,"menu_ok"));
-    addmenu(win,"Cancel",list(2,"menu_cancel"));
-
-    global pos done;done=-1;
-    ksel=9;xsel=1;
-    //H(k1+1,(k2+1)).mark_foreground=5;
-    while %t
-        select done
-        case 0 then //click somehere
-            seteventhandler("");drawlater()
-            cx=pos(1);cy=pos(2)
-            k1=round((cy + 1)/2);k1=min(k1,nbMarks);k1=max(0,k1);
-            k2=round((cx + 0.75)/1.5);k2=k2-2;k2=min(k2,nbSizes - 1);k2=max(0,k2);
-            H(ksel+1,xsel+1).mark_foreground=-1;
-            H(k1+1,k2+1).mark_foreground=5;
-            ksel=k1;xsel=k2;
-            done=-1;
-            xinfo("You have chosen mark_style = "+string(k1)+", mark_size = "+string(k2))
-            drawnow();seteventhandler("evh")
-        case 1 then  // ok button clicked
-            k1=k1;k=[k1,k2];break,
-        case 2 then   // cancel button clicked
-            k=[];break,
-        case 3 then //the window has been blosed
-            k=[],if argn(1)==1 then k1=k,end
-            clearglobal pos done
-            return
-        end
-        xpause(100)
-    end
-    if argn(1)==1 then k1=k,end
-    seteventhandler("")
-    xdel(win)
-    clearglobal pos done
-endfunction
diff --git a/scilab/modules/graphics/macros/getsymbol.sci b/scilab/modules/graphics/macros/getsymbol.sci
deleted file mode 100644 (file)
index f16d656..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) INRIA
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
-
-function [rep] = getsymbol(Title)
-    [lhs,rhs] = argn(0)
-    if rhs<1 then
-        Title = "",
-    end;
-
-    warnobsolete("ged", "5.5.0");
-
-    marksIds = ["dot"
-    "plus"
-    "cross"
-    "star"
-    "filled diamond"
-    "diamond"
-    "triangle up"
-    "triangle down"
-    "diamond plus"
-    "circle"
-    "asterisk"
-    "square"
-    "triangle right"
-    "triangle left"
-    "pentagram"]'
-
-    fontsSiz = ["08","10","12","14","18","24"];
-    lmid = list("markId",1,marksIds);
-    lmsiz = list("marksize",1,fontsSiz);
-    xch_l = list(lmid,lmsiz);
-    entval = [lmid(2),lmsiz(2)];
-    rep = x_choices(Title,xch_l)-[1,1];
-
-endfunction
-