# HG changeset patch # User address@hidden # Date 1253177460 -10800 # Node ID 389f0ec807bd47d6393fa1b7bd0c7b8eb837dfde # Parent 54f45f883a53a7805039d3906ad461856d965db5 fltk_backend: keybaord buttons a & g now affect the axes under the mouse pointer diff -r 54f45f883a53 -r 389f0ec807bd src/ChangeLog --- a/src/ChangeLog Wed Sep 16 13:41:49 2009 +0200 +++ b/src/ChangeLog Thu Sep 17 11:51:00 2009 +0300 @@ -1,3 +1,15 @@ +2009-09-17 Shai Ayal + + * DLD-FUNCTIONS/fltk_backend.cc (plot_window::axis_auto, + plot_window::toggle_grid): New argument AXES, which grid/auto is + applied to. + (plot_window::button_press): Pass current axes to toggle_grid and + axes_auto so that using the "A" and "G" pushbuttons will affetc + the current axes + (plot_window::handle): Pass axes under mouse to toggle_grid and + axes_auto so that using the keys "a" and "g" will affect the axes + under the mouse pointer + 2009-09-16 Jaroslav Hajek * DLD-FUNCTIONS/rand.cc (Frandperm): New function. diff -r 54f45f883a53 -r 389f0ec807bd src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc Wed Sep 16 13:41:49 2009 +0200 +++ b/src/DLD-FUNCTIONS/fltk_backend.cc Thu Sep 17 11:51:00 2009 +0300 @@ -293,11 +293,17 @@ void button_press (Fl_Widget* widg) { - if (widg == autoscale) - axis_auto (); + if (widg == autoscale) { + graphics_handle gh=fp.get_currentaxes (); + if (gh.ok ()) + axis_auto (gh); + } - if (widg == togglegrid) - toggle_grid (); + if (widg == togglegrid) { + graphics_handle gh=fp.get_currentaxes (); + if (gh.ok ()) + toggle_grid (gh); + } if (widg == help) fl_message ("%s", help_text); @@ -309,17 +315,20 @@ Fl_Button* help; Fl_Output* status; - void axis_auto (void) + void axis_auto(const graphics_handle& gh) { octave_value_list args; - args(0) = "auto"; + args(0) = gh.as_octave_value (); + args(1) = "auto"; feval ("axis",args); mark_modified (); } - void toggle_grid (void) + void toggle_grid (const graphics_handle& gh) { - feval ("grid"); + octave_value_list args; + args(0) = gh.as_octave_value (); + feval ("grid",args); mark_modified (); } @@ -433,12 +442,12 @@ { case 'a': case 'A': - axis_auto (); + axis_auto (pixel2axes_or_ca (Fl::event_x (), Fl::event_y ())); break; case 'g': case 'G': - toggle_grid (); + toggle_grid (pixel2axes_or_ca (Fl::event_x (), Fl::event_y ())); break; } break;