diff -r 18b0af0bbd6b scripts/plot/fltk_macro_run.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/plot/fltk_macro_run.m Fri Sep 10 16:10:19 2010 -0400 @@ -0,0 +1,5 @@ +function fltk_macro_run(n) + printf("Macro button %d pressed\n") + drawnow ; + fflush(stdout) ; +endfunction diff -r 18b0af0bbd6b src/DLD-FUNCTIONS/fltk_backend.cc --- a/src/DLD-FUNCTIONS/fltk_backend.cc Wed Sep 08 08:17:48 2010 -0400 +++ b/src/DLD-FUNCTIONS/fltk_backend.cc Fri Sep 10 16:10:19 2010 -0400 @@ -63,6 +63,7 @@ #include "variables.h" #define FLTK_BACKEND_NAME "fltk" +#define FLTK_BACKEND_MACRO_COUNT 8 // Give FLTK no more than 0.01 sec to do its stuff. static double fltk_maxtime = 1e-2; @@ -231,8 +232,27 @@ begin (); { + macrobar = new + Fl_Box (0, + hh - status_h, + ww, + status_h); + macrobar->box(FL_FLAT_BOX); + + for (int i=0 ; icallback (macro_callback, static_cast (this)); + macro[i]->tooltip ("Macro"); + } + canvas = new - OpenGL_fltk (0, 0, ww , hh - status_h, number ()); + OpenGL_fltk (0, macrobar_h, ww , hh - macrobar_h - status_h, number ()); bottom = new Fl_Box (0, @@ -314,6 +334,9 @@ } end (); + for (int i=0 ; ishow (); + status->show (); autoscale->show (); togglegrid->show (); @@ -386,6 +409,9 @@ // Figure properties. figure::properties& fp; + // Macrobar area height. + static const int macrobar_h = 20; + // Status area height. static const int status_h = 20; @@ -421,6 +447,25 @@ fl_message ("%s", help_text); } + // Button callbacks. + static void macro_callback (Fl_Widget* ww, void* data) + { + static_cast (data)->macro_press (ww); + } + + void macro_press (Fl_Widget* widg) + { + octave_value_list args; + for (int i=0 ; i