* Bug 15067 fixed: adds D&D of XMI files
[scilab.git] / scilab / modules / graphics / macros / datatips / datatipRadioCallback.sci
1 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 // Copyright (C) 2010 - INRIA - Serge Steer <serge.steer@inria.fr>
3 //
4 // Copyright (C) 2012 - 2016 - Scilab Enterprises
5 //
6 // This file is hereby licensed under the terms of the GNU GPL v2.0,
7 // pursuant to article 5.3.4 of the CeCILL v.2.1.
8 // This file was originally licensed under the terms of the CeCILL v2.1,
9 // and continues to be available under such terms.
10 // For more information, see the COPYING file which you should have received
11 // along with this program.
12
13 function datatipRadioCallback(key,v)
14     global datatipGUIHandles datatipGUICurve
15     Keys=["sty" "lab" "box" "pos" "mul"]
16     i=find(key==Keys)
17     if v then
18         datatipGUIHandles(i,1).value=1
19         datatipGUIHandles(i,2).value=0
20     else
21         datatipGUIHandles(i,1).value=0
22         datatipGUIHandles(i,2).value=1
23     end
24     if i<=3 then
25         ud=datatipGetStruct(datatipGUICurve)
26         style=ud.style
27     end
28     select key
29     case "sty"
30         style(1)=bool2s(~v)+1
31     case "lab"
32         style(3)=bool2s(v)
33     case "box"
34         style(2)=bool2s(v)
35     case "pos"
36         datatipSetInterp(datatipGUICurve,~v);
37     case "mul"
38         datatipSetReplaceMode(datatipGUICurve,~v);
39     end
40
41     if i<=3 then
42         ud.style=style
43         datatipSetStruct(datatipGUICurve,ud)
44         fig=datatipGUICurve.parent
45         while fig.type<>"Figure" then fig=fig.parent,end
46         id=fig.immediate_drawing;
47         fig.immediate_drawing="off"
48         for i=1:size(ud.tips.children,"*")
49             datatipSetTipStyle(ud.tips.children(i),style)
50         end
51         fig.immediate_drawing=id
52     end
53 endfunction