From e111ea6da8a97a02d1bccc5086d9c47a9c919a4a Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Sun, 27 Jan 2002 20:47:33 +0000 Subject: [PATCH] better (de)activate stuff for buttons --- Common/Options.cpp | 10 +++++----- Fltk/Callbacks.cpp | 8 +------- Fltk/GUI.cpp | 12 +++++++++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Common/Options.cpp b/Common/Options.cpp index ea5bc223e8..7fe6ed9568 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 0b1b1f5ac8..91b71d76a8 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 8b59f97c23..c65d02c588 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 -- GitLab