# HG changeset patch # User Rik # Date 1592235418 25200 # Node ID 7ea82a19002959387b47f301e6dacf644221e7a0 # Parent 460dd19f6109ad63bb28a5859f8311d1bf157e83 Add new warning ID "Octave:unimplemented-matlab-functionality". * NEWS: Announce change in Matlab compatibility section. * warning_ids.m: Document new warning ID "Octave:unimplemented-matlab-functionality". * uicontrol.m: Validate "style" attribute and if it is "frame", throw a warning about this feature not being implemented. diff -r 460dd19f6109 -r 7ea82a190029 NEWS --- a/NEWS Mon Jun 15 12:03:03 2020 +0900 +++ b/NEWS Mon Jun 15 08:36:58 2020 -0700 @@ -80,6 +80,11 @@ objects. It is equivalent to the previously used "uicontextmenu" property which is hidden now. +- A new warning ID (Octave:unimplemented-matlab-functionality) has been +added which prints a warning when Octave's parser recognizes valid +Matlab code, but for which Octave does not yet implement the +functionality. By default, this warning is enabled. + - Additional properties have been added for the `axes` graphics object: * "alphamap" (not yet implemented) * "alphascale" (not yet implemented) diff -r 460dd19f6109 -r 7ea82a190029 scripts/gui/uicontrol.m --- a/scripts/gui/uicontrol.m Mon Jun 15 12:03:03 2020 +0900 +++ b/scripts/gui/uicontrol.m Mon Jun 15 08:36:58 2020 -0700 @@ -119,6 +119,16 @@ [h, args] = __uiobject_split_args__ ("uicontrol", varargin, {"figure", "uipanel", "uibuttongroup"}); + + ## Validate style + idx = find (strcmp (args, "style"), 1, "last"); + if (! isempty (idx)) + if (idx < numel (args) && strcmp (varargin{idx+1}, "frame")) + warning ("Octave:unimplemented-matlab-functionality", + 'uicontrol: "frame" style is not implemented. Use uipanel() or uibuttongroup() instead'); + endif + endif + htmp = __go_uicontrol__ (h, args{:}); if (nargout > 0) diff -r 460dd19f6109 -r 7ea82a190029 scripts/help/warning_ids.m --- a/scripts/help/warning_ids.m Mon Jun 15 12:03:03 2020 +0900 +++ b/scripts/help/warning_ids.m Mon Jun 15 08:36:58 2020 -0700 @@ -376,6 +376,14 @@ ## the warning message is printed just once per Octave session. ## By default, the @code{Octave:glyph-render} warning is enabled. ## +## @item Octave:unimplemented-matlab-functionality +## If the @code{Octave:unimplemented-matlab-functionality} warning is enabled, +## a warning is printed when a @sc{matlab} code construct is used which the +## Octave interpreter parses as valid, but for which Octave does not yet +## implement the functionality. +## By default, the @code{Octave:unimplemented-matlab-functionality} warning is +## enabled. +## ## @item Octave:variable-switch-label ## If the @code{Octave:variable-switch-label} warning is enabled, Octave ## will print a warning if a switch label is not a constant or constant