Fix load for figures/axes. 72/14172/1
Vincent COUVERT [Thu, 27 Mar 2014 14:54:40 +0000 (15:54 +0100)]
To test: test_run graphics save_load

Change-Id: I74ec94c29e169c86650462c0a88fed082fbd78d9

scilab/modules/io/macros/%_save.sci
scilab/modules/io/macros/%_sodload.sci

index 03c53f2..5aac5fa 100644 (file)
@@ -194,6 +194,7 @@ function [] = %_save(%__filename__, varargin)
         "infobar_visible", ...
         "dockable", ...
         "layout", ...
+        "layout_options", ...
         "default_axes", ...
         "icon", ...
         "children", ...
index 4e5f3f1..8541a12 100644 (file)
@@ -169,13 +169,20 @@ function %_sodload(%__filename__, varargin)
                 "dockable", figureProperties.dockable, ...
                 "default_axes", figureProperties.default_axes, ...
                 "visible", "off");
+                h.background = -2;
+                fields(fields=="menubar") = [];
+                fields(fields=="toolbar") = [];
+                fields(fields=="dockable") = [];
+                fields(fields=="default_axes") = [];
+                fields(fields=="visible") = [];
             else
-                h = gcf();
+                h = scf();
                 h.visible = "off";
             end
         else
             if isempty(winsid()) then
                 h = figure("visible", "off");
+                h.background = -2;
             else
                 h = gcf();
                 h.visible = "off";
@@ -273,6 +280,8 @@ function %_sodload(%__filename__, varargin)
         // Get auto_ticks to be sure to set it after ticks labels
         auto_ticks = axesProperties.auto_ticks;
         fields(fields=="auto_ticks") = [];
+        auto_margins = axesProperties.auto_margins;
+        fields(fields=="auto_margins") = [];
 
         for i = 1:size(fields, "*")
             if or(fields(i) == ["title","x_label","y_label","z_label"]) then
@@ -300,6 +309,7 @@ function %_sodload(%__filename__, varargin)
         end
 
         set(h, "auto_ticks", auto_ticks);
+        set(h, "auto_margins", auto_margins);
 
         // Legend management
         global %LEG
@@ -829,6 +839,10 @@ function %_sodload(%__filename__, varargin)
             fields(fields=="scrollable") = [];
             fields(fields=="constraints") = [];
             fields(fields=="margins") = [];
+            h.layout_options = uicontrolProperties.layout_options;
+            fields(fields=="layout_options") = [];
+            h.layout = uicontrolProperties.layout;
+            fields(fields=="layout") = [];
         else
             h = uicontrol("style", uicontrolProperties.style);
         end