changeset 31021:f44e19671777

uifgure.m: Add additional uifigure-specific properties for Matlab compatibility. * uifigure.m: Add properties "AutoResizeChildren" and "Scrollable". Adjust BIST test to verify.
author Rik <rik@octave.org>
date Tue, 24 May 2022 13:54:05 -0700
parents cb9451780a15
children a9df2af909fd
files scripts/gui/uifigure.m
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/gui/uifigure.m	Tue May 24 13:28:06 2022 -0700
+++ b/scripts/gui/uifigure.m	Tue May 24 13:54:05 2022 -0700
@@ -53,8 +53,15 @@
 
   h = __go_figure__ (NaN, "handlevisibility", "off",
                           "numbertitle", "off", "integerhandle", "off",
-                          "menubar", "none", "toolbar", "none", 
-                          varargin{:});
+                          "menubar", "none", "toolbar", "none");
+
+  ## Add uifigure-specific properties on top of regular figure graphics object
+  ## FIXME: There is no implementation behind these properties.
+  addproperty ("AutoResizeChildren", h, "boolean", "on");
+  addproperty ("Scrollable", h, "boolean", "off");
+
+  ## Apply any overrides.
+  set (h, varargin{:});
 
 endfunction
 
@@ -63,7 +70,8 @@
 %! hf = uifigure ("visible", "off");
 %! unwind_protect
 %!   assert (isfigure (hf));
-%!   assert (get (hf, {"numbertitle", "menubar"}), {"off", "none"});
+%!   assert (get (hf, {"numbertitle", "menubar", "scrollable"}),
+%!                    {"off", "none", "off"});
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect