Skip to content
Snippets Groups Projects
Commit 4b61db25 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

*** empty log message ***

parent 9e525c36
No related branches found
No related tags found
No related merge requests found
// $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 "Gmsh.h"
#include "Const.h" #include "Const.h"
...@@ -198,8 +198,10 @@ void Init_Context(void){ ...@@ -198,8 +198,10 @@ void Init_Context(void){
CTX.threads = 1 ; // effective on Unix only with -D_USETHREADS CTX.threads = 1 ; // effective on Unix only with -D_USETHREADS
CTX.threads_lock = 0 ; CTX.threads_lock = 0 ;
// only used for motif
CTX.font = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*" ; CTX.font = "-*-helvetica-medium-r-*-*-*-*-*-*-*-*-*-*" ;
CTX.fixed_font = "fixed" ; CTX.fixed_font = "fixed" ;
// end(only used for motif)
CTX.lc = 1.0 ; CTX.lc = 1.0 ;
CTX.min[0] = CTX.min[1] = CTX.min[2] = 0.0 ; CTX.min[0] = CTX.min[1] = CTX.min[2] = 0.0 ;
......
...@@ -84,16 +84,20 @@ class Context_T { ...@@ -84,16 +84,20 @@ class Context_T {
int fast; // inhibit mesh and postpro drawing when changing r,s,t int fast; // inhibit mesh and postpro drawing when changing r,s,t
int command_win; // command window? int command_win; // command window?
int display_lists; // use display lists? int display_lists; // use display lists?
int font_base; // display list indice for the font
int axes, small_axes; // draw axes? int axes, small_axes; // draw axes?
int threads, threads_lock; // threads?, lock (should be a mutex...) int threads, threads_lock; // threads?, lock (should be a mutex...)
int alpha; // enable alpha blending int alpha; // enable alpha blending
int flash; // authorize colormap flashing (beek) int flash; // authorize colormap flashing (beek)
int same_visual; // force same visual for GUI and Graphics int same_visual; // force same visual for GUI and Graphics
char *font; // main font for UI //only used for Motif
int fontsize; // font size for UI int font_base; // display list index for the font
char *font; // main font
char *fixed_font; // font for colorbar 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 // OpenGL stuff
int viewport[4]; // current viewport int viewport[4]; // current viewport
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#elif _FLTK // FLTK for both Unix and Windows #elif _FLTK // FLTK for both Unix and Windows
#include <FL/Fl.H> #include <FL/Fl.H>
#include <GL/gl.h> #include <FL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#endif #endif
......
...@@ -42,6 +42,8 @@ StringXNumber GeneralOptions_Number[] = { ...@@ -42,6 +42,8 @@ StringXNumber GeneralOptions_Number[] = {
{ "Viewport2" , GMSH_INT, (void*)&CTX.viewport[2] , 1. }, { "Viewport2" , GMSH_INT, (void*)&CTX.viewport[2] , 1. },
{ "Viewport3" , GMSH_INT, (void*)&CTX.viewport[3] , 1. }, { "Viewport3" , GMSH_INT, (void*)&CTX.viewport[3] , 1. },
{ "FontSize" , GMSH_INT, (void*)&CTX.fontsize , 12. }, { "FontSize" , GMSH_INT, (void*)&CTX.fontsize , 12. },
{ "GraphicFontSize" ,
GMSH_INT, (void*)&CTX.glfontsize , 12. },
{ "Rotation0" , GMSH_DOUBLE, (void*)&CTX.r[0] , 0.0 }, { "Rotation0" , GMSH_DOUBLE, (void*)&CTX.r[0] , 0.0 },
{ "Rotation1" , GMSH_DOUBLE, (void*)&CTX.r[1] , 0.0 }, { "Rotation1" , GMSH_DOUBLE, (void*)&CTX.r[1] , 0.0 },
{ "Rotation2" , GMSH_DOUBLE, (void*)&CTX.r[2] , 0.0 }, { "Rotation2" , GMSH_DOUBLE, (void*)&CTX.r[2] , 0.0 },
......
...@@ -807,12 +807,12 @@ void GUI::create_general_options_window(){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)gen_window); 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->labelsize(CTX.fontsize);
o->callback(ok_cb); o->callback(ok_cb);
} }
...@@ -882,7 +882,6 @@ void GUI::create_geometry_options_window(){ ...@@ -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 = 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->callback(opt_geometry_show_by_entity_num_cb);
geo_input->labelsize(CTX.fontsize); geo_input->labelsize(CTX.fontsize);
geo_input->type(FL_HORIZONTAL);
geo_input->align(FL_ALIGN_RIGHT); geo_input->align(FL_ALIGN_RIGHT);
geo_value[0] = new Fl_Value_Input(2*WB, 2*WB+6*BH, IW, BH, "Normals"); 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(){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)geo_window); 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->labelsize(CTX.fontsize);
o->callback(ok_cb); o->callback(ok_cb);
} }
...@@ -1015,7 +1014,6 @@ void GUI::create_mesh_options_window(){ ...@@ -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 = 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->callback(opt_mesh_show_by_entity_num_cb);
mesh_input->labelsize(CTX.fontsize); mesh_input->labelsize(CTX.fontsize);
mesh_input->type(FL_HORIZONTAL);
mesh_input->align(FL_ALIGN_RIGHT); 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"); 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(){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)mesh_window); 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->labelsize(CTX.fontsize);
o->callback(ok_cb); o->callback(ok_cb);
} }
...@@ -1149,12 +1147,12 @@ void GUI::create_post_options_window(){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)post_window); 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->labelsize(CTX.fontsize);
o->callback(ok_cb); o->callback(ok_cb);
} }
...@@ -1239,7 +1237,7 @@ void GUI::create_statistics_window(){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)stat_window); o->callback(cancel_cb, (void*)stat_window);
} }
...@@ -1291,7 +1289,7 @@ void GUI::create_help_window(){ ...@@ -1291,7 +1289,7 @@ void GUI::create_help_window(){
o->end(); 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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)help_window); o->callback(cancel_cb, (void*)help_window);
} }
...@@ -1389,7 +1387,6 @@ void GUI::create_view_window(int num){ ...@@ -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"); view_input[1] = new Fl_Input (2*WB, 2*WB+5*BH, IW, BH, "Format");
for(i=0 ; i<2 ; i++){ for(i=0 ; i<2 ; i++){
view_input[i]->labelsize(CTX.fontsize); view_input[i]->labelsize(CTX.fontsize);
view_input[i]->type(FL_HORIZONTAL);
view_input[i]->align(FL_ALIGN_RIGHT); view_input[i]->align(FL_ALIGN_RIGHT);
} }
view_colorbar->end(); view_colorbar->end();
...@@ -1522,12 +1519,12 @@ void GUI::create_view_window(int num){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)view_window); 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->labelsize(CTX.fontsize);
o->callback(ok_cb); o->callback(ok_cb);
} }
...@@ -1676,7 +1673,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); context_geometry_input[1] = new Fl_Input (2*WB, 2*WB+2*BH, IW, BH, "Value");
for(i=0 ; i<2 ; i++){ for(i=0 ; i<2 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1696,7 +1692,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); context_geometry_input[5] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "Characteristic length");
for(i=2 ; i<6 ; i++){ for(i=2 ; i<6 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1715,7 +1710,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); context_geometry_input[8] = new Fl_Input (2*WB, 2*WB+3*BH, IW, BH, "Z component");
for(i=6 ; i<9 ; i++){ for(i=6 ; i<9 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1738,7 +1732,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); context_geometry_input[15] = new Fl_Input (2*WB, 2*WB+7*BH, IW, BH, "Angle in degrees");
for(i=9 ; i<16 ; i++){ for(i=9 ; i<16 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1758,7 +1751,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); context_geometry_input[19] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "Factor");
for(i=16 ; i<20 ; i++){ for(i=16 ; i<20 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1778,7 +1770,6 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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"); 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++){ for(i=20 ; i<24 ; i++){
context_geometry_input[i]->labelsize(CTX.fontsize); context_geometry_input[i]->labelsize(CTX.fontsize);
context_geometry_input[i]->type(FL_HORIZONTAL);
context_geometry_input[i]->align(FL_ALIGN_RIGHT); context_geometry_input[i]->align(FL_ALIGN_RIGHT);
} }
{ {
...@@ -1792,7 +1783,7 @@ void GUI::create_geometry_context_window(int num){ ...@@ -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->labelsize(CTX.fontsize);
o->callback(cancel_cb, (void*)context_geometry_window); o->callback(cancel_cb, (void*)context_geometry_window);
} }
......
...@@ -12,15 +12,13 @@ ...@@ -12,15 +12,13 @@
#include <FL/Fl_Tabs.H> #include <FL/Fl_Tabs.H>
#include <FL/Fl_Button.H> #include <FL/Fl_Button.H>
#include <FL/Fl_Return_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_Light_Button.H>
#include <FL/Fl_Menu_Button.H> #include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Check_Button.H> #include <FL/Fl_Check_Button.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Value_Input.H> #include <FL/Fl_Value_Input.H>
#include <FL/Fl_Output.H> #include <FL/Fl_Output.H>
#include <FL/Fl_Multiline_Output.H> #include <FL/Fl_Multiline_Output.H>
#include <FL/Fl_Browser.H>
#include <FL/Fl_Bitmap.H> #include <FL/Fl_Bitmap.H>
#include "Opengl_Window.h" #include "Opengl_Window.h"
......
// $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 "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -67,10 +67,10 @@ void Draw_String(char *s){ ...@@ -67,10 +67,10 @@ void Draw_String(char *s){
return ; return ;
} }
} }
/*
glListBase(CTX.font_base); gl_font(FL_HELVETICA, CTX.glfontsize);
glCallLists(strlen(s), GL_UNSIGNED_BYTE, (GLubyte *)s); gl_draw(s);
*/
} }
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
......
// $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 "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
extern Context_T CTX; extern Context_T CTX;
#ifdef _XMOTIF #if _XMOTIF
#include "XContext.h" #include "XContext.h"
extern XContext_T XCTX; extern XContext_T XCTX;
...@@ -22,6 +22,12 @@ static XCharStruct overall; ...@@ -22,6 +22,12 @@ static XCharStruct overall;
#define FONTHEIGHT XCTX.xfont.helve_h #define FONTHEIGHT XCTX.xfont.helve_h
#define FONTASCENT XCTX.xfont.helve_a #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 #else
#define CHECK_W cv_w=200 #define CHECK_W cv_w=200
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment