summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
Diffstat (limited to 'macros')
-rw-r--r--macros/cb_sci2c_gui.sci18
-rw-r--r--macros/sci2c_gui.sci163
-rw-r--r--macros/scilab2c.sci5
3 files changed, 97 insertions, 89 deletions
diff --git a/macros/cb_sci2c_gui.sci b/macros/cb_sci2c_gui.sci
index 1c426f62..d23bba34 100644
--- a/macros/cb_sci2c_gui.sci
+++ b/macros/cb_sci2c_gui.sci
@@ -36,12 +36,12 @@ elseif get(gcbo,"tag")=="subfunsbtn" then
//
// --- Header file ---
//
-elseif get(gcbo,"tag")=="headerbtn" then
+// elseif get(gcbo,"tag")=="headerbtn" then
- filename = uigetfile("*.h", getcwd(), gettext("Select SciLib main header file"));
- if ~isempty(filename) then
- set(findobj("tag", "headeredit"), "string", filename);
- end
+// filename = uigetfile("*.h", getcwd(), gettext("Select SciLib main header file"));
+// if ~isempty(filename) then
+// set(findobj("tag", "headeredit"), "string", filename);
+// end
//
// --- Output directory ---
@@ -99,7 +99,7 @@ elseif get(gcbo, "tag")=="convertbtn" then
UserSciFilesPaths = get(findobj("tag", "subfunsedit"), "string");
- Sci2CLibMainHeaderFName = get(findobj("tag", "headeredit"), "string");
+// Sci2CLibMainHeaderFName = get(findobj("tag", "headeredit"), "string");
UserSciCodeMainDir = get(findobj("tag", "outedit"), "string");
@@ -117,13 +117,13 @@ elseif get(gcbo, "tag")=="convertbtn" then
CCompilerPathStyle = "windows";
elseif get(findobj("tag", "pathsradiounix"), "value") == 1 then
CCompilerPathStyle = "unix";
- else
- CCompilerPathStyle = "cygwin";
+// else
+// CCompilerPathStyle = "cygwin";
end
mprintf("UserScilabMainFile = {%s}\n", UserScilabMainFile);
mprintf("UserSciFilesPaths = {%s}\n", UserSciFilesPaths);
- mprintf("Sci2CLibMainHeaderFName = {%s}\n", Sci2CLibMainHeaderFName);
+// mprintf("Sci2CLibMainHeaderFName = {%s}\n", Sci2CLibMainHeaderFName);
mprintf("UserSciCodeMainDir = {%s}\n", UserSciCodeMainDir);
mprintf("RunMode = {%s}\n", RunMode);
mprintf("CopySciCodeIntoCCode = {%d}\n", bool2s(CopySciCodeIntoCCode));
diff --git a/macros/sci2c_gui.sci b/macros/sci2c_gui.sci
index ab541d33..cfff829f 100644
--- a/macros/sci2c_gui.sci
+++ b/macros/sci2c_gui.sci
@@ -1,11 +1,11 @@
//
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2009 - INRIA - Vincent COUVERT
-//
+// Copyright (C) 2009 - INRIA - Vincent COUVERT
+//
// 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
+// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
//
@@ -37,7 +37,7 @@ uimenu("parent", h, "label", gettext("Sci2c help page"), "callback", "cb_sci2c_g
uimenu("parent", h, "label", gettext("About SCI2C tools..."), "callback", "cb_sci2c_gui", "tag", "about_sci2c_menu");
figw = 500;
-figh = 17*margin + btnh + 7*widgeth;
+figh = 15*margin + btnh + 6*widgeth;
sci2cfig.axes_size = [figw figh];
sci2cfig.auto_resize = "off";
sci2cfig.visible = "off"; // to be sure that no plot can appear in the window
@@ -104,7 +104,7 @@ pathslabel = uicontrol("parent", sci2cfig,...
"horizontalalignment", "left",...
"fontname", defaultfont,...
"fontunits", "points",...
- "fontsize", 12);
+ "fontsize", 12);
pathsradiowin = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("Windows"),...
@@ -115,9 +115,8 @@ pathsradiowin = uicontrol("parent", sci2cfig,...
"fontsize", 12,...
"min", 0, ...
"max", 1, ...
- "value", 1,...
"callback", "cb_sci2c_gui",...
- "tag", "pathsradiowin");
+ "tag", "pathsradiowin");
pathsradiounix = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("Unix"),...
@@ -128,22 +127,28 @@ pathsradiounix = uicontrol("parent", sci2cfig,...
"fontsize", 12,...
"min", 0, ...
"max", 1, ...
- "value", 0,...
- "callback", "cb_sci2c_gui",...
- "tag", "pathsradiounix");
-pathsradiocygwin = uicontrol("parent", sci2cfig,...
- "style", "radiobutton",...
- "string", gettext("Cygwin"),...
- "position",[2*margin+160+2*radiow pathsy radiow widgeth],...
- "horizontalalignment", "left",...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 12,...
- "min", 0, ...
- "max", 1, ...
- "value", 0,...
"callback", "cb_sci2c_gui",...
- "tag", "pathsradiocygwin");
+ "tag", "pathsradiounix");
+if MSDOS
+ set(pathsradiowin, "value", 1);
+ set(pathsradiounix, "value", 0);
+else
+ set(pathsradiowin, "value", 0);
+ set(pathsradiounix, "value", 1);
+end
+// pathsradiocygwin = uicontrol("parent", sci2cfig,...
+// "style", "radiobutton",...
+// "string", gettext("Cygwin"),...
+// "position",[2*margin+160+2*radiow pathsy radiow widgeth],...
+// "horizontalalignment", "left",...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 12,...
+// "min", 0, ...
+// "max", 1, ...
+// "value", 0,...
+// "callback", "cb_sci2c_gui",...
+// "tag", "pathsradiocygwin");
// --- Copy Scilab code into C option ---
sciintocy = pathsy + margin + btnh ;
@@ -154,7 +159,7 @@ sciintoclabel = uicontrol("parent", sci2cfig,...
"horizontalalignment", "left",...
"fontname", defaultfont,...
"fontunits", "points",...
- "fontsize", 12);
+ "fontsize", 12);
sciintocradioyes = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("Yes"),...
@@ -167,7 +172,7 @@ sciintocradioyes = uicontrol("parent", sci2cfig,...
"max", 1, ...
"value", 0,...
"callback", "cb_sci2c_gui",...
- "tag", "sciintocradioyes");
+ "tag", "sciintocradioyes");
sciintocradiono = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("No"),...
@@ -180,7 +185,7 @@ sciintocradiono = uicontrol("parent", sci2cfig,...
"max", 1, ...
"value", 1,...
"callback", "cb_sci2c_gui",...
- "tag", "sciintocradiono");
+ "tag", "sciintocradiono");
// --- Run mode option ---
runy = sciintocy + margin + widgeth;
@@ -191,7 +196,7 @@ runlabel = uicontrol("parent", sci2cfig,...
"horizontalalignment", "left",...
"fontname", defaultfont,...
"fontunits", "points",...
- "fontsize", 12);
+ "fontsize", 12);
runradioall = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("All"),...
@@ -202,9 +207,9 @@ runradioall = uicontrol("parent", sci2cfig,...
"fontsize", 12,...
"min", 0, ...
"max", 1, ...
- "value", 0,...
+ "value", 1,...
"callback", "cb_sci2c_gui",...
- "tag", "runradioall");
+ "tag", "runradioall");
runradiotranslate = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("Translate"),...
@@ -217,7 +222,7 @@ runradiotranslate = uicontrol("parent", sci2cfig,...
"max", 1, ...
"value", 0,...
"callback", "cb_sci2c_gui",...
- "tag", "runradiotranslate");
+ "tag", "runradiotranslate");
runradiogenlib = uicontrol("parent", sci2cfig,...
"style", "radiobutton",...
"string", gettext("Generate library"),...
@@ -228,9 +233,9 @@ runradiogenlib = uicontrol("parent", sci2cfig,...
"fontsize", 12,...
"min", 0, ...
"max", 1, ...
- "value", 1,...
+ "value", 0,...
"callback", "cb_sci2c_gui",...
- "tag", "runradiogenlib");
+ "tag", "runradiogenlib");
// ------------------------
// --- Output directory ---
@@ -290,59 +295,59 @@ outbtn = uicontrol("parent", sci2cfig,...
// -------------------------------
// Frame
outframemaxy = optframemaxy + 2*margin + widgeth + margin;
-headerframe = uicontrol("parent", sci2cfig,...
- "relief", "groove",...
- "style", "frame",...
- "units", "pixels",...
- "position", [margin outframemaxy+margin figw-2*margin widgeth+2*margin],...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 12,...
- "fontweight", "bold", ...
- "horizontalalignment", "center");
-// Frame title
-headertitle = uicontrol("parent", sci2cfig,...
- "style", "text",...
- "string", gettext("Scilab library header"),...
- "units", "pixels",...
- "position", [2*margin outframemaxy+margin+widgeth+2*margin-8 110 14],...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 11,...
- "horizontalalignment", "center");
-headerlabel = uicontrol("parent", sci2cfig,...
- "style", "text",...
- "string", gettext("File name: "),...
- "position",[2*margin outframemaxy+2*margin-1 100 widgeth],...
- "horizontalalignment", "left",...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 12);
-headeredit = uicontrol("parent", sci2cfig,...
- "style", "edit",...
- "string", gettext("<enter a file name>"),...
- "units", "pixels",...
- "position",[3*margin+100 outframemaxy+2*margin-1 figw-6*margin-100-btnw widgeth],...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 12, ...
- "tag", "headeredit");
-headerbtn = uicontrol("parent", sci2cfig,...
- "backgroundcolor", [0.8 0.8 0.8],...
- "style", "pushbutton",...
- "string", gettext("Browse"),...
- "position",[figw-2*margin-btnw outframemaxy+2*margin btnw btnh],...
- "fontname", defaultfont,...
- "fontunits", "points",...
- "fontsize", 12,...
- "callback", "cb_sci2c_gui",...
- "tag", "headerbtn");
+// headerframe = uicontrol("parent", sci2cfig,...
+// "relief", "groove",...
+// "style", "frame",...
+// "units", "pixels",...
+// "position", [margin outframemaxy+margin figw-2*margin widgeth+2*margin],...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 12,...
+// "fontweight", "bold", ...
+// "horizontalalignment", "center");
+// // Frame title
+// headertitle = uicontrol("parent", sci2cfig,...
+// "style", "text",...
+// "string", gettext("Scilab library header"),...
+// "units", "pixels",...
+// "position", [2*margin outframemaxy+margin+widgeth+2*margin-8 110 14],...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 11,...
+// "horizontalalignment", "center");
+// headerlabel = uicontrol("parent", sci2cfig,...
+// "style", "text",...
+// "string", gettext("File name: "),...
+// "position",[2*margin outframemaxy+2*margin-1 100 widgeth],...
+// "horizontalalignment", "left",...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 12);
+// headeredit = uicontrol("parent", sci2cfig,...
+// "style", "edit",...
+// "string", gettext("<enter a file name>"),...
+// "units", "pixels",...
+// "position",[3*margin+100 outframemaxy+2*margin-1 figw-6*margin-100-btnw widgeth],...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 12, ...
+// "tag", "headeredit");
+// headerbtn = uicontrol("parent", sci2cfig,...
+// "backgroundcolor", [0.8 0.8 0.8],...
+// "style", "pushbutton",...
+// "string", gettext("Browse"),...
+// "position",[figw-2*margin-btnw outframemaxy+2*margin btnw btnh],...
+// "fontname", defaultfont,...
+// "fontunits", "points",...
+// "fontsize", 12,...
+// "callback", "cb_sci2c_gui",...
+// "tag", "headerbtn");
// -------------------------
// --- File(s) selection ---
// -------------------------
// Frame
-headerframemaxy = outframemaxy + 2*margin + widgeth + margin;
+headerframemaxy = outframemaxy //+ 2*margin + widgeth + margin;
selframe = uicontrol("parent", sci2cfig,...
"relief", "groove",...
"style", "frame",...
diff --git a/macros/scilab2c.sci b/macros/scilab2c.sci
index b068c970..41a5ac8e 100644
--- a/macros/scilab2c.sci
+++ b/macros/scilab2c.sci
@@ -85,7 +85,10 @@ function scilab2c(varargin)
// --- LAUNCH USER SCI CODE TO TEST IT BEFORE TRANSLATING IT!!! ---
runscicode(UserScilabMainFile, UserSciFilesPaths);
// --- ASK USER FOR CONTINUATION. ---
-userchoice = messagebox("Exection Succesfull. Start translation ?", "modal", "info", ["Yes" "No"])
+
+// -- FIXME : bypass this for now !!
+// -- userchoice = messagebox("Exection Succesfull. Start translation ?", "modal", "info", ["Yes" "No"])
+userchoice = 1;
if (userchoice == 1)
// --- LAUNCH SCI2C ---
runsci2c(UserScilabMainFile, UserSciFilesPaths, CCodeOutputDir, RunMode);