comparison scripts/gui/uifigure.m @ 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 81b51b823663
children e3016248ca5d
comparison
equal deleted inserted replaced
31020:cb9451780a15 31021:f44e19671777
51 error ("uifigure: PROPERTY/VALUE parameters must occur in pairs"); 51 error ("uifigure: PROPERTY/VALUE parameters must occur in pairs");
52 endif 52 endif
53 53
54 h = __go_figure__ (NaN, "handlevisibility", "off", 54 h = __go_figure__ (NaN, "handlevisibility", "off",
55 "numbertitle", "off", "integerhandle", "off", 55 "numbertitle", "off", "integerhandle", "off",
56 "menubar", "none", "toolbar", "none", 56 "menubar", "none", "toolbar", "none");
57 varargin{:}); 57
58 ## Add uifigure-specific properties on top of regular figure graphics object
59 ## FIXME: There is no implementation behind these properties.
60 addproperty ("AutoResizeChildren", h, "boolean", "on");
61 addproperty ("Scrollable", h, "boolean", "off");
62
63 ## Apply any overrides.
64 set (h, varargin{:});
58 65
59 endfunction 66 endfunction
60 67
61 68
62 %!test 69 %!test
63 %! hf = uifigure ("visible", "off"); 70 %! hf = uifigure ("visible", "off");
64 %! unwind_protect 71 %! unwind_protect
65 %! assert (isfigure (hf)); 72 %! assert (isfigure (hf));
66 %! assert (get (hf, {"numbertitle", "menubar"}), {"off", "none"}); 73 %! assert (get (hf, {"numbertitle", "menubar", "scrollable"}),
74 %! {"off", "none", "off"});
67 %! unwind_protect_cleanup 75 %! unwind_protect_cleanup
68 %! close (hf); 76 %! close (hf);
69 %! end_unwind_protect 77 %! end_unwind_protect
70 78
71 %!error <parameters must occur in pairs> uifigure ("PROP1") 79 %!error <parameters must occur in pairs> uifigure ("PROP1")