summaryrefslogtreecommitdiff
path: root/modules/gui/demos/dialogs
diff options
context:
space:
mode:
authorShashank2017-05-29 12:40:26 +0530
committerShashank2017-05-29 12:40:26 +0530
commit0345245e860375a32c9a437c4a9d9cae807134e9 (patch)
treead51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/gui/demos/dialogs
downloadscilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip
CMSCOPE changed
Diffstat (limited to 'modules/gui/demos/dialogs')
-rwxr-xr-xmodules/gui/demos/dialogs/dialog.dem.sce32
-rwxr-xr-xmodules/gui/demos/dialogs/dialogs.dem.gateway.sce11
-rwxr-xr-xmodules/gui/demos/dialogs/messagebox.sce22
-rwxr-xr-xmodules/gui/demos/dialogs/x_choose.sce18
-rwxr-xr-xmodules/gui/demos/dialogs/x_dialog.sce15
-rwxr-xr-xmodules/gui/demos/dialogs/x_mdialog.sce29
6 files changed, 127 insertions, 0 deletions
diff --git a/modules/gui/demos/dialogs/dialog.dem.sce b/modules/gui/demos/dialogs/dialog.dem.sce
new file mode 100755
index 000000000..cff032bf5
--- /dev/null
+++ b/modules/gui/demos/dialogs/dialog.dem.sce
@@ -0,0 +1,32 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) ????-2008 - INRIA
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+messagebox(["messagebox: Simple example of message ";
+"First row of comments";
+"Second row";
+"etc...";],"modal");
+
+x_dialog("x_dialog: trial"," ")
+x_dialog("Trial ","3.1592653")
+x_dialog(["trial ";"trial1";"trial2";"trial3";"trial4";..
+"trial6";"trial7"],"[0 1 2 3]")
+
+messagebox("trial","modal");
+messagebox(["trial";"trial1";"trial2";"trial3";"trial4";"trial6";"trial7";..
+"trial3";"trial4";"trial6";"trial7";"trial3";"trial4";"trial6";"trial7"],"modal");
+
+x_choose(["trial";"trial1";"trial2";"trial3";"trial4";"trial7";..
+"trial3";"trial4";"trial6";"trial7";"trial3";"trial4";"trial6"],..
+"selection (click on one item --> returns the item number)")
+
+x_mdialog(["here: your message";...
+"(edit the boxes below --> output: edited boxes)"],...
+["first row";"second row";"etc..."],...
+["value1";"value2";"value3"])
+
+n=5;m=4;mat=rand(n,m);
+row="row";labelv=row(ones(1,n))+string(1:n);
+col="col";labelh=col(ones(1,m))+string(1:m);
+new=evstr(x_mdialog("Matrix to edit",labelv,labelh,string(mat)))
diff --git a/modules/gui/demos/dialogs/dialogs.dem.gateway.sce b/modules/gui/demos/dialogs/dialogs.dem.gateway.sce
new file mode 100755
index 000000000..b27df7f9b
--- /dev/null
+++ b/modules/gui/demos/dialogs/dialogs.dem.gateway.sce
@@ -0,0 +1,11 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+subdemolist = [_("messagebox"), "messagebox.sce"; ...
+_("x_choose"), "x_choose.sce"; ...
+_("x_dialog"), "x_dialog.sce"; ...
+_("x_mdialog"), "x_mdialog.sce"];
+
+subdemolist(:,2) = SCI + "/modules/gui/demos/dialogs/"+ subdemolist(:,2);
diff --git a/modules/gui/demos/dialogs/messagebox.sce b/modules/gui/demos/dialogs/messagebox.sce
new file mode 100755
index 000000000..fe22d1163
--- /dev/null
+++ b/modules/gui/demos/dialogs/messagebox.sce
@@ -0,0 +1,22 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_messagebox()
+
+ res = messagebox(_(["Simple example of message";
+ "First row of comments";
+ "Second row";
+ "etc...";]), _("Title"), "info", _(["Button 1" "Button 2"]), "modal");
+
+ if res == 1 then
+ disp(_("Button 1 clicked."));
+ else
+ disp(_("Button 2 clicked"));
+ end
+
+endfunction
+
+demo_messagebox()
+clear demo_messagebox;
diff --git a/modules/gui/demos/dialogs/x_choose.sce b/modules/gui/demos/dialogs/x_choose.sce
new file mode 100755
index 000000000..e11f44710
--- /dev/null
+++ b/modules/gui/demos/dialogs/x_choose.sce
@@ -0,0 +1,18 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_x_choose()
+
+ res = x_choose(["item1";"item2";"item3";"item4";"item5";"item6";..
+ "item7";"item8";"item9";"item10"],..
+ _("Message: Selection (double-click on an item --> returns the item number)"),..
+ _("Cancel"));
+
+ disp(_("Item selected: "+string(res)));
+
+endfunction
+
+demo_x_choose()
+clear demo_x_choose;
diff --git a/modules/gui/demos/dialogs/x_dialog.sce b/modules/gui/demos/dialogs/x_dialog.sce
new file mode 100755
index 000000000..2264beba9
--- /dev/null
+++ b/modules/gui/demos/dialogs/x_dialog.sce
@@ -0,0 +1,15 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_x_dialog()
+
+ res = x_dialog(_("Message: enter a value"), "3.1592653");
+
+ disp(_("Value entered: "+string(res)));
+
+endfunction
+
+demo_x_dialog()
+clear demo_x_dialog;
diff --git a/modules/gui/demos/dialogs/x_mdialog.sce b/modules/gui/demos/dialogs/x_mdialog.sce
new file mode 100755
index 000000000..625f67e92
--- /dev/null
+++ b/modules/gui/demos/dialogs/x_mdialog.sce
@@ -0,0 +1,29 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+//
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+
+function demo_x_mdialog()
+
+ res = x_mdialog(_(["Message";...
+ "(edit the boxes below --> output: edited boxes)"]),...
+ _(["first row";"second row";"etc..."]),...
+ ["10";"20";"30"]);
+
+ disp(_("Values entered: "+res(1)+" "+res(2)+" "+res(3)));
+
+ n = 5;
+ m = 4;
+ mat = rand(n, m);
+ row = _("row");
+ labelv = row(ones(1, n))+string(1:n);
+ col = _("col");
+ labelh = col(ones(1, m))+string(1:m);
+ res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));
+
+ disp(res, _("Matrix entered: "));
+
+endfunction
+
+demo_x_mdialog()
+clear demo_x_mdialog;