[demos] GUI/Dialogs/x_dialog & x_mdialog did not manage Cancel button 41/21341/2
Adeline CARNIS [Mon, 17 Feb 2020 14:08:03 +0000 (15:08 +0100)]
Change-Id: Iab6f2a39cfc27ad9ee63c6de3ad6b6d6fb5fd67a

scilab/modules/gui/demos/dialogs/x_dialog.sce
scilab/modules/gui/demos/dialogs/x_mdialog.sce

index 2264beb..1f86b47 100644 (file)
@@ -7,7 +7,9 @@ function demo_x_dialog()
 
     res = x_dialog(_("Message: enter a value"), "3.1592653");
 
-    disp(_("Value entered: "+string(res)));
+    if ~isempty(res) then
+        disp(_("Value entered: "+string(res)));
+    end
 
 endfunction
 
index e6ebffe..621c9b4 100644 (file)
@@ -10,7 +10,11 @@ function demo_x_mdialog()
     _(["first row";"second row";"etc..."]),...
     ["10";"20";"30"]);
 
-    disp(_("Values entered: "+res(1)+" "+res(2)+" "+res(3)));
+    if ~isempty(res) then
+        disp(_("Values entered: "+res(1)+" "+res(2)+" "+res(3)));
+    else
+        return
+    end
 
     n = 5;
     m = 4;
@@ -21,7 +25,9 @@ function demo_x_mdialog()
     labelh = col(ones(1, m))+string(1:m);
     res = evstr(x_mdialog(_("Matrix to edit"), labelv, labelh, string(mat)));
 
-    disp(_("Matrix entered: "),res);
+    if ~isempty(res) then
+        disp(_("Matrix entered: "),res);
+    end
 
 endfunction