diff --git a/Common/Context.cpp b/Common/Context.cpp index 2db6aea23ac6c1d9ac63c06899f22804fdf7200f..11329dab458a4cc5f2d663a716ea0183ba787ded 100644 --- a/Common/Context.cpp +++ b/Common/Context.cpp @@ -1,4 +1,4 @@ -// $Id: Context.cpp,v 1.29 2001-01-10 12:12:17 geuzaine Exp $ +// $Id: Context.cpp,v 1.30 2001-01-10 21:20:38 geuzaine Exp $ #include "Gmsh.h" #include "Const.h" @@ -198,8 +198,10 @@ void Init_Context(void){ CTX.threads = 1 ; // effective on Unix only with -D_USETHREADS CTX.threads_lock = 0 ; + // only used for motif CTX.font = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*" ; CTX.fixed_font = "fixed" ; + // end(only used for motif) CTX.lc = 1.0 ; CTX.min[0] = CTX.min[1] = CTX.min[2] = 0.0 ; diff --git a/Common/Context.h b/Common/Context.h index e35cabfc8a23186152abcdc7dffc18195f914215..b28187a03b71ace7abeac7dea18067542859026b 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -84,16 +84,20 @@ class Context_T { int fast; // inhibit mesh and postpro drawing when changing r,s,t int command_win; // command window? int display_lists; // use display lists? - int font_base; // display list indice for the font int axes, small_axes; // draw axes? int threads, threads_lock; // threads?, lock (should be a mutex...) int alpha; // enable alpha blending int flash; // authorize colormap flashing (beek) int same_visual; // force same visual for GUI and Graphics - - char *font; // main font for UI - int fontsize; // font size for UI + + //only used for Motif + int font_base; // display list index for the font + char *font; // main font char *fixed_font; // font for colorbar + //end(only used for Motif) + + int fontsize; // font size for fltk UI + int glfontsize; // font size for opengl graphics // OpenGL stuff int viewport[4]; // current viewport diff --git a/Common/GmshUI.h b/Common/GmshUI.h index 3b51c73c2ed019379c4956217c0673c37755544a..2e75a82dc7e68745c92b09e9bef9623b0ceda09e 100644 --- a/Common/GmshUI.h +++ b/Common/GmshUI.h @@ -19,7 +19,7 @@ #elif _FLTK // FLTK for both Unix and Windows #include <FL/Fl.H> -#include <GL/gl.h> +#include <FL/gl.h> #include <GL/glu.h> #endif diff --git a/Common/Options.h b/Common/Options.h index 70248d0bbefbc408d8fef548e004bb8fa6f63754..8753e82a638f00a5d8518d0d5e62ed2e438cc798 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -42,6 +42,8 @@ StringXNumber GeneralOptions_Number[] = { { "Viewport2" , GMSH_INT, (void*)&CTX.viewport[2] , 1. }, { "Viewport3" , GMSH_INT, (void*)&CTX.viewport[3] , 1. }, { "FontSize" , GMSH_INT, (void*)&CTX.fontsize , 12. }, + { "GraphicFontSize" , + GMSH_INT, (void*)&CTX.glfontsize , 12. }, { "Rotation0" , GMSH_DOUBLE, (void*)&CTX.r[0] , 0.0 }, { "Rotation1" , GMSH_DOUBLE, (void*)&CTX.r[1] , 0.0 }, { "Rotation2" , GMSH_DOUBLE, (void*)&CTX.r[2] , 0.0 }, diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp index 753163266a6b57615b9498210b2353f541a610ae..db1d82aadb9dda30395c2c0cab2c9c0783b52eea 100644 --- a/Fltk/GUI.cpp +++ b/Fltk/GUI.cpp @@ -807,12 +807,12 @@ void GUI::create_general_options_window(){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)gen_window); } { - Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "apply"); o->labelsize(CTX.fontsize); o->callback(ok_cb); } @@ -882,7 +882,6 @@ void GUI::create_geometry_options_window(){ geo_input = new Fl_Input(2*WB, 2*WB+5*BH, IW, BH, "Show by entity number"); geo_input->callback(opt_geometry_show_by_entity_num_cb); geo_input->labelsize(CTX.fontsize); - geo_input->type(FL_HORIZONTAL); geo_input->align(FL_ALIGN_RIGHT); geo_value[0] = new Fl_Value_Input(2*WB, 2*WB+6*BH, IW, BH, "Normals"); @@ -909,12 +908,12 @@ void GUI::create_geometry_options_window(){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)geo_window); } { - Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "apply"); o->labelsize(CTX.fontsize); o->callback(ok_cb); } @@ -1015,7 +1014,6 @@ void GUI::create_mesh_options_window(){ mesh_input = new Fl_Input(2*WB, 2*WB+5*BH, IW, BH, "Show by entity Number"); mesh_input->callback(opt_mesh_show_by_entity_num_cb); mesh_input->labelsize(CTX.fontsize); - mesh_input->type(FL_HORIZONTAL); mesh_input->align(FL_ALIGN_RIGHT); mesh_value[1] = new Fl_Value_Input(2*WB, 2*WB+6*BH, IW, BH, "Show by element quality"); @@ -1071,12 +1069,12 @@ void GUI::create_mesh_options_window(){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)mesh_window); } { - Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "apply"); o->labelsize(CTX.fontsize); o->callback(ok_cb); } @@ -1149,12 +1147,12 @@ void GUI::create_post_options_window(){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)post_window); } { - Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "apply"); o->labelsize(CTX.fontsize); o->callback(ok_cb); } @@ -1239,7 +1237,7 @@ void GUI::create_statistics_window(){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)stat_window); } @@ -1291,7 +1289,7 @@ void GUI::create_help_window(){ o->end(); { - Fl_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Button* o = new Fl_Button(width-60-WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)help_window); } @@ -1389,7 +1387,6 @@ void GUI::create_view_window(int num){ view_input[1] = new Fl_Input (2*WB, 2*WB+5*BH, IW, BH, "Format"); for(i=0 ; i<2 ; i++){ view_input[i]->labelsize(CTX.fontsize); - view_input[i]->type(FL_HORIZONTAL); view_input[i]->align(FL_ALIGN_RIGHT); } view_colorbar->end(); @@ -1522,12 +1519,12 @@ void GUI::create_view_window(int num){ } { - Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-2*60-2*WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)view_window); } { - Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "OK"); + Fl_Return_Button* o = new Fl_Return_Button(width-60-WB, height-BH-WB, 60, BH, "apply"); o->labelsize(CTX.fontsize); o->callback(ok_cb); } @@ -1676,7 +1673,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[1] = new Fl_Input (2*WB, 2*WB+2*BH, IW, BH, "Value"); for(i=0 ; i<2 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1696,7 +1692,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[5] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "Characteristic length"); for(i=2 ; i<6 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1715,7 +1710,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[8] = new Fl_Input (2*WB, 2*WB+3*BH, IW, BH, "Z component"); for(i=6 ; i<9 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1738,7 +1732,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[15] = new Fl_Input (2*WB, 2*WB+7*BH, IW, BH, "Angle in degrees"); for(i=9 ; i<16 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1758,7 +1751,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[19] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "Factor"); for(i=16 ; i<20 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1778,7 +1770,6 @@ void GUI::create_geometry_context_window(int num){ context_geometry_input[23] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "4th plane equation coefficient"); for(i=20 ; i<24 ; i++){ context_geometry_input[i]->labelsize(CTX.fontsize); - context_geometry_input[i]->type(FL_HORIZONTAL); context_geometry_input[i]->align(FL_ALIGN_RIGHT); } { @@ -1792,7 +1783,7 @@ void GUI::create_geometry_context_window(int num){ } { - Fl_Button* o = new Fl_Button(width-60-WB, height-BH-WB, 60, BH, "cancel"); + Fl_Button* o = new Fl_Button(width-60-WB, height-BH-WB, 60, BH, "close"); o->labelsize(CTX.fontsize); o->callback(cancel_cb, (void*)context_geometry_window); } diff --git a/Fltk/GUI.h b/Fltk/GUI.h index 03bebc63a23b4d280bc6d82d05b6bc5e1f1eeea0..dc35db84d536e5e26631280a675c5f80e225079e 100644 --- a/Fltk/GUI.h +++ b/Fltk/GUI.h @@ -12,15 +12,13 @@ #include <FL/Fl_Tabs.H> #include <FL/Fl_Button.H> #include <FL/Fl_Return_Button.H> -#include <FL/Fl_Toggle_Button.H> -#include <FL/Fl_Round_Button.H> #include <FL/Fl_Light_Button.H> #include <FL/Fl_Menu_Button.H> #include <FL/Fl_Check_Button.H> +#include <FL/Fl_Input.H> #include <FL/Fl_Value_Input.H> #include <FL/Fl_Output.H> #include <FL/Fl_Multiline_Output.H> -#include <FL/Fl_Browser.H> #include <FL/Fl_Bitmap.H> #include "Opengl_Window.h" diff --git a/Fltk/Opengl.cpp b/Fltk/Opengl.cpp index bab6f0a6c74f97c744c3ee5d019922a990a387b7..9bab4cc3440df836759e8a10e23ce97846baceb9 100644 --- a/Fltk/Opengl.cpp +++ b/Fltk/Opengl.cpp @@ -1,4 +1,4 @@ -// $Id: Opengl.cpp,v 1.8 2001-01-10 20:23:36 geuzaine Exp $ +// $Id: Opengl.cpp,v 1.9 2001-01-10 21:20:39 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -67,10 +67,10 @@ void Draw_String(char *s){ return ; } } - /* - glListBase(CTX.font_base); - glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *)s); - */ + + gl_font(FL_HELVETICA, CTX.glfontsize); + gl_draw(s); + } /* ------------------------------------------------------------------------ diff --git a/Graphics/Scale.cpp b/Graphics/Scale.cpp index b2e556d6305c863312740a39443172e14a893f66..28a659528596beea21e074932eceb6bb9c678acd 100644 --- a/Graphics/Scale.cpp +++ b/Graphics/Scale.cpp @@ -1,4 +1,4 @@ -// $Id: Scale.cpp,v 1.14 2001-01-10 10:06:17 geuzaine Exp $ +// $Id: Scale.cpp,v 1.15 2001-01-10 21:20:39 geuzaine Exp $ #include "Gmsh.h" #include "GmshUI.h" @@ -10,7 +10,7 @@ extern Context_T CTX; -#ifdef _XMOTIF +#if _XMOTIF #include "XContext.h" extern XContext_T XCTX; @@ -22,6 +22,12 @@ static XCharStruct overall; #define FONTHEIGHT XCTX.xfont.helve_h #define FONTASCENT XCTX.xfont.helve_a +#elif _FLTK + +#define CHECK_W cv_w=gl_width(label) +#define FONTHEIGHT gl_height() +#define FONTASCENT (gl_height()-gl_descent()) + #else #define CHECK_W cv_w=200