Mercurial > octave
changeset 28477:7ea82a190029
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.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 15 Jun 2020 08:36:58 -0700 |
parents | 460dd19f6109 |
children | 888e79a46a85 |
files | NEWS scripts/gui/uicontrol.m scripts/help/warning_ids.m |
diffstat | 3 files changed, 23 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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)
--- 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)
--- 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