view scripts/gui/helpdlg.m @ 21630:b5d9b95d1e1a

Removing Java dialog boxes. * scripts/gui/module.mk: removed message_dialog.m entry. * scripts/gui/private/message_dialog.m: merged code to msgbox. * scripts/gui/errordlg.m: function now redirects to msgbox. New tests. * scripts/gui/helpdlg.m: function now redirects to msgbox. New tests. * scripts/gui/warndlg.m: function now redirects to msgbox. New tests. * scripts/gui/msgbox.m: merged code from message_dialog. Stripped Java dialog boxes. New tests. * scripts/gui/inputdlg.m: stripped Java dialog boxes. Improved doc. New tests. * scripts/gui/listdlg.m: stripped Java dialog boxes. Improved doc. New tests. * scripts/gui/questdlg.m: stripped Java dialog boxes. Improved doc. New tests. * scripts/miscellaneous/menu.m: stripped Java dialog boxes. Improved doc. * scripts/java/module.mk: removed entries of deleted files. * scripts/java/org/octave/DlgListener.java: removed Java dialog box Listener. * scripts/java/org/octave/images/error.png: removed unused image. * scripts/java/org/octave/images/information.png: removed unused image. * scripts/java/org/octave/images/octave.png: removed unused image. * scripts/java/org/octave/images/question.png: removed unused image. * scripts/java/org/octave/images/warning.png: removed unused image. * scripts/java/org/octave/JDialogBox.java: removed Java dialog box class. * scripts/java/org/octave/TeXcode.java: removed class used by Java dialogs. * scripts/java/org/octave/TeXtranslator.java: removed class used by Java dialogs. * doc/module.mk: removed unused java images and java.txi. * doc/interpreter/java.txi: merged content as minor sections to following files. * doc/interpreter/bugs.txi: moved Java distinguish section here. * doc/interpreter/external.txi: moved Java Interface description here. * doc/interpreter/gui.txi: moved dialog box docstrings here. * doc/interpreter/octave.texi: corrected TOC. * doc/interpreter/java-images/image001.png: removed unused image. * doc/interpreter/java-images/image002.png: removed unused image. * doc/interpreter/java-images/image003.png: removed unused image. * doc/interpreter/java-images/image004.png: removed unused image. * doc/interpreter/java-images/image005.png: removed unused image. * doc/interpreter/java-images/image006.png: removed unused image. * doc/interpreter/java-images/image007.png: removed unused image. * doc/interpreter/java-images/image008.png: removed unused image. * doc/interpreter/java-images/image009.png: removed unused image. * NEWS: Announced changes.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Tue, 19 Apr 2016 15:27:19 +0200
parents 516bb87ea72e
children 59ebef9680ef
line wrap: on
line source

## Copyright (C) 2010, 2013 Martin Hepperle
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn  {} {@var{h} =} helpdlg ()
## @deftypefnx {} {@var{h} =} helpdlg (@var{msg})
## @deftypefnx {} {@var{h} =} helpdlg (@var{msg}, @var{title})
## Display help message @var{msg} using a help dialog box with caption
## @var{title} (character string).  The default help message is
## @qcode{"This is the default help string."} and the default caption is
## @qcode{"Help Dialog"}.
##
## The help message may have multiple lines separated by newline characters
## ("\n"), or it may be a cellstr array with one element for each line.
##
## The return value @var{h} is always 1.
##
## Examples:
##
## @example
## @group
## helpdlg ("Some helpful text for the user.");
## helpdlg ("Some helpful text\nwith two lines.");
## helpdlg (@{"Some helpful text", "with two lines."@});
## helpdlg ("Some helpful text for the user.", "Fancy caption");
## @end group
## @end example
##
## @seealso{errordlg, inputdlg, listdlg, msgbox, questdlg, warndlg}
## @end deftypefn

function retval = helpdlg (varargin)

  narginchk (0, 2);

  box_msg = "This is the default help string.";
  box_title = "Help Dialog";

  if (nargin > 0)
    box_msg = varargin{1};
  endif
  if (nargin > 1)
    box_title = varargin{2};
  endif

  retval = msgbox (box_msg, box_title, "help");

endfunction

%!error<narginchk> helpdlg (1, 2, 3)
%!error<MSG must be a character string> helpdlg (1)
%!error<TITLE must be a character string> helpdlg ("msg", 1)