From b35c366fd488807c0e1c252d9861c8a2e17be637 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sun, 17 Nov 2002 00:32:22 +0000
Subject: [PATCH] Fix time_step_incr/decr with links

---
 Fltk/Callbacks.cpp | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index e052773955..aafa06678d 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.154 2002-11-16 23:46:05 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.155 2002-11-17 00:32:22 geuzaine Exp $
 //
 // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
 //
@@ -2293,13 +2293,25 @@ void view_options_timestep_cb(CALLBACK_ARGS){
 }
 
 void view_options_timestep_decr_cb(CALLBACK_ARGS){
-  int i=(long int)data;
-  opt_view_timestep(i, GMSH_SET|GMSH_GUI, opt_view_timestep(i,GMSH_GET,0)-1);
+  int links = (int)opt_post_link(0, GMSH_GET, 0);
+  for(int i=0 ; i<List_Nbr(CTX.post.list) ; i++){
+    if((links == 2 || links == 4) ||
+       ((links == 1 || links == 3) && opt_view_visible(i, GMSH_GET, 0)) ||
+       (links == 0 && i == (long int)data)){
+      opt_view_timestep(i, GMSH_SET|GMSH_GUI, opt_view_timestep(i,GMSH_GET,0)-1);
+    }
+  }
   Draw();
 }
 void view_options_timestep_incr_cb(CALLBACK_ARGS){
-  int i=(long int)data;
-  opt_view_timestep(i, GMSH_SET|GMSH_GUI, opt_view_timestep(i,GMSH_GET,0)+1);
+  int links = (int)opt_post_link(0, GMSH_GET, 0);
+  for(int i=0 ; i<List_Nbr(CTX.post.list) ; i++){
+    if((links == 2 || links == 4) ||
+       ((links == 1 || links == 3) && opt_view_visible(i, GMSH_GET, 0)) ||
+       (links == 0 && i == (long int)data)){
+      opt_view_timestep(i, GMSH_SET|GMSH_GUI, opt_view_timestep(i,GMSH_GET,0)+1);
+    }
+  }
   Draw();
 }
 
-- 
GitLab