From c66f95bfab1e91abb2f24e423b792bca1141b17f Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Fri, 25 May 2001 08:43:24 +0000
Subject: [PATCH] global (empty) solver options

---
 Common/Bitmaps.h   |  5 +++-
 Fltk/Callbacks.cpp | 14 ++++++++---
 Fltk/Callbacks.h   |  5 ++++
 Fltk/GUI.cpp       | 62 +++++++++++++++++++++++++++++++++++++++++++---
 Fltk/GUI.h         |  7 ++++++
 5 files changed, 86 insertions(+), 7 deletions(-)

diff --git a/Common/Bitmaps.h b/Common/Bitmaps.h
index 7d341e776b..bb72a03dfb 100644
--- a/Common/Bitmaps.h
+++ b/Common/Bitmaps.h
@@ -49,7 +49,9 @@ static char g2_bits[] = {
  0x00,0x00,0xfc,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0xfc};
 
-// 'Gmsh command' (Unix) icon
+// 'Gmsh command' (Unix Motif) icon
+
+#ifdef _XMOTIF
 
 #define g3_width 66
 #define g3_height 29
@@ -73,6 +75,7 @@ static char g3_bits[] = {
  0x52,0x94,0xfd,0x30,0x00,0xe0,0x71,0x92,0x92,0x6c,0x64,0xfd,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0xfc};
 
+#endif
 
 // 'About Gmsh' bitmap
 
diff --git a/Fltk/Callbacks.cpp b/Fltk/Callbacks.cpp
index 02a9827321..db0239fac3 100644
--- a/Fltk/Callbacks.cpp
+++ b/Fltk/Callbacks.cpp
@@ -1,4 +1,4 @@
-// $Id: Callbacks.cpp,v 1.59 2001-05-23 07:29:42 geuzaine Exp $
+// $Id: Callbacks.cpp,v 1.60 2001-05-25 08:43:24 geuzaine Exp $
 
 #include <sys/types.h>
 #include <signal.h>
@@ -401,6 +401,14 @@ void opt_mesh_ok_cb(CALLBACK_ARGS) {
   Draw();
 }
 
+// Option Solver Menu
+
+void opt_solver_cb(CALLBACK_ARGS) {
+  WID->create_solver_options_window();
+}
+void opt_solver_ok_cb(CALLBACK_ARGS) {
+}
+
 // Option Post Menu
 
 void opt_post_cb(CALLBACK_ARGS) {
@@ -495,6 +503,8 @@ void help_short_cb(CALLBACK_ARGS){
   Msg(DIRECT, "  Alt+b         hide/show all post-processing scales");
   Msg(DIRECT, "  Alt+c         alternate between predefined color schemes");
   Msg(DIRECT, "  Alt+d         alternate between mesh wire frame, hidden lines and shading modes");
+  Msg(DIRECT, "  Shift+d       decrease animation delay");
+  Msg(DIRECT, "  Ctrl+Shift+d  increase animation delay");
   Msg(DIRECT, "  Alt+f         toggle redraw mode (fast/full)"); 
   Msg(DIRECT, "  Alt+l         hide/show geometry lines");
   Msg(DIRECT, "  Alt+Shift+l   hide/show mesh lines");
@@ -502,8 +512,6 @@ void help_short_cb(CALLBACK_ARGS){
   Msg(DIRECT, "  Alt+o         change projection mode");
   Msg(DIRECT, "  Alt+p         hide/show geometry points");
   Msg(DIRECT, "  Alt+Shift+p   hide/show mesh points");
-  Msg(DIRECT, "  Shift+s       decrease animation delay");
-  Msg(DIRECT, "  Ctrl+Shift+s  increase animation delay");
   Msg(DIRECT, "  Alt+s         hide/show geometry surfaces");
   Msg(DIRECT, "  Alt+Shift+s   hide/show mesh surfaces");
   Msg(DIRECT, "  Alt+t         alternate intervals mode for all post-processing views"); 
diff --git a/Fltk/Callbacks.h b/Fltk/Callbacks.h
index f9c77062cf..53c6c1a2ed 100644
--- a/Fltk/Callbacks.h
+++ b/Fltk/Callbacks.h
@@ -57,6 +57,11 @@ void opt_mesh_show_by_entity_num_cb(CALLBACK_ARGS) ;
 void opt_mesh_color_scheme_cb(CALLBACK_ARGS) ;
 void opt_mesh_ok_cb(CALLBACK_ARGS) ;
 
+// Option Solver Menu
+
+void opt_solver_cb(CALLBACK_ARGS) ;
+void opt_solver_ok_cb(CALLBACK_ARGS) ;
+
 // Option Post Menu
 
 void opt_post_cb(CALLBACK_ARGS) ;
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index 8a01411d62..8392ec5ebe 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -1,4 +1,4 @@
-// $Id: GUI.cpp,v 1.80 2001-05-24 10:11:28 geuzaine Exp $
+// $Id: GUI.cpp,v 1.81 2001-05-25 08:43:24 geuzaine Exp $
 
 // To make the interface as visually consistent as possible, please:
 // - use the BH, BW, WB, IW values for button heights/widths, window borders, etc.
@@ -62,6 +62,7 @@ Fl_Menu_Item m_menubar_table[] = {
     {"General...",         FL_SHIFT+'o', (Fl_Callback *)opt_general_cb, 0, FL_MENU_DIVIDER},
     {"Geometry...",        FL_SHIFT+'g', (Fl_Callback *)opt_geometry_cb, 0},
     {"Mesh...",            FL_SHIFT+'m', (Fl_Callback *)opt_mesh_cb, 0},
+    {"Solver...",          FL_SHIFT+'s', (Fl_Callback *)opt_solver_cb, 0},
     {"Post-processing...", FL_SHIFT+'p', (Fl_Callback *)opt_post_cb, 0, FL_MENU_DIVIDER},
     {"Save options now",   0,            (Fl_Callback *)opt_save_cb, 0},
     {0},
@@ -325,11 +326,11 @@ int GUI::global_shortcuts(int event){
     mesh_save_cb(0,0);
     return 1;
   }
-  else if(Fl::test_shortcut(FL_CTRL+FL_SHIFT+'s')){
+  else if(Fl::test_shortcut(FL_CTRL+FL_SHIFT+'d')){
     opt_post_anim_delay(0,GMSH_SET|GMSH_GUI,opt_post_anim_delay(0,GMSH_GET,0) + 0.01);
     return 1;
   }
-  else if(Fl::test_shortcut(FL_SHIFT+'s')){
+  else if(Fl::test_shortcut(FL_SHIFT+'d')){
     opt_post_anim_delay(0,GMSH_SET|GMSH_GUI,opt_post_anim_delay(0,GMSH_GET,0) - 0.01);
     return 1;
   }
@@ -460,6 +461,7 @@ GUI::GUI(int argc, char **argv) {
   init_general_options_window = 0;
   init_geometry_options_window = 0;
   init_mesh_options_window = 0;
+  init_solver_options_window = 0;
   init_post_options_window = 0;
   init_statistics_window = 0;
   init_message_window = 0;
@@ -499,6 +501,7 @@ GUI::GUI(int argc, char **argv) {
   create_general_options_window();
   create_geometry_options_window();
   create_mesh_options_window();
+  create_solver_options_window();
   create_post_options_window();
   create_view_options_window(-1);
   create_message_window();
@@ -1358,6 +1361,59 @@ void GUI::create_mesh_options_window(){
 
 }
 
+//******************** Create the window for solver options *******************
+
+void GUI::create_solver_options_window(){
+
+  if(!init_solver_options_window){
+    init_solver_options_window = 1 ;
+
+    int width = 20*CTX.fontsize;
+    int height = 5*WB+8*BH ;
+
+    solver_window = new Fl_Window(width,height);
+    solver_window->box(WINDOW_BOX);
+    solver_window->label("Solver options");
+    { 
+      Fl_Tabs* o = new Fl_Tabs(WB, WB, width-2*WB, height-3*WB-BH);
+      { 
+	Fl_Group* o = new Fl_Group(WB, WB+BH, width-2*WB, height-3*WB-2*BH, "Solvers");
+	o->labelsize(CTX.fontsize);
+	Fl_Box *text =  new Fl_Box(FL_NO_BOX, 2*WB, 3*WB+1*BH, width-4*WB, 2*BH,
+				   "There are no global solver options available yet");
+	text->align(FL_ALIGN_LEFT|FL_ALIGN_TOP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
+	text->labelsize(CTX.fontsize);
+	o->end();
+      }
+      o->end();
+    }
+
+    { 
+      Fl_Return_Button* o = new Fl_Return_Button(width-2*BB-2*WB, height-BH-WB, BB, BH, "OK");
+      o->labelsize(CTX.fontsize);
+      o->callback(opt_solver_ok_cb);
+    }
+    { 
+      Fl_Button* o = new Fl_Button(width-BB-WB, height-BH-WB, BB, BH, "Cancel");
+      o->labelsize(CTX.fontsize);
+      o->callback(cancel_cb, (void*)solver_window);
+    }
+
+    if(CTX.center_windows)
+      solver_window->position(m_window->x()+m_window->w()/2-width/2,
+			      m_window->y()+9*BH-height/2);
+    solver_window->end();
+  }
+  else{
+    if(solver_window->shown())
+      solver_window->redraw();
+    else
+      solver_window->show();
+
+  }
+
+}
+
 
 //******************** Create the window for post-processing options *******************
 
diff --git a/Fltk/GUI.h b/Fltk/GUI.h
index 86677e1f3e..678fad3abd 100644
--- a/Fltk/GUI.h
+++ b/Fltk/GUI.h
@@ -128,6 +128,12 @@ public:
   Fl_Value_Input   *mesh_value[20] ;
   Fl_Button        *mesh_col[50] ;
 
+  // solver options window
+  int init_solver_options_window;
+  Fl_Window        *solver_window ;
+  Fl_Check_Button  *solver_butt[20] ;
+  Fl_Value_Input   *solver_value[20] ;
+
   // post-processing options window
   int init_post_options_window;
   Fl_Window        *post_window ;
@@ -184,6 +190,7 @@ public:
   void create_general_options_window();
   void create_geometry_options_window();
   void create_mesh_options_window();
+  void create_solver_options_window();
   void create_post_options_window();
   PluginDialogBox *create_plugin_window(GMSH_Plugin *, int);
   void create_view_options_window(int numview);
-- 
GitLab