From d68b88283a20eaee29ef5b59abb8418cd4d83dd8 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Wed, 11 Sep 2013 16:08:39 +0000
Subject: [PATCH] add window titles in quick access mode

---
 Fltk/graphicWindow.cpp | 12 ++++++------
 Fltk/helpWindow.cpp    |  7 ++++---
 Fltk/helpWindow.h      |  1 +
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp
index b17afb7ab9..491b8785cc 100644
--- a/Fltk/graphicWindow.cpp
+++ b/Fltk/graphicWindow.cpp
@@ -2210,7 +2210,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
     opt_general_orthographic(0, GMSH_SET | GMSH_GUI, 0);
     drawContext::global()->draw();
     numberOrStringOptionChooser("General", 0, "ClipFactor",
-                                true, true, 0.1, 20., 0.1);
+                                true, "Factor", true, 0.1, 20., 0.1);
   }
   else if(what == "geometry_points")
     opt_geometry_points(0, GMSH_SET|GMSH_GUI,
@@ -2244,7 +2244,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
                            !opt_mesh_volumes_faces(0, GMSH_GET, 0));
   else if(what == "mesh_size")
     numberOrStringOptionChooser("Mesh", 0, "CharacteristicLengthFactor",
-                                true, true, 0.01, 100, 0.01);
+                                true, "Size Factor", true, 0.01, 100, 0.01);
   else if(what == "view_element_outlines"){
     int set = 0;
     for(unsigned int i = 0; i < PView::list.size(); i++)
@@ -2264,7 +2264,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
         if(!maxval) maxval = 1.;
         double val2 = 2. * CTX::instance()->lc / maxval;
         val = numberOrStringOptionChooser("View", i, "NormalRaise",
-                                          true, true, -val2, val2, val2 / 200.);
+                                          true, "Raise", true, -val2, val2, val2 / 200.);
         break;
       }
     }
@@ -2281,7 +2281,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
     for(unsigned int i = 0; i < PView::list.size(); i++){
       if(opt_view_visible(i, GMSH_GET, 0)){
         val = numberOrStringOptionChooser("View", i, "NbIso",
-                                          true, true, 1, 100, 1);
+                                          true, "Intervals", true, 1, 100, 1);
         break;
       }
     }
@@ -2303,7 +2303,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
     for(unsigned int i = 0; i < PView::list.size(); i++){
       if(opt_view_visible(i, GMSH_GET, 0)){
         val = numberOrStringOptionChooser("View", i, "NbIso",
-                                          true, true, 1, 100, 1);
+                                          true, "Intervals", true, 1, 100, 1);
         break;
       }
     }
@@ -2339,7 +2339,7 @@ void quick_access_cb(Fl_Widget *w, void *data)
         if(!maxval) maxval = 1.;
         double val3 = 2. * CTX::instance()->lc / maxval;
         val = numberOrStringOptionChooser("View", i, "DisplacementFactor",
-                                          true, true, 0, val3, val3 / 100.);
+                                          true, "Factor", true, 0, val3, val3 / 100.);
         break;
       }
     }
diff --git a/Fltk/helpWindow.cpp b/Fltk/helpWindow.cpp
index d0706dd7cd..d24cd22559 100644
--- a/Fltk/helpWindow.cpp
+++ b/Fltk/helpWindow.cpp
@@ -45,6 +45,7 @@ static void interactive_cb(Fl_Widget* w, void* data)
 
 double numberOrStringOptionChooser(const std::string &category, int index,
                                    const std::string &name, bool isNumber,
+                                   const std::string &title,
                                    bool isInteractive, double minimum,
                                    double maximum, double step)
 {
@@ -57,11 +58,11 @@ double numberOrStringOptionChooser(const std::string &category, int index,
 
   int nn = (isInteractive ? 2 : 3);
   int width = nn * BB + (nn + 1) * WB, height = 2 * BH + 3 * WB;
-  Fl_Window *win = new paletteWindow(width, height, false,
-                                     isNumber ? "Number Chooser" : "String Chooser");
+  std::string t = title;
+  if(t.empty()) t = (isNumber ? "Number Chooser" : "String Chooser");
+  Fl_Window *win = new paletteWindow(width, height, false, t.c_str());
   win->set_modal();
   win->hotspot(win);
-  if(isInteractive) win->clear_border();
   Fl_Value_Input *number = 0;
   Fl_Input *string = 0;
   if(isNumber){
diff --git a/Fltk/helpWindow.h b/Fltk/helpWindow.h
index a8d43abba8..32f7e3ae3c 100644
--- a/Fltk/helpWindow.h
+++ b/Fltk/helpWindow.h
@@ -22,6 +22,7 @@ class helpWindow{
 void help_options_cb(Fl_Widget *w, void *data);
 double numberOrStringOptionChooser(const std::string &category, int index,
                                    const std::string &name, bool isNumber=true,
+                                   const std::string &title="",
                                    bool isInteractive=false, double minimum=0.,
                                    double maximum=0., double step=0.);
 
-- 
GitLab