diff --git a/Common/Options.cpp b/Common/Options.cpp index ea5bc223e87496301c90cea49e23bc43828b1aac..7fe6ed95682de90556c6e429ec1f2304184e9d07 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -1,4 +1,4 @@ -// $Id: Options.cpp,v 1.69 2002-01-27 20:24:54 geuzaine Exp $ +// $Id: Options.cpp,v 1.70 2002-01-27 20:47:33 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -2064,6 +2064,8 @@ double opt_post_anim_cycle(OPT_ARGS_NUM){ #ifdef _FLTK if(WID && (action & GMSH_GUI)) WID->post_butt[6]->value(CTX.post.anim_cycle); + if(WID) + WID->check_anim_buttons(); #endif return CTX.post.anim_cycle; } @@ -2078,11 +2080,9 @@ double opt_view_nb_timestep(OPT_ARGS_NUM){ if(action & GMSH_SET) v->NbTimeStep = (int)val; #ifdef _FLTK - if(WID && (action & GMSH_GUI) && (num == WID->view_number)) + if(WID && (action & GMSH_GUI) && (num == WID->view_number)){ WID->view_value[50]->maximum(v->NbTimeStep-1); - if(WID && (action & GMSH_GUI) && v->NbTimeStep > 1){ - WID->g_status_butt[5]->activate(); - WID->g_status_butt[6]->activate(); + WID->check_anim_buttons(); } #endif return v->NbTimeStep; diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp index 0b1b1f5ac84442283da5a83797f01c0f5da817be..91b71d76a8bd4da06ddebcc8b2943c489d1e60a6 100644 --- a/Fltk/Callbacks.cpp +++ b/Fltk/Callbacks.cpp @@ -1,4 +1,4 @@ -// $Id: Callbacks.cpp,v 1.103 2002-01-27 20:24:54 geuzaine Exp $ +// $Id: Callbacks.cpp,v 1.104 2002-01-27 20:47:33 geuzaine Exp $ #include <sys/types.h> #include <signal.h> @@ -512,12 +512,6 @@ void opt_post_ok_cb(CALLBACK_ARGS) { 4); opt_post_smooth(0, GMSH_SET, WID->post_butt[5]->value()); opt_post_anim_cycle(0, GMSH_SET, WID->post_butt[6]->value()); - if(WID->post_butt[6]->value()){ - WID->g_status_butt[5]->activate(); - WID->g_status_butt[6]->activate(); - } - else - WID->check_anim_buttons(); opt_post_anim_delay(0, GMSH_SET, WID->post_value[0]->value()); Draw(); diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 8b59f97c236b9016f5b53f35fef892411331b370..c65d02c588bb6ffa17417aada143d5ea0e4adebf 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -1,4 +1,4 @@ -// $Id: GUI.cpp,v 1.145 2002-01-27 20:24:54 geuzaine Exp $ +// $Id: GUI.cpp,v 1.146 2002-01-27 20:47:33 geuzaine Exp $ // To make the interface as visually consistent as possible, please: // - use the IW, BB, BH, BW and WB values @@ -934,15 +934,21 @@ void GUI::set_anim_buttons(int mode){ void GUI::check_anim_buttons(){ int i, play=0; - for(i=0 ; i<List_Nbr(CTX.post.list) ; i++) - if(((Post_View*)List_Pointer(CTX.post.list,i))->NbTimeStep > 1){ + for(i=0 ; i<List_Nbr(CTX.post.list) ; i++){ + if(((Post_View*)List_Pointer(CTX.post.list,i))->NbTimeStep > 1 || + CTX.post.anim_cycle){ play = 1 ; break ; } + } if(!play){ g_status_butt[5]->deactivate(); g_status_butt[6]->deactivate(); } + else{ + g_status_butt[5]->activate(); + g_status_butt[6]->activate(); + } } // Set the status messages