From 0d8b1b0809bbf7d11632bd9809b5d8d9a7afad63 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Sat, 12 Mar 2005 20:17:41 +0000
Subject: [PATCH] polish the last commit some more (activate/deactivate
 widgets, etc.)

---
 Common/DefaultOptions.h |  20 +--
 Common/Options.cpp      |  37 ++++--
 Fltk/Callbacks.cpp      | 286 +++++++++++++++++++++++++++++++++-------
 Fltk/Callbacks.h        |   3 +-
 Fltk/GUI.cpp            | 121 ++++++++---------
 Fltk/GUI.h              |   2 +-
 Graphics/Graph2D.cpp    |  12 +-
 doc/texinfo/gmsh.texi   |   6 +-
 8 files changed, 345 insertions(+), 142 deletions(-)

diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 8961ec26c8..8df9c44fad 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -848,7 +848,7 @@ StringXNumber MeshOptions_Number[] = {
     "Explode elements (between 0=point and 1=non-transformed)" },
 
   { F|O, "Format" , opt_mesh_format , FORMAT_MSH , 
-    "Mesh output format (1=MSH, 2=UNV, 3=GREF, 19=VRML)" },
+    "Mesh output format (1=msh, 2=unv, 3=gref, 19=vrml)" },
 
   { F|O, "GammaInf" , opt_mesh_gamma_inf , 0.0 , 
     "Only display elements whose Gamma factor is greater than GammaInf" },
@@ -874,7 +874,7 @@ StringXNumber MeshOptions_Number[] = {
   { F|O, "MinimumCirclePoints" , opt_mesh_min_circ_points, 7. ,
     "Minimum number of points used to mesh a circle" },
   { F|O, "MshFileVersion" , opt_mesh_msh_file_version , 1.0 , 
-    "MSH mesh file version to generate" },
+    "Version of the `msh' file format to use" },
 
   { F, "NbHexahedra" , opt_mesh_nb_hexahedra , 0. , 
     "Number of hexahedra in the current mesh (read-only)" },
@@ -901,7 +901,7 @@ StringXNumber MeshOptions_Number[] = {
   { F|O, "PointsPerElement" , opt_mesh_points_per_element , 0. , 
     "Display mesh nodes per element (slower, but permits to visualize only a subset of the nodes)" },
   { F|O, "PointInsertion" , opt_mesh_point_insertion, CENTER_CIRCCIRC ,
-    "Point insertion method for isotropic 2D algorithm (1=center of circumscribed circle, 2=cog)" },
+    "Point insertion method for isotropic 2D algorithm (1=center of circumscribed circle, 2=center of gravity)" },
   { F|O, "PointNumbers" , opt_mesh_points_num , 0. , 
     "Display mesh node numbers?" },
   { F|O, "PointSize" , opt_mesh_point_size , 4. , 
@@ -1042,7 +1042,7 @@ StringXNumber ViewOptions_Number[] = {
   { F|O, "ArrowHeadRadius" , opt_view_arrow_head_radius , 0.12 ,
     "Relative radius of arrow head" },
   { F|O, "ArrowLocation" , opt_view_arrow_location , DRAW_POST_LOCATE_COG , 
-    "Arrow location (1=cog, 2=node)" },
+    "Arrow location (1=center of gravity, 2=node)" },
   { F|O, "ArrowSize" , opt_view_arrow_size , 60. ,
     "Display size of arrows (in pixels)" },
   { F|O, "ArrowSizeProportional" , opt_view_arrow_size_proportional , 1. ,
@@ -1052,7 +1052,7 @@ StringXNumber ViewOptions_Number[] = {
   { F|O, "ArrowStemRadius" , opt_view_arrow_stem_radius , 0.02 ,
     "Relative radius of arrow stem" },
   { F|O, "AutoPosition" , opt_view_auto_position , 1. , 
-    "Position the scale or 2D graph automatically" }, 
+    "Position the scale or 2D plot automatically" }, 
   { F|O, "Axes" , opt_view_axes , 0 ,
     "Axes (0=none, 1=simple axes, 2=box, 3=full grid, 4=open grid)" },
   { F|O, "AxesAutoPosition" , opt_view_axes_auto_position , 1. , 
@@ -1147,7 +1147,7 @@ StringXNumber ViewOptions_Number[] = {
     "Grid mode (this option is deprecated: use View.Axes instead)" },
 
   { F|O, "Height" , opt_view_size1 , 200. , 
-    "Height (in pixels) of the scale or 2D graph" }, 
+    "Height (in pixels) of the scale or 2D plot" }, 
 
   { F|O, "IntervalsType" , opt_view_intervals_type , DRAW_POST_CONTINUOUS ,
     "Type of interval display (1=iso, 2=continuous, 3=discrete, 4=numeric)" },
@@ -1197,9 +1197,9 @@ StringXNumber ViewOptions_Number[] = {
   { F|O, "PointType" , opt_view_point_type , 0. , 
     "Display points as solid color dots (0) or 3D spheres (1)" },
   { F|O, "PositionX" , opt_view_position0 , 100. , 
-    "Horizontal position (in pixels) of the upper left corner of the scale or 2D graph" }, 
+    "Horizontal position (in pixels) of the upper left corner of the scale or 2D plot" }, 
   { F|O, "PositionY" , opt_view_position1 , 50. , 
-    "Vertical position (in pixels) of the upper left corner of the scale or 2D graph" }, 
+    "Vertical position (in pixels) of the upper left corner of the scale or 2D plot" }, 
 
   { F,   "RaiseX" , opt_view_raise0 , 0. , 
     "Elevation of the view along X-axis (in model coordinates)" },
@@ -1248,7 +1248,7 @@ StringXNumber ViewOptions_Number[] = {
   { F,   "Transform33" , opt_view_transform22 , 1. ,
     "Element (3,3) of the 3x3 coordinate transformation matrix" },
   { F, "Type" , opt_view_type , DRAW_POST_3D ,
-    "Type of graph (1=3D, 2=2D-space, 3=2D-time)" },
+    "Type of plot (1=3D, 2=2D space, 3=2D time)" },
 
   { F|O, "UseGeneralizedRaise" , opt_view_use_gen_raise , 0 ,
     "Use generalized raise?" },
@@ -1259,7 +1259,7 @@ StringXNumber ViewOptions_Number[] = {
     "Is the view visible?" },
 
   { F|O, "Width" , opt_view_size0 , 300. , 
-    "Width (in pixels) of the scale or 2D graph" }, 
+    "Width (in pixels) of the scale or 2D plot" }, 
 
   { 0, NULL , NULL , 0. , NULL }
 } ;
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 18a7e30f90..ca38caf3ce 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -1,4 +1,4 @@
-// $Id: Options.cpp,v 1.231 2005-03-12 07:52:54 geuzaine Exp $
+// $Id: Options.cpp,v 1.232 2005-03-12 20:17:41 geuzaine Exp $
 //
 // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
 //
@@ -34,6 +34,7 @@ extern Context_T CTX;
 #include "Solvers.h"
 #include "GUI.h"
 extern GUI *WID;
+extern void activate_cb(Fl_Widget* w, void* data);
 #endif
 
 extern Post_View *Post_ViewReference;
@@ -2643,8 +2644,10 @@ double opt_general_axes(OPT_ARGS_NUM)
       CTX.axes = 0;
   }
 #if defined(HAVE_FLTK)
-  if(WID && (action & GMSH_GUI))
+  if(WID && (action & GMSH_GUI)){
     WID->gen_choice[4]->value(CTX.axes);
+    activate_cb(NULL, (void*)"general_axes");
+  }
 #endif
   return CTX.axes;
 }
@@ -2654,8 +2657,10 @@ double opt_general_axes_auto_position(OPT_ARGS_NUM)
   if(action & GMSH_SET)
     CTX.axes_auto_position = (int)val;
 #if defined(HAVE_FLTK)
-  if(WID && (action & GMSH_GUI))
+  if(WID && (action & GMSH_GUI)){
     WID->gen_butt[0]->value(CTX.axes_auto_position);
+    activate_cb(NULL, (void*)"general_axes_auto");
+  }
 #endif
   return CTX.axes_auto_position;
 }
@@ -2764,8 +2769,10 @@ double opt_general_small_axes(OPT_ARGS_NUM)
   if(action & GMSH_SET)
     CTX.small_axes = (int)val;
 #if defined(HAVE_FLTK)
-  if(WID && (action & GMSH_GUI))
+  if(WID && (action & GMSH_GUI)){
     WID->gen_butt[1]->value(CTX.small_axes);
+    activate_cb(NULL, (void*)"general_small_axes");
+  }
 #endif
   return CTX.small_axes;
 }
@@ -2952,7 +2959,7 @@ double opt_general_rotation_center_cg(OPT_ARGS_NUM)
 #if defined(HAVE_FLTK)
   if(WID && (action & GMSH_GUI)){
     WID->gen_butt[15]->value(CTX.rotation_center_cg);
-    WID->check_rotation_center_button();
+    activate_cb(NULL, (void*)"rotation_center");
   }
 #endif
   return CTX.rotation_center_cg;
@@ -4145,8 +4152,10 @@ double opt_mesh_light(OPT_ARGS_NUM)
   if(action & GMSH_SET)
     CTX.mesh.light = (int)val;
 #if defined(HAVE_FLTK)
-  if(WID && (action & GMSH_GUI))
+  if(WID && (action & GMSH_GUI)){
     WID->mesh_butt[17]->value(CTX.mesh.light);
+    activate_cb(NULL, (void*)"mesh_light");
+  }
 #endif
   return CTX.mesh.light;
 }
@@ -4323,8 +4332,10 @@ double opt_mesh_use_cut_plane(OPT_ARGS_NUM)
 #endif
   }
 #if defined(HAVE_FLTK)
-  if(WID && (action & GMSH_GUI))
+  if(WID && (action & GMSH_GUI)){
     WID->mesh_butt[16]->value(CTX.mesh.use_cut_plane);
+    activate_cb(NULL, (void*)"mesh_cut_plane");
+  }
 #endif
   return CTX.mesh.use_cut_plane;
 }
@@ -5321,6 +5332,7 @@ double opt_view_auto_position(OPT_ARGS_NUM)
 #if defined(HAVE_FLTK)
   if(_gui_action_valid(action, num)) {
     WID->view_butt[7]->value(v->AutoPosition);
+    activate_cb(NULL, (void*)"view_axes_auto_2d");
   }
 #endif
   return v->AutoPosition;
@@ -5389,6 +5401,7 @@ double opt_view_axes(OPT_ARGS_NUM)
 #if defined(HAVE_FLTK)
   if(_gui_action_valid(action, num)) {
     WID->view_choice[8]->value(v->Axes);
+    activate_cb(NULL, (void*)"view_axes");
   }
 #endif
   return v->Axes;
@@ -5403,6 +5416,7 @@ double opt_view_axes_auto_position(OPT_ARGS_NUM)
 #if defined(HAVE_FLTK)
   if(_gui_action_valid(action, num)) {
     WID->view_butt[25]->value(v->AxesAutoPosition);
+    activate_cb(NULL, (void*)"view_axes_auto_3d");
   }
 #endif
   return v->AxesAutoPosition;
@@ -5573,8 +5587,10 @@ double opt_view_light(OPT_ARGS_NUM)
     v->Changed = 1;
   }
 #if defined(HAVE_FLTK)
-  if(_gui_action_valid(action, num))
+  if(_gui_action_valid(action, num)){
     WID->view_butt[11]->value(v->Light);
+    activate_cb(NULL, (void*)"view_light");
+  }
 #endif
   return v->Light;
 }
@@ -5879,6 +5895,7 @@ double opt_view_range_type(OPT_ARGS_NUM)
       WID->view_choice[7]->value(0);
       break;
     }
+    activate_cb(NULL, (void*)"custom_range");
   }
 #endif
   return v->RangeType;
@@ -6221,8 +6238,10 @@ double opt_view_use_gen_raise(OPT_ARGS_NUM)
     v->Changed = 1;
   }
 #if defined(HAVE_FLTK)
-  if(_gui_action_valid(action, num))
+  if(_gui_action_valid(action, num)){
     WID->view_butt[6]->value(v->UseGenRaise);
+    activate_cb(NULL, (void*)"general_transform");
+  }
 #endif
   return v->UseGenRaise;
 }
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index 0690c28946..7a6ccf12ee 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.345 2005-03-12 07:52:54 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.346 2005-03-12 20:17:41 geuzaine Exp $
 //
 // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
 //
@@ -138,9 +138,9 @@ void redraw_cb(CALLBACK_ARGS)
 void window_cb(CALLBACK_ARGS)
 {
   static int oldx = 0, oldy = 0, oldw = 0, oldh = 0, zoom = 1;
+  char *str = (char*)data;
 
-  switch((long)data){
-  case 0: // minimize
+  if(!strcmp(str, "minimize")){
     WID->g_window->iconize();
     if(WID->opt_window->shown()) WID->opt_window->iconize();
     if(WID->vis_window->shown()) WID->vis_window->iconize();
@@ -149,8 +149,8 @@ void window_cb(CALLBACK_ARGS)
     if(WID->stat_window->shown()) WID->stat_window->iconize();
     if(WID->msg_window->shown()) WID->msg_window->iconize();
     WID->m_window->iconize();
-    break;
-  case 1: // zoom
+  }
+  else if(!strcmp(str, "zoom")){
     if(zoom){
       oldx = WID->g_window->x();
       oldy = WID->g_window->y();
@@ -165,8 +165,9 @@ void window_cb(CALLBACK_ARGS)
     }
     WID->g_window->show();
     WID->m_window->show();
-    break;
-  case 2: // bring all to front (the order is important!)
+  }
+  else if(!strcmp(str, "front")){
+    // the order is important!
     WID->g_window->show();
     if(WID->opt_window->shown()) WID->opt_window->show();
     if(WID->vis_window->shown()) WID->vis_window->show();
@@ -175,9 +176,195 @@ void window_cb(CALLBACK_ARGS)
     if(WID->stat_window->shown()) WID->stat_window->show();
     if(WID->msg_window->shown()) WID->msg_window->show();
     WID->m_window->show();
-    break;
-  default:
-    break;
+  }
+}
+
+void activate_cb(CALLBACK_ARGS)
+{
+  // this is a central callback to activate/deactivate parts of the
+  // GUI depending on the user's choices (or the option settings)
+
+  char *str = (char*)data;
+
+  if(!strcmp(str, "rotation_center")){
+    if(WID->gen_butt[15]->value()) {
+      WID->gen_push_butt[0]->deactivate();
+      WID->gen_value[8]->deactivate();
+      WID->gen_value[9]->deactivate();
+      WID->gen_value[10]->deactivate();
+    }
+    else {
+      WID->gen_push_butt[0]->activate();
+      WID->gen_value[8]->activate();
+      WID->gen_value[9]->activate();
+      WID->gen_value[10]->activate();
+    }
+  }
+  else if(!strcmp(str, "custom_range")){
+    if(WID->view_choice[7]->value() == 2){
+      WID->view_value[31]->activate();
+      WID->view_value[32]->activate();
+    }
+    else {
+      WID->view_value[31]->deactivate();
+      WID->view_value[32]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "general_transform")){
+    if(WID->view_butt[6]->value()){
+      WID->view_choice[11]->activate();
+      WID->view_value[2]->activate();
+      WID->view_input[4]->activate();
+      WID->view_input[5]->activate();
+      WID->view_input[6]->activate();
+    }
+    else{
+      WID->view_choice[11]->deactivate();
+      WID->view_value[2]->deactivate();
+      WID->view_input[4]->deactivate();
+      WID->view_input[5]->deactivate();
+      WID->view_input[6]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "general_axes")){
+    if(WID->gen_choice[4]->value()){
+      WID->gen_value[17]->activate();
+      WID->gen_value[18]->activate();
+      WID->gen_value[19]->activate();
+      WID->gen_input[3]->activate();
+      WID->gen_input[4]->activate();
+      WID->gen_input[5]->activate();
+      WID->gen_input[6]->activate();
+      WID->gen_input[7]->activate();
+      WID->gen_input[8]->activate();
+    }
+    else{
+      WID->gen_value[17]->deactivate();
+      WID->gen_value[18]->deactivate();
+      WID->gen_value[19]->deactivate();
+      WID->gen_input[3]->deactivate();
+      WID->gen_input[4]->deactivate();
+      WID->gen_input[5]->deactivate();
+      WID->gen_input[6]->deactivate();
+      WID->gen_input[7]->deactivate();
+      WID->gen_input[8]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "general_axes_auto")){
+    if(WID->gen_butt[0]->value()){
+      WID->gen_value[20]->deactivate();
+      WID->gen_value[21]->deactivate();
+      WID->gen_value[22]->deactivate();
+      WID->gen_value[23]->deactivate();
+      WID->gen_value[24]->deactivate();
+      WID->gen_value[25]->deactivate();
+    }
+    else{
+      WID->gen_value[20]->activate();
+      WID->gen_value[21]->activate();
+      WID->gen_value[22]->activate();
+      WID->gen_value[23]->activate();
+      WID->gen_value[24]->activate();
+      WID->gen_value[25]->activate();
+    }
+  }
+  else if(!strcmp(str, "general_small_axes")){
+    if(WID->gen_butt[1]->value()){
+      WID->gen_value[26]->activate();
+      WID->gen_value[27]->activate();
+    }
+    else{
+      WID->gen_value[26]->deactivate();
+      WID->gen_value[27]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "mesh_cut_plane")){
+    if(WID->mesh_butt[16]->value()){
+      WID->mesh_cut_plane->activate();
+    }
+    else{
+      WID->mesh_cut_plane->deactivate();
+    }
+  }
+  else if(!strcmp(str, "mesh_light")){
+    if(WID->mesh_butt[17]->value()){
+      WID->mesh_butt[18]->activate();
+      WID->mesh_butt[19]->activate();
+      WID->mesh_value[18]->activate();
+    }
+    else{
+      WID->mesh_butt[18]->deactivate();
+      WID->mesh_butt[19]->deactivate();
+      WID->mesh_value[18]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "view_light")){
+    if(WID->view_butt[11]->value()){
+      WID->view_butt[9]->activate();
+      WID->view_butt[12]->activate();
+      WID->view_value[10]->activate();
+    }
+    else{
+      WID->view_butt[9]->deactivate();
+      WID->view_butt[12]->deactivate();
+      WID->view_value[10]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "view_axes")){
+    if(WID->view_choice[8]->value()){
+      WID->view_value[3]->activate();
+      WID->view_value[4]->activate();
+      WID->view_value[5]->activate();
+      WID->view_input[7]->activate();
+      WID->view_input[8]->activate();
+      WID->view_input[9]->activate();
+      WID->view_input[10]->activate();
+      WID->view_input[11]->activate();
+      WID->view_input[12]->activate();
+    }
+    else{
+      WID->view_value[3]->deactivate();
+      WID->view_value[4]->deactivate();
+      WID->view_value[5]->deactivate();
+      WID->view_input[7]->deactivate();
+      WID->view_input[8]->deactivate();
+      WID->view_input[9]->deactivate();
+      WID->view_input[10]->deactivate();
+      WID->view_input[11]->deactivate();
+      WID->view_input[12]->deactivate();
+    }
+  }
+  else if(!strcmp(str, "view_axes_auto_3d")){
+    if(WID->view_butt[25]->value()){
+      WID->view_value[13]->deactivate();
+      WID->view_value[14]->deactivate();
+      WID->view_value[15]->deactivate();
+      WID->view_value[16]->deactivate();
+      WID->view_value[17]->deactivate();
+      WID->view_value[18]->deactivate();
+    }
+    else{
+      WID->view_value[13]->activate();
+      WID->view_value[14]->activate();
+      WID->view_value[15]->activate();
+      WID->view_value[16]->activate();
+      WID->view_value[17]->activate();
+      WID->view_value[18]->activate();
+    }
+  }
+  else if(!strcmp(str, "view_axes_auto_2d")){
+    if(WID->view_butt[7]->value()){
+      WID->view_value[20]->deactivate();
+      WID->view_value[21]->deactivate();
+      WID->view_value[22]->deactivate();
+      WID->view_value[23]->deactivate();
+    }
+    else{
+      WID->view_value[20]->activate();
+      WID->view_value[21]->activate();
+      WID->view_value[22]->activate();
+      WID->view_value[23]->activate();
+    }
   }
 }
 
@@ -185,48 +372,51 @@ void window_cb(CALLBACK_ARGS)
 
 void status_xyz1p_cb(CALLBACK_ARGS)
 {
-  switch ((long)data) {
-  case 0: // X-axis pointing out of the screen
+  char *str = (char*)data;
+
+  if(!strcmp(str, "x")){ // X-axis pointing out of the screen
     CTX.r[0] = -90.;
     CTX.r[1] = 0.;
     CTX.r[2] = -90.;
     CTX.setQuaternionFromEulerAngles();
     Draw();
-    break;
-  case 1: // Y-axis pointing out of the screen
-    if(CTX.useTrackball)
-      CTX.setQuaternion(1. / sqrt(2.), 0., 0., 1. / sqrt(2.));
+  }
+  else if(!strcmp(str, "y")){ // Y-axis pointing out of the screen
     CTX.r[0] = 0.;
     CTX.r[1] = 90.;
     CTX.r[2] = 90.;
     CTX.setQuaternionFromEulerAngles();
     Draw();
-    break;
-  case 6: // reset everything
-    CTX.t[0] = CTX.t[1] = CTX.t[2] = 0.;
-    CTX.s[0] = CTX.s[1] = CTX.s[2] = 1.;
-    // fall-through
-  case 2: // Z-axis pointing out of the screen
+  }
+  else if(!strcmp(str, "z")){ // Z-axis pointing out of the screen
     CTX.r[0] = 0.;
     CTX.r[1] = 0.;
     CTX.r[2] = 0.;
     CTX.setQuaternionFromEulerAngles();
     Draw();
-    break;
-  case 3: // reset translation and scaling
+  }
+  else if(!strcmp(str, "1:1")){ // reset translation and scaling
     CTX.t[0] = CTX.t[1] = CTX.t[2] = 0.;
     CTX.s[0] = CTX.s[1] = CTX.s[2] = 1.;
     Draw();
-    break;
-  case 4: // switch projection mode
+  }
+  else if(!strcmp(str, "reset")){ // reset everything
+    CTX.t[0] = CTX.t[1] = CTX.t[2] = 0.;
+    CTX.s[0] = CTX.s[1] = CTX.s[2] = 1.;
+    CTX.r[0] = 0.;
+    CTX.r[1] = 0.;
+    CTX.r[2] = 0.;
+    CTX.setQuaternionFromEulerAngles();
+    Draw();
+  }
+  else if(!strcmp(str, "p")){ // switch projection mode
     opt_general_orthographic(0, GMSH_SET | GMSH_GUI, 
 			     !opt_general_orthographic(0, GMSH_GET, 0));
     Draw();
-    break;
-  case 5: // display options
+  }
+  else if(!strcmp(str, "?")){ // display options
     Print_Options(0, GMSH_FULLRC, false, NULL);
     WID->create_message_window();
-    break;
   }
   WID->update_manip_window();
 }
@@ -659,11 +849,6 @@ void general_options_color_scheme_cb(CALLBACK_ARGS)
   Draw();
 }
 
-void general_options_rotation_center_cb(CALLBACK_ARGS)
-{
-  WID->check_rotation_center_button();
-}
-
 void general_options_rotation_center_select_cb(CALLBACK_ARGS)
 {
   Vertex *v;
@@ -959,7 +1144,14 @@ void statistics_update_cb(CALLBACK_ARGS)
 
 void statistics_histogram_cb(CALLBACK_ARGS)
 {
-  int type = (int)(long)data;
+  char *str = (char*)data;
+  int type;
+  if(!strcmp(str, "gamma"))
+    type = 0;
+  else if(!strcmp(str, "eta"))
+    type = 1;
+  else
+    type = 2;
 
   Print_Histogram(THEM->Histogram[type]);
 
@@ -1166,7 +1358,17 @@ void visibility_ok_cb(CALLBACK_ARGS)
 
 void visibility_sort_cb(CALLBACK_ARGS)
 {
-  int selectall, val = (int)(long)data;
+  int selectall, val;
+  char *str = (char*)data;
+
+  if(!strcmp(str, "type"))
+    val = 1;
+  else if(!strcmp(str, "number"))
+    val = 2;
+  else if(!strcmp(str, "name"))
+    val = 3;
+  else
+    val = 0;
 
   if(!val) {
     selectall = 0;
@@ -3250,18 +3452,6 @@ void view_plugin_options_cb(CALLBACK_ARGS)
   p->dialogBox->main_window->show();
 }
 
-void view_options_custom_cb(CALLBACK_ARGS)
-{
-  if((long)data){
-    WID->view_value[31]->activate();
-    WID->view_value[32]->activate();
-  }
-  else {
-    WID->view_value[31]->deactivate();
-    WID->view_value[32]->deactivate();
-  }
-}
-
 void view_options_timestep_cb(CALLBACK_ARGS)
 {
   int links = (int)opt_post_link(0, GMSH_GET, 0);
diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h
index 01985c9ef8..15a4a52603 100644
--- a/Fltk/Callbacks.h
+++ b/Fltk/Callbacks.h
@@ -34,6 +34,7 @@ void color_cb(CALLBACK_ARGS);
 void view_color_cb(CALLBACK_ARGS);
 void redraw_cb(CALLBACK_ARGS);
 void window_cb(CALLBACK_ARGS);
+void activate_cb(CALLBACK_ARGS);
 
 // Graphical window
 
@@ -84,7 +85,6 @@ void options_ok_cb(CALLBACK_ARGS);
 
 void general_options_cb(CALLBACK_ARGS);
 void general_options_color_scheme_cb(CALLBACK_ARGS);
-void general_options_rotation_center_cb(CALLBACK_ARGS);
 void general_options_rotation_center_select_cb(CALLBACK_ARGS);
 void general_options_ok_cb(CALLBACK_ARGS);
 void general_arrow_param_cb(CALLBACK_ARGS);
@@ -131,7 +131,6 @@ void view_applybgmesh_cb(CALLBACK_ARGS);
 void view_plugin_options_cb(CALLBACK_ARGS);
 void view_plugin_cancel_cb(CALLBACK_ARGS);
 void view_options_cb(CALLBACK_ARGS);
-void view_options_custom_cb(CALLBACK_ARGS);
 void view_options_timestep_cb(CALLBACK_ARGS);
 void view_options_timestep_decr_cb(CALLBACK_ARGS);
 void view_options_timestep_incr_cb(CALLBACK_ARGS);
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index dd0fea51d1..8dbb6b1f36 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.425 2005-03-12 07:52:55 geuzaine Exp $
+// $Id: GUI.cpp,v 1.426 2005-03-12 20:17:41 geuzaine Exp $
 //
 // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
 //
@@ -121,7 +121,7 @@ Fl_Menu_Item m_menubar_table[] = {
     {"M&ouse Actions",        0, (Fl_Callback *)help_mouse_cb, 0},
     {"&Keyboard Shortcuts",   0, (Fl_Callback *)help_short_cb, 0},
     {"C&ommand Line Options", 0, (Fl_Callback *)help_command_line_cb, 0},
-    {"&Current Options",      0, (Fl_Callback *)status_xyz1p_cb, (void*)5, FL_MENU_DIVIDER},
+    {"&Current Options",      0, (Fl_Callback *)status_xyz1p_cb, (void*)"?", FL_MENU_DIVIDER},
     {"&About Gmsh...",        0, (Fl_Callback *)help_about_cb, 0},
     {0},
   {0}
@@ -150,16 +150,16 @@ Fl_Menu_Item m_sys_menubar_table[] = {
     {"Message Console", FL_CTRL+'l', (Fl_Callback *)message_cb, 0},
     {0},
   {"Window",0,0,0,FL_SUBMENU},
-    {"Minimize",           FL_CTRL+'m', (Fl_Callback *)window_cb, (void*)0},
-    {"Zoom",               0, (Fl_Callback *)window_cb, (void*)1, FL_MENU_DIVIDER},
-    {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)2},
+    {"Minimize",           FL_CTRL+'m', (Fl_Callback *)window_cb, (void*)"minimize"},
+    {"Zoom",               0, (Fl_Callback *)window_cb, (void*)"zoom", FL_MENU_DIVIDER},
+    {"Bring All to Front", 0, (Fl_Callback *)window_cb, (void*)"front"},
     {0},
   {"Help",0,0,0,FL_SUBMENU},
     {"Online Documentation", 0, (Fl_Callback *)help_online_cb, 0, FL_MENU_DIVIDER},
     {"Mouse Actions",        0, (Fl_Callback *)help_mouse_cb, 0},
     {"Keyboard Shortcuts",   0, (Fl_Callback *)help_short_cb, 0},
     {"Command Line Options", 0, (Fl_Callback *)help_command_line_cb, 0},
-    {"Current Options",      0, (Fl_Callback *)status_xyz1p_cb, (void*)5, FL_MENU_DIVIDER},
+    {"Current Options",      0, (Fl_Callback *)status_xyz1p_cb, (void*)"?", FL_MENU_DIVIDER},
     {"About Gmsh...",        0, (Fl_Callback *)help_about_cb, 0},
     {0},
   {0}
@@ -566,7 +566,7 @@ int GUI::global_shortcuts(int event)
     return 0;   // trick: do as if we didn't use it
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'a')) { 
-    window_cb(0, (void*)2);
+    window_cb(0, (void*)"front");
     return 1;
   }
   else if(Fl::test_shortcut(FL_SHIFT + 'o')) {
@@ -644,15 +644,15 @@ int GUI::global_shortcuts(int event)
     return 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'x')) {
-    status_xyz1p_cb(0, (void *)0);
+    status_xyz1p_cb(0, (void *)"x");
     return 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'y')) {
-    status_xyz1p_cb(0, (void *)1);
+    status_xyz1p_cb(0, (void *)"y");
     return 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'z')) {
-    status_xyz1p_cb(0, (void *)2);
+    status_xyz1p_cb(0, (void *)"z");
     return 1;
   }
   else if(Fl::test_shortcut(FL_ALT + 'a')) {
@@ -1306,28 +1306,28 @@ void GUI::create_graphic_window(int argc, char **argv)
 
   g_status_butt[0] = new Fl_Button(x, glheight + 2, sw, sh - 4, "X");
   x += sw;
-  g_status_butt[0]->callback(status_xyz1p_cb, (void *)0);
+  g_status_butt[0]->callback(status_xyz1p_cb, (void *)"x");
   g_status_butt[0]->tooltip("Set X view (Alt+x)");
 
   g_status_butt[1] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Y");
   x += sw;
-  g_status_butt[1]->callback(status_xyz1p_cb, (void *)1);
+  g_status_butt[1]->callback(status_xyz1p_cb, (void *)"y");
   g_status_butt[1]->tooltip("Set Y view (Alt+y)");
 
   g_status_butt[2] = new Fl_Button(x, glheight + 2, sw, sh - 4, "Z");
   x += sw;
-  g_status_butt[2]->callback(status_xyz1p_cb, (void *)2);
+  g_status_butt[2]->callback(status_xyz1p_cb, (void *)"z");
   g_status_butt[2]->tooltip("Set Z view (Alt+z)");
 
   g_status_butt[3] = new Fl_Button(x, glheight + 2, 2 * fontsize, sh - 4, "1:1");
   x += 2 * fontsize;
-  g_status_butt[3]->callback(status_xyz1p_cb, (void *)3);
+  g_status_butt[3]->callback(status_xyz1p_cb, (void *)"1:1");
   g_status_butt[3]->tooltip("Set unit scale");
 
   //FIXME: remove this until we do the perspective projection properly
   //g_status_butt[4] = new Fl_Button(x, glheight + 2, sw, sh - 4);
   //x += sw;
-  //g_status_butt[4]->callback(status_xyz1p_cb, (void *)4);
+  //g_status_butt[4]->callback(status_xyz1p_cb, (void *)"p");
   //g_status_butt[4]->tooltip("Set orthographic/perspective projection");
   ortho_bmp = new Fl_Bitmap(ortho_bits, ortho_width, ortho_height);
   persp_bmp = new Fl_Bitmap(persp_bits, persp_width, persp_height);
@@ -1335,7 +1335,7 @@ void GUI::create_graphic_window(int argc, char **argv)
 
   g_status_butt[5] = new Fl_Button(x, glheight + 2, sw, sh - 4, "?");
   x += sw;
-  g_status_butt[5]->callback(status_xyz1p_cb, (void *)5);
+  g_status_butt[5]->callback(status_xyz1p_cb, (void *)"?");
   g_status_butt[5]->tooltip("Show current options");
 
   g_status_butt[6] = new Fl_Button(x, glheight + 2, sw, sh - 4);
@@ -1600,22 +1600,6 @@ void GUI::reset_external_view_list()
   }
 }
 
-void GUI::check_rotation_center_button()
-{
-  if(gen_butt[15]->value()) {
-    gen_push_butt[0]->deactivate();
-    gen_value[8]->deactivate();
-    gen_value[9]->deactivate();
-    gen_value[10]->deactivate();
-  }
-  else {
-    gen_push_butt[0]->activate();
-    gen_value[8]->activate();
-    gen_value[9]->activate();
-    gen_value[10]->activate();
-  }
-}
-
 void GUI::create_option_window()
 {
   int width = 42 * fontsize;
@@ -1701,7 +1685,7 @@ void GUI::create_option_window()
       gen_butt[15]->type(FL_TOGGLE_BUTTON);
       gen_butt[15]->down_box(GMSH_TOGGLE_BOX);
       gen_butt[15]->selection_color(GMSH_TOGGLE_COLOR);
-      gen_butt[15]->callback(general_options_rotation_center_cb);
+      gen_butt[15]->callback(activate_cb, (void*)"rotation_center");
 
       gen_push_butt[0] = new Fl_Button(L + 2 * IW - 2 * WB, 2 * WB + 7 * BH, BB, BH, "Select");
       gen_push_butt[0]->callback(general_options_rotation_center_select_cb);
@@ -1719,6 +1703,7 @@ void GUI::create_option_window()
       gen_choice[4] = new Fl_Choice(L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Axes mode");
       gen_choice[4]->menu(menu_axes_mode);
       gen_choice[4]->align(FL_ALIGN_RIGHT);
+      gen_choice[4]->callback(activate_cb, (void*)"general_axes");
       gen_choice[4]->tooltip("(Alt+a)");
 
       gen_value[17] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 2 * BH, IW/3, BH);
@@ -1749,6 +1734,7 @@ void GUI::create_option_window()
       gen_butt[0]->type(FL_TOGGLE_BUTTON);
       gen_butt[0]->down_box(GMSH_TOGGLE_BOX);
       gen_butt[0]->selection_color(GMSH_TOGGLE_COLOR);
+      gen_butt[0]->callback(activate_cb, (void*)"general_axes_auto");
       
       gen_value[20] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 6 * BH, IW / 3, BH);
       gen_value[21] = new Fl_Value_Input(L + 2 * WB + IW / 3, 2 * WB + 6 * BH, IW / 3, BH);
@@ -1765,6 +1751,7 @@ void GUI::create_option_window()
       gen_butt[1]->type(FL_TOGGLE_BUTTON);
       gen_butt[1]->down_box(GMSH_TOGGLE_BOX);
       gen_butt[1]->selection_color(GMSH_TOGGLE_COLOR);
+      gen_butt[1]->callback(activate_cb, (void*)"general_small_axes");
 
       gen_value[26] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 9 * BH, IW / 2, BH);
       gen_value[26]->minimum(-1024);
@@ -2309,6 +2296,9 @@ void GUI::create_option_window()
       mesh_butt[16]->type(FL_TOGGLE_BUTTON);
       mesh_butt[16]->down_box(GMSH_TOGGLE_BOX);
       mesh_butt[16]->selection_color(GMSH_TOGGLE_COLOR);
+      mesh_butt[16]->callback(activate_cb, (void*)"mesh_cut_plane");
+
+      mesh_cut_plane = new Fl_Group(L + 2 * WB, 2 * WB + 2 * BH, width - 2 * WB, 6 * BH, 0);
 
       int ii = fontsize;
       Fl_Button *invert = new Fl_Button(L + 2 * WB, 2 * WB + 2 * BH, ii, 4*BH, "-");
@@ -2353,6 +2343,8 @@ void GUI::create_option_window()
       mesh_butt[23]->down_box(GMSH_TOGGLE_BOX);
       mesh_butt[23]->selection_color(GMSH_TOGGLE_COLOR);
 
+      mesh_cut_plane->end();
+
       o->end();
     }
     {
@@ -2402,6 +2394,7 @@ void GUI::create_option_window()
       mesh_butt[17]->type(FL_TOGGLE_BUTTON);
       mesh_butt[17]->down_box(GMSH_TOGGLE_BOX);
       mesh_butt[17]->selection_color(GMSH_TOGGLE_COLOR);
+      mesh_butt[17]->callback(activate_cb, (void*)"mesh_light");
 
       mesh_butt[18] = new Fl_Check_Button(L + 2 * WB, 2 * WB + 2 * BH, BW, BH, "Use two-side lighting");
       mesh_butt[18]->type(FL_TOGGLE_BUTTON);
@@ -2539,38 +2532,35 @@ void GUI::create_option_window()
       view_input[0] = new Fl_Input(L + 2 * WB, 2 * WB + 1 * BH, IW, BH, "Name");
       view_input[0]->align(FL_ALIGN_RIGHT);
 
-      view_input[1] = new Fl_Input(L + 2 * WB, 2 * WB + 2 * BH, IW, BH, "Format");
-      view_input[1]->align(FL_ALIGN_RIGHT);
-
       int sw = (int)(1.5 * fontsize);
-      view_butt_rep[0] = new Fl_Repeat_Button(L + 2 * WB, 2 * WB + 3 * BH, sw, BH, "-");
+      view_butt_rep[0] = new Fl_Repeat_Button(L + 2 * WB, 2 * WB + 2 * BH, sw, BH, "-");
       view_butt_rep[0]->callback(view_options_timestep_decr_cb);
-      view_butt_rep[1] = new Fl_Repeat_Button(L + 2 * WB + IW - sw, 2 * WB + 3 * BH, sw, BH, "+");
+      view_butt_rep[1] = new Fl_Repeat_Button(L + 2 * WB + IW - sw, 2 * WB + 2 * BH, sw, BH, "+");
       view_butt_rep[1]->callback(view_options_timestep_incr_cb);
-      view_value[50] = new Fl_Value_Input(L + 2 * WB + sw, 2 * WB + 3 * BH, IW - 2 * sw, BH);
+      view_value[50] = new Fl_Value_Input(L + 2 * WB + sw, 2 * WB + 2 * BH, IW - 2 * sw, BH);
       view_value[50]->callback(view_options_timestep_cb);
       view_value[50]->align(FL_ALIGN_RIGHT);
       view_value[50]->minimum(0);
       view_value[50]->maximum(0);
       view_value[50]->step(1);
-      Fl_Box *a = new Fl_Box(L + 2 * WB + IW, 2 * WB + 3 * BH, IW / 2, BH, "Step");
+      Fl_Box *a = new Fl_Box(L + 2 * WB + IW, 2 * WB + 2 * BH, IW / 2, BH, "Step");
       a->box(FL_NO_BOX);
       a->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
 
-      Fl_Box *b = new Fl_Box(FL_EMBOSSED_FRAME, L + 2 * WB, 2 * WB + 5 * BH-WB/2, width/2-3*WB, 3*BH+WB, "Graph type");
+      Fl_Box *b = new Fl_Box(FL_EMBOSSED_FRAME, L + 2 * WB, 2 * WB + 4 * BH-WB/2, width/2-3*WB, 3*BH+WB, "Plot type");
       b->align(FL_ALIGN_TOP|FL_ALIGN_CENTER);
 
-      view_butt[1] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 5 * BH, BW/2-3*WB, BH, "3D view");
+      view_butt[1] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 4 * BH, BW/2-3*WB, BH, "3D");
       view_butt[1]->type(FL_RADIO_BUTTON);
       view_butt[1]->down_box(GMSH_RADIO_BOX);
       view_butt[1]->selection_color(GMSH_RADIO_COLOR);
 
-      view_butt[2] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 6 * BH, BW/2-3*WB, BH, "2D space table");
+      view_butt[2] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 5 * BH, BW/2-3*WB, BH, "2D space");
       view_butt[2]->type(FL_RADIO_BUTTON);
       view_butt[2]->down_box(GMSH_RADIO_BOX);
       view_butt[2]->selection_color(GMSH_RADIO_COLOR);
 
-      view_butt[3] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 7 * BH, BW/2-3*WB, BH, "2D time table");
+      view_butt[3] = new Fl_Check_Button(L + 3 * WB, 2 * WB + 6 * BH, BW/2-3*WB, BH, "2D time");
       view_butt[3]->type(FL_RADIO_BUTTON);
       view_butt[3]->down_box(GMSH_RADIO_BOX);
       view_butt[3]->selection_color(GMSH_RADIO_COLOR);
@@ -2578,6 +2568,7 @@ void GUI::create_option_window()
       view_choice[8] = new Fl_Choice(L + width / 2, 2 * WB + 1 * BH, IW, BH, "Axes");
       view_choice[8]->menu(menu_axes_mode);
       view_choice[8]->align(FL_ALIGN_RIGHT);
+      view_choice[8]->callback(activate_cb, (void*)"view_axes");
       view_choice[8]->tooltip("(Alt+g)");
 
       view_value[3] = new Fl_Value_Input(L + width / 2, 2 * WB + 2 * BH, IW/3, BH);
@@ -2608,6 +2599,7 @@ void GUI::create_option_window()
       view_butt[25]->type(FL_TOGGLE_BUTTON);
       view_butt[25]->down_box(GMSH_TOGGLE_BOX);
       view_butt[25]->selection_color(GMSH_TOGGLE_COLOR);
+      view_butt[25]->callback(activate_cb, (void*)"view_axes_auto_3d");
       
       view_value[13] = new Fl_Value_Input(L + width / 2, 2 * WB + 6 * BH, IW / 3, BH);
       view_value[14] = new Fl_Value_Input(L + width / 2 + IW / 3, 2 * WB + 6 * BH, IW / 3, BH);
@@ -2623,6 +2615,7 @@ void GUI::create_option_window()
       view_butt[7]->type(FL_TOGGLE_BUTTON);
       view_butt[7]->down_box(GMSH_TOGGLE_BOX);
       view_butt[7]->selection_color(GMSH_TOGGLE_COLOR);
+      view_butt[7]->callback(activate_cb, (void*)"view_axes_auto_2d");
       
       view_value[20] = new Fl_Value_Input(L + width / 2, 2 * WB + 9 * BH, IW / 2, BH);
       view_value[20]->minimum(0);
@@ -2775,14 +2768,15 @@ void GUI::create_option_window()
       view_choice[0]->tooltip("(Alt+t)");
 
       static Fl_Menu_Item menu_range[] = {
-        {"Default", 0, (Fl_Callback *)view_options_custom_cb, (void*)0},
-        {"Per time step", 0, (Fl_Callback *)view_options_custom_cb, (void*)0},
-        {"Custom", 0, (Fl_Callback *)view_options_custom_cb, (void*)1},
+        {"Default", 0, 0, 0},
+        {"Per time step", 0, 0, 0},
+        {"Custom", 0, 0, 0},
         {0}
       };
       view_choice[7] = new Fl_Choice(L + 2 * WB, 2 * WB + 3 * BH, IW, BH, "Range type");
       view_choice[7]->menu(menu_range);
       view_choice[7]->align(FL_ALIGN_RIGHT);
+      view_choice[7]->callback(activate_cb, (void*)"custom_range");
 
       view_value[31] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 4 * BH, IW, BH, "Custom minimum");
       view_value[31]->align(FL_ALIGN_RIGHT);
@@ -2800,19 +2794,22 @@ void GUI::create_option_window()
       view_choice[1]->menu(menu_scale);
       view_choice[1]->align(FL_ALIGN_RIGHT);
 
-      view_butt[38] = new Fl_Check_Button(L + 2 * WB, 2 * WB + 7 * BH, BW, BH, "Saturate values");
+      view_input[1] = new Fl_Input(L + 2 * WB, 2 * WB + 7 * BH, IW, BH, "Number format");
+      view_input[1]->align(FL_ALIGN_RIGHT);
+
+      view_butt[38] = new Fl_Check_Button(L + 2 * WB, 2 * WB + 8 * BH, BW, BH, "Saturate values");
       view_butt[38]->type(FL_TOGGLE_BUTTON);
       view_butt[38]->down_box(GMSH_TOGGLE_BOX);
       view_butt[38]->selection_color(GMSH_TOGGLE_COLOR);
 
-      view_value[33] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 8 * BH, IW, BH, "Maximum recursion level");
+      view_value[33] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 9 * BH, IW, BH, "Maximum recursion level");
       view_value[33]->align(FL_ALIGN_RIGHT);
       view_value[33]->minimum(0);
       view_value[33]->maximum(MAX_LEVEL_OF_ZOOM);
       view_value[33]->step(1);
       view_value[33]->value(0);
 
-      view_value[34] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 9 * BH, IW, BH, "Target error");
+      view_value[34] = new Fl_Value_Input(L + 2 * WB, 2 * WB + 10 * BH, IW, BH, "Target error");
       view_value[34]->align(FL_ALIGN_RIGHT);
       view_value[34]->minimum(0);
       view_value[34]->maximum(1);
@@ -2866,6 +2863,7 @@ void GUI::create_option_window()
       view_butt[6]->type(FL_TOGGLE_BUTTON);
       view_butt[6]->down_box(GMSH_TOGGLE_BOX);
       view_butt[6]->selection_color(GMSH_TOGGLE_COLOR);
+      view_butt[6]->callback(activate_cb, (void*)"general_transform");
 
       view_choice[11] = new Fl_Choice(L + 2 * WB, 2 * WB + 6 * BH, IW, BH, "Data source");
       view_choice[11]->align(FL_ALIGN_RIGHT);
@@ -2986,6 +2984,7 @@ void GUI::create_option_window()
       view_butt[11]->type(FL_TOGGLE_BUTTON);
       view_butt[11]->down_box(GMSH_TOGGLE_BOX);
       view_butt[11]->selection_color(GMSH_TOGGLE_COLOR);
+      view_butt[11]->callback(activate_cb, (void*)"view_light");
 
       view_butt[9]  = new Fl_Check_Button(L + 2 * WB, 2 * WB + 2 * BH, BW, BH, "Use two-side lighting");
       view_butt[9]->type(FL_TOGGLE_BUTTON);
@@ -3141,16 +3140,12 @@ void GUI::update_view_window(int num)
 
   opt_view_nb_iso(num, GMSH_GUI, 0);
   opt_view_intervals_type(num, GMSH_GUI, 0);
-  int range_type = (int)opt_view_range_type(num, GMSH_GUI, 0);
+  opt_view_range_type(num, GMSH_GUI, 0);
   opt_view_custom_min(num, GMSH_GUI, 0);
   opt_view_custom_max(num, GMSH_GUI, 0);
   for(int i = 31; i <= 32; i++) {
     view_value[i]->minimum(v->CustomMin);
     view_value[i]->maximum(v->CustomMax);
-    if(range_type == DRAW_POST_RANGE_CUSTOM)
-      view_options_custom_cb(NULL, (void*)1);
-    else
-      view_options_custom_cb(NULL, (void*)0);
   }
   opt_view_scale_type(num, GMSH_GUI, 0);
   opt_view_saturate_values(num, GMSH_GUI, 0);
@@ -3295,11 +3290,11 @@ void GUI::create_statistics_window()
       stat_value[num++] = new Fl_Output(2 * WB, 2 * WB + 16 * BH, IW, BH, "Rho factor");
 
       Fl_Button *b0 = new Fl_Button(width - BB - 2 * WB, 2 * WB + 14 * BH, BB, BH, "Graph");
-      b0->callback(statistics_histogram_cb, (void *)0);
+      b0->callback(statistics_histogram_cb, (void *)"gamma");
       Fl_Button *b1 = new Fl_Button(width - BB - 2 * WB, 2 * WB + 15 * BH, BB, BH, "Graph");
-      b1->callback(statistics_histogram_cb, (void *)1);
+      b1->callback(statistics_histogram_cb, (void *)"eta");
       Fl_Button *b2 = new Fl_Button(width - BB - 2 * WB, 2 * WB + 16 * BH, BB, BH, "Graph");
-      b2->callback(statistics_histogram_cb, (void *)2);
+      b2->callback(statistics_histogram_cb, (void *)"rho");
 
       o->end();
     }
@@ -3663,19 +3658,19 @@ void GUI::create_visibility_window()
     vis_butt[0]->value(1);
 
     Fl_Button *o0 = new Fl_Button(2 * WB, 3 * WB + 2 * BH, cols[0], BH, "*");
-    o0->callback(visibility_sort_cb, (void *)0);
+    o0->callback(visibility_sort_cb, (void *)"*");
     
     Fl_Button *o1 = new Fl_Button(2 * WB + cols[0], 3 * WB + 2 * BH, cols[1], BH, "Type");
     o1->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
-    o1->callback(visibility_sort_cb, (void *)1);
+    o1->callback(visibility_sort_cb, (void *)"type");
 
     Fl_Button *o2 = new Fl_Button(2 * WB + cols[0] + cols[1], 3 * WB + 2 * BH, cols[2], BH, "Number");
     o2->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
-    o2->callback(visibility_sort_cb, (void *)2);
+    o2->callback(visibility_sort_cb, (void *)"number");
 
     Fl_Button *o3 = new Fl_Button(2 * WB + cols[0] + cols[1] + cols[2], 3 * WB + 2 * BH, cols[3], BH, "Name");
     o3->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
-    o3->callback(visibility_sort_cb, (void *)3);
+    o3->callback(visibility_sort_cb, (void *)"name");
     
     {
       Fl_Group *o = new Fl_Group(2 * WB, 3 * WB + 3 * BH, brw, height - 7 * WB - 5 * BH);
@@ -3920,7 +3915,7 @@ void GUI::create_manip_window()
 
   {
     Fl_Return_Button *o = new Fl_Return_Button(width - 2 * BB - 2 * WB, height - BH - WB, BB, BH, "Reset");
-    o->callback(status_xyz1p_cb, (void *)6);
+    o->callback(status_xyz1p_cb, (void *)"reset");
   }
   {
     Fl_Button *o = new Fl_Button(width - BB - WB, height - BH - WB, BB, BH, "Cancel");
diff --git a/Fltk/GUI.h b/Fltk/GUI.h
index 1bc3257890..fa7f219a4b 100644
--- a/Fltk/GUI.h
+++ b/Fltk/GUI.h
@@ -176,6 +176,7 @@ public:
   
   // mesh options
   Fl_Group         *mesh_group ;
+  Fl_Group         *mesh_cut_plane ;
   Fl_Check_Button  *mesh_butt[50] ;
   Fl_Input         *mesh_input[20] ;
   Fl_Value_Input   *mesh_value[20] ;
@@ -288,7 +289,6 @@ public:
   int  get_context();
   void set_anim_buttons(int mode);
   void check_anim_buttons();
-  void check_rotation_center_button();
   void set_status(char *msg, int num);
   void add_message(char *msg);
   void save_message(char *filename);
diff --git a/Graphics/Graph2D.cpp b/Graphics/Graph2D.cpp
index dcfd15659f..6aedb1c2d4 100644
--- a/Graphics/Graph2D.cpp
+++ b/Graphics/Graph2D.cpp
@@ -1,4 +1,4 @@
-// $Id: Graph2D.cpp,v 1.48 2005-03-12 07:52:56 geuzaine Exp $
+// $Id: Graph2D.cpp,v 1.49 2005-03-12 20:17:41 geuzaine Exp $
 //
 // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
 //
@@ -232,7 +232,7 @@ static void Draw_Graph2D(Post_View * v, double xx, double yy,
   }
 
   nb = v->AxesTics[0];
-  if(v->ShowScale) {
+  if(v->Axes) {
     sprintf(label, v->AxesFormat[0], -M_PI/1.e4);
     if((nb-1) * gl_width(label) > width)
       nb = (int)(width / gl_width(label)) + 1;
@@ -242,7 +242,7 @@ static void Draw_Graph2D(Post_View * v, double xx, double yy,
   dx = width / (double)(nb - 1);
   
   for(i = 0; i < nb; i++) {
-    if(v->Axes > 0) {
+    if(v->Axes) {
       glColor4ubv((GLubyte *) & CTX.color.fg);
       glBegin(GL_LINES);
       glVertex2d(xtop + i * dx, ybot);
@@ -267,8 +267,7 @@ static void Draw_Graph2D(Post_View * v, double xx, double yy,
         glLineWidth(CTX.line_width);
         gl2psLineWidth(CTX.line_width * CTX.print.eps_line_width_factor);
       }
-    }
-    if(v->ShowScale) {
+
       glColor4ubv((GLubyte *) & CTX.color.text);
       if(nb == 1)
         sprintf(label, v->AxesFormat[0], AbsMin);
@@ -279,7 +278,8 @@ static void Draw_Graph2D(Post_View * v, double xx, double yy,
       Draw_String_Center(label);
     }
   }
-  if(v->ShowScale) {
+
+  if(v->Axes) {
     glColor4ubv((GLubyte *) & CTX.color.text);
     sprintf(label, "%s", v->AxesLabel[0]);
     glRasterPos2d(xtop + width / 2, ybot - 2 * font_h - 2 * tic);
diff --git a/doc/texinfo/gmsh.texi b/doc/texinfo/gmsh.texi
index d551a0f849..d26596fd27 100644
--- a/doc/texinfo/gmsh.texi
+++ b/doc/texinfo/gmsh.texi
@@ -1,5 +1,5 @@
 \input texinfo.tex @c -*-texinfo-*-
-@c $Id: gmsh.texi,v 1.174 2005-03-11 05:47:56 geuzaine Exp $
+@c $Id: gmsh.texi,v 1.175 2005-03-12 20:17:41 geuzaine Exp $
 @c
 @c Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
 @c
@@ -2298,13 +2298,13 @@ post-processing view containing @emph{scalar points} as two-dimensional
 
 @itemize @bullet
 @item
-in a `2D space table', the scalar points are taken in the same order as they
+in a `2D space' plot, the scalar points are taken in the same order as they
 are defined in the post-processing view: the abscissa of the 2D graph is
 the curvilinear abscissa of the curve defined by the point series, and only
 one curve is drawn using the values associated with the points. If several
 time steps are available, each time step generates a new curve;
 @item
-in a `2D time table', one curve is drawn for each scalar point in the view
+in a `2D time' plot, one curve is drawn for each scalar point in the view
 and the abscissa is the time step.
 @end itemize
 
-- 
GitLab