Mercurial > hg > octave-nkf
diff src/graphics.cc @ 6425:0cc5ca7b1e91
[project @ 2007-03-21 15:57:19 by jwe]
author | jwe |
---|---|
date | Wed, 21 Mar 2007 15:57:19 +0000 |
parents | 05a48d6cf163 |
children | 5bec61ae1576 |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -701,9 +701,14 @@ return instance_ok () ? instance->do_current_figure () : octave_NaN; } - static Matrix list (void) + static Matrix handle_list (void) { - return instance_ok () ? instance->do_list () : Matrix (); + return instance_ok () ? instance->do_handle_list () : Matrix (); + } + + static Matrix figure_handle_list (void) + { + return instance_ok () ? instance->do_figure_handle_list () : Matrix (); } private: @@ -800,7 +805,7 @@ graphics_handle do_make_figure_handle (double val); - Matrix do_list (void) + Matrix do_handle_list (void) { Matrix retval (1, handle_map.size ()); octave_idx_type i = 0; @@ -809,6 +814,17 @@ return retval; } + Matrix do_figure_handle_list (void) + { + Matrix retval (1, figure_list.size ()); + octave_idx_type i = 0; + for (const_figure_list_iterator p = figure_list.begin (); + p != figure_list.end (); + p++) + retval(i++) = *p; + return retval; + } + void do_push_figure (const graphics_handle& h); void do_pop_figure (const graphics_handle& h); @@ -1337,7 +1353,17 @@ else if (name.compare ("colormap")) colormap = colormap_property (val); else if (name.compare ("visible")) - visible = val; + { + std::string s = val.string_value (); + + if (! error_state) + { + if (s == "on") + xset (0, "currentfigure", __myhandle__); + + visible = val; + } + } else if (name.compare ("paperorientation")) paperorientation = val; else @@ -3415,7 +3441,16 @@ Return current list of function handles.\n\ @end deftypefn") { - return octave_value (gh_manager::list ()); + return octave_value (gh_manager::handle_list ()); +} + +DEFUN (__go_figure_handles__, , , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} __go_figure_handles__ ()\n\ +Return current list of function handles.\n\ +@end deftypefn") +{ + return octave_value (gh_manager::figure_handle_list ()); } /*