# data file for the Fltk User Interface Designer (fluid)
version 1.0300 
i18n_type 1 
i18n_include "giac/giacintl.h" 
i18n_function gettext 
header_name {.h} 
code_name {.cxx}
decl {\#include <algorithm>} {public local
} 

decl {\#include "Xcas1.h"} {public local
} 

decl {\#include "Help1.h"} {public local
} 

decl {\#include <FL/fl_ask.H>} {public local
} 

decl {\#include <FL/Fl_Tooltip.H>} {public local
} 

decl {\#include <FL/Fl_Bitmap.H>} {public local
} 

decl {\#include <FL/fl_show_colormap.H>} {public local
} 

decl {\#include <FL/gl.h>} {public local
} 

decl {\#include "Input.h"} {public local
} 

decl {\#include "Editeur.h"} {public local
} 

decl {\#include "Equation.h"} {public local
} 

decl {\#include "History.h"} {public local
} 

decl {\#include "Tableur.h"} {public local
} 

decl {\#include "Cfg.h"} {public local
} 

decl {\#include <giac/giac.h>} {public local
} 

decl {\#include <giac/misc.h>} {public local
} 

declblock {\#ifdef FL_DEVICE} {open after {\#endif}
} {
  decl {\#include <FL/Fl_Printer.H>} {private local
  }
} 

decl {/* */ namespace xcas { extern int printer_format; extern bool printer_landscape; void widget_ps_print(Fl_Widget * widget,const std::string & fname,bool eps,int pngpdf,bool preview,bool,bool ); void widget_print(Fl_Widget * widget);}} {private local
} 

declblock {\#ifdef HAVE_MALLOC_H} {open after {\#endif}
} {
  decl {\#include <malloc.h>} {private local
  }
} 

decl {char ** xcas_argv;} {private local
} 

decl {int xcas_argc,xcas_user_level,update_xcas=0;} {private local
} 

decl {xcas::objet_bidon mon_objet_bidon;} {private local
} 

decl {giac::vecteur rpn_menu;} {private local
} 

decl {giac::vecteur rpn_description;} {private local
} 

decl {unsigned rpn_menu_page;} {private local
} 

decl {std::string rpn_menu_string[6],rpnn_menu_string[5],doc_prefix("doc/fr/"); bool rpn_menu_is_directory[6];} {private local
} 

decl {giac::vecteur home_menu, rpnn_menu[5];} {private local
} 

Function {Xcas_alt_ctrl_cb(int i)} {return_type void
} {
  code {if (!(i & 1)){
  Xcas_Alpha_Keyboard->hide();
  Xcas_Scientific_Keyboard->show();
}} {}
} 

Function {Xcas_current_session()} {return_type {Fl_Widget *}
} {
  code {Fl_Widget * wid=Xcas_Main_Tab->value();
  if (xcas::History_Fold * hf=dynamic_cast<xcas::History_Fold *>(wid))
    wid=hf->pack;
  return wid;} {}
} 

Function {Xcas_get_context()} {return_type {const giac::context *}
} {
  code {Fl_Widget * wid=Xcas_Main_Tab->value();
  if (xcas::History_Fold * hf=dynamic_cast<xcas::History_Fold *>(wid))
    wid=hf->pack;
  return xcas::get_context(wid);} {}
} 

Function {Xcas_Keyboard_Switch(unsigned u)} {return_type void
} {
  code {bool always_show=u&0x8000;
   bool always_hide=u&0x4000;
   if (u & 1){
    if ( always_hide || (!always_show && Xcas_Keyboard_Group->visible()) ) {
      Xcas_Keyboard_Group->hide(); 
    } else {
      Xcas_Keyboard_Group->show(); 
    }
   }
   if (u & 2){
     if ( always_hide || (!always_show && Xcas_Messages->visible() ) ){
       Xcas_Messages->hide(); 
     } else {
       Xcas_Messages->show(); 
     }
   }
   if (u & 4){
     if (always_hide || (!always_show && Xcas_Bandeau_Keys->visible() ) ){
       Xcas_Bandeau_Keys->hide(); 
     } else {
       Xcas_Bandeau_Keys->show(); 
     }
   }
   if (u & 8){
     if (always_hide || (!always_show &&Xcas_Messages->visible() ) ){
       Xcas_Messages->hide(); 
     } else {
       Xcas_Messages->show(); 
     }
   }
   Xcas_resize_mainwindow();} {}
} 

Function {hist_max(int i,int j)} {return_type int
} {
  code {return i>j?i:j;} {}
} 

Function {hist_min(int i,int j)} {return_type int
} {
  code {return i>j?j:i;} {}
} 

Function {Xcas_save_all(Fl_Group * wid)} {return_type bool
} {
  code {int n=wid->children();
    for (int i=0;i<n;++i){
      if (xcas::History_Fold * f=dynamic_cast<xcas::History_Fold *>(wid->child(i))){
	if (f->pack->_modified){
	  char chaine[25]; // enough even for very large numbers!
	  sprintf(chaine,"%i",i+1);
	  std::string name="session "+std::string(chaine)+" ";
	  if (f->pack->url)
	    name += *f->pack->url ;
	  int j=xcas::confirm_close((name+gettext(" has changed. Save?")).c_str());
	  if (j==0)
	    return false;
	  if (j!=2)
	    f->pack->save(name.c_str());
	  else
	    f->pack->clear_modified();
	  f->autosave_rm();
	}
      } // end if dynamic...
    } // end for
    return true;} {}
} 

Function {latex_save_DispG(const char * filename)} {return_type void
} {
  code {double xunit=giac::horiz_latex/(Xcas_DispG_->window_xmax-Xcas_DispG_->window_xmin);
  double yunit=giac::vert_latex/(Xcas_DispG_->window_ymax-Xcas_DispG_->window_ymin);
  graph2tex(filename,Xcas_DispG_->plot_instructions,Xcas_DispG_->window_xmin,Xcas_DispG_->window_xmax,Xcas_DispG_->window_ymin,Xcas_DispG_->window_ymax,xunit,yunit,false,giac::context0);} {}
} 

Function {a_propos()} {return_type void
} {
  code {std::string s("xcas "); s+=GIAC_VERSION; s+=" (c) 2000-18, Bernard Parisse, Renee De Graeve\\n";
  s += "Optimization, signalprocessing, graph theory code and manuals: Luka Marohnić\\n";
  s += "http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac.html\\n";
  s += "If you like Xcas, please link your webpage to the above link to help other find it\\n";
  s += "Software licensed under the GPL, General Public License version 3.0 or later\\nSee the file COPYING in this package for more details\\nOr browse http://www.gnu.org\\n";
  s += "French documentation (c) Renee de Graeve\\n";
  s += "This documentation is freely redistribuable for non commercial purpose\\n";
  s += "Python giacpy module: Frederic Han\\n";
  s += "Math ML and SVG support initially written by Jean-Pierre Branchard\\n";
  s += "OpenOffice interface: Christophe Devalland, Serge Moutou\\n";
  s += "Qcas interface: Loic Le Coq, Frederic Han\\n";
  s += "Androcas interface: Thomas Luka\\n";
  s += "SmartCAS interface: Nicolas Pujol\\n";
  s += "English user guide translation maintained by Jay Belanger\\n";
  s += "Greek localization, Alkiviadis Akritas, Eugenia Kelepesi-Akritas, George Nasopoulos, Nikos Larisis\\n";
  s += "Spanish localization, Xavier Vidaux, J. Manrique Lopez\\n";
  s += "German short help localization, Philipp Rösch\\n";
  s += "Tutorial (dxcas) with B. Ycart\\n";
  s += "Debian package: Carlos Enrique Carleos Artime\\n";
  s += "Mac OS X port thanks to Jean-Yves Avenard and IREM Grenoble\\n";
  s += "Tablor by Guillaume Connan, Pgiac by Jean-Michel Sarlat\\n";
  s += "FreeBSD port, sage interface and agreg tests by Frederic Han\\n";
  s += "Windows port suggestions and tests by Mike Ady\\n";
  s += "Thanks to the geogebra team, especially Zoltán Kovács, Michael Borcherds, Markus Hohenwater, Zbyněk Konečný\\n";
  s += "Xcas early testers: Christiane Serret (lycée de Crest),\\nMichèle Gandit (lycée international de Grenoble)\\nStephane Lejoly, Jean-Joel Bataille, Jean-Eric Visca, Thierry Xuereb\\nPaul Magnien, Denis Le Fur, Phil Pham\\nSébastien Celles, Gérard Vinel, Robert Rolland, Robert Sétif\\nJuan Antonio Martinez Rojas, Nicolas Rosillo (Spain)\\n";
  s += "Francois Maltey (Mupacs)\\nFrederic Faure, Emilien Kia, Andreas Thillosen (giac)\\n";
  s += "Francois Boisson (grace a lui Xcas est utilisable a l'agregation de maths)\\n";
  s += "Luc Briel, Georges Dubouloz, Emmanuel Gaunard, Laurent Hofer, Yvan Duron, Martin Deraux (bugs, suggestions)...\\n";
  s += "Uses GMP, (c) T. Granlund & al.\\n";
\#ifdef HAVE_LIBMPFR
  s += "Longfloat support by MPFR, Guillaume Hanrot, Vincent Lefèvre, Patrick Pélissier, Philippe Théveny and Paul Zimmermann \\n";
\#endif //
\#ifdef HAVE_LIBMPFI
  s += "Arithmetic interval support by MPFI, Fabrice Rouillier, Nathalie Revol, Sylvain Chevillard, Hong Diep Nguyen, Christoph Lauter and Philippe Théveny \\n";
\#endif //
\#ifdef HAVE_LIBECM
  s += "Elliptic Curve Method support by ECM, Paul Zimmermann, Cyril Bouvier, David Cleaver, Pierrick Gaudry, Brian Gladman, Jim Fougeron, Laurent Fousse, Alexander Kruppa, Francois Morain, Dave Newman, Jason S. Papadopoulos\\n";
\#endif //
\#ifdef HAVE_LIBCOCOA
  s += "Alternative Groebner Basis code by CoCoA, J. Abbott & al. \\n";
\#endif
  s += "Interface using FLTK (c) Bill Spitzak et al\\n";
  s += "FLVW code (c)Larry Charlton and others\\n";
  s += "OpenGL / Mesa (c) 1999-2005  Brian Paul\\n";
\#ifdef HAVE_LIBPARI
  s += "Contains PARI code (c) Henri Cohen & al.\\n";
\#endif //
\#ifdef HAVE_LIBLAPACK
  s += "Contains LAPACK code (c) see http://www.netlib.org/lapack/\\n";
  s += "Might also contain ATLAS code (c) see http://math-atlas.sourceforge.net/\\n";
\#endif 
\#ifdef HAVE_LIBGSL
  s += "Contains GSL code (c) Mark Galassi, James Theiler & al\\n";
\#endif //
\#ifdef HAVE_LIBNTL
  s += "Contains NTL code (c) Victor Shoup\\n";
\#endif //
\#ifdef HAVE_LIBGLPK
  s += "Contains GLPK code (c) Andrew Makhorin\\n";
\#endif //
  s += "Postscript output 2-d inspired by eukleides (c) Christian Obrecht\\n";
  s += "3-d exports from gl2ps, (c) 1999-2006 Christophe Geuzaine\\n";
  s += "Implicitplot3d code derived from Paul Bourke and Cory Gene Bloyd\\n";
  s += "TinyMT code from Mutsuo Saito and Makoto Matsumoto\\n";
  Xcas_parse_error_output->value(s.c_str());
  Fl::focus(Xcas_parse_error_output);} {}
} 

Function {rpn_button(xcas::No_Focus_Button * wid,int i)} {return_type void
} {
  code {unsigned si=rpn_menu_page*6+i;
  giac::gen e;
  if (!(xcas::Xcas_input_focus)) return;
  const giac::context * contextptr = xcas::get_context(xcas::Xcas_input_focus);
  if (rpn_menu.size()>si){
    e=rpn_menu[si];
    if ( (e.type==giac::_VECT) && (e._VECTptr->size()==2))
      e= e._VECTptr->back();
  }
  else 
    return;
  if (e.type==giac::_VECT){
    giac::vecteur tmp(1,giac::string2gen('"'+std::string("BACK")+'"'));
    if ((rpn_menu.back().type==giac::_VECT) && (rpn_menu.back()._VECTptr->front().type==giac::_STRNG) && (*rpn_menu.back()._VECTptr->front()._STRNGptr==std::string("BACK")) )
      rpn_menu.pop_back();
    tmp.push_back(rpn_menu);
    rpn_menu=*e._VECTptr;
    rpn_menu.push_back(tmp);
    show_rpn_menu(0);
    return;
  }
  try {
    e=giac::gen(e.print(),contextptr);
  }
  catch (std::runtime_error & err) 
  { }
  xcas::Equation * eqwptr=dynamic_cast<xcas::Equation *> (xcas::Xcas_input_focus);
  xcas::History_Pack * hp=get_history_pack(eqwptr);
  const giac::context * cptr=hp?hp->contextptr:0;
  if (eqwptr && e.is_symb_of_sommet(giac::at_program) ){
     make_thread(giac::symbolic(giac::at_of,makevecteur(e,eqwptr->get_selection())),eval_level(cptr),xcas::Equation_eval_callback,eqwptr,cptr);
     return;
  }
  if (e.type==giac::_FUNC){
    xcas::help_output(e._FUNCptr->ptr()->s,giac::language(contextptr));
    if (eqwptr){
      eqwptr->parse_desactivate();
      if (eqwptr->output_equation){
        eqwptr->eval_function(e);
      }
      else 
        eqwptr->replace_selection(giac::symbolic(*e._FUNCptr,eqwptr->get_selection()));
      return;
    }
    if (e.subtype)
      xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,e._FUNCptr->ptr()->s,false);
    else
      xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,(e._FUNCptr->ptr()->s+std::string(" ")).c_str(),false);
    return;
  } // end e.type==FUNC
  std::string s=e.print();
  if (!s.empty())
    xcas::in_Xcas_input_char(xcas::Xcas_input_focus,s.c_str(),s[0]);} {}
} 

Function {show_rpn_menu(unsigned i)} {return_type void
} {
  code {rpn_menu_page=i;
  unsigned j=i*6;
  fl_font(Xcas_F1_Key->labelfont(),Xcas_F1_Key->labelsize());
  for (int k=0;k<6;k++){
    std::string s;
    rpn_menu_is_directory[k]=false;
    if (rpn_menu.size()>j+k){
      giac::gen e=rpn_menu[j+k];
      if ( (e.type==giac::_VECT) && (e._VECTptr->size()==2)){
        e=e._VECTptr->front();
        rpn_menu_is_directory[k]=true;
        s=e.print();
        if (s[0]=='"')
          s=s.substr(1,s.size()-2);
      }
      else {
        if (e.type==giac::_FUNC)
          s=e._FUNCptr->ptr()->s;
        else
          s=e.print();
        if (e.type==giac::_VECT)
          rpn_menu_is_directory[k]=true;
      }
    }
    else
      s="";
    while(fl_width(s.c_str())>Xcas_F1_Key->w())
      s=s.substr(0,s.size()-1);
    rpn_menu_string[k]=s;
  }
  Xcas_F1_Key->label(rpn_menu_string[0].c_str());
  Xcas_F1_Key->labelcolor(rpn_menu_is_directory[0]);    
  Xcas_F2_Key->label(rpn_menu_string[1].c_str());
  Xcas_F2_Key->labelcolor(rpn_menu_is_directory[1]);    
  Xcas_F3_Key->label(rpn_menu_string[2].c_str());
  Xcas_F3_Key->labelcolor(rpn_menu_is_directory[2]);    
  Xcas_F4_Key->label(rpn_menu_string[3].c_str());
  Xcas_F4_Key->labelcolor(rpn_menu_is_directory[3]);    
  Xcas_F5_Key->label(rpn_menu_string[4].c_str());
  Xcas_F5_Key->labelcolor(rpn_menu_is_directory[4]);    
  Xcas_F6_Key->label(rpn_menu_string[5].c_str());
  Xcas_F6_Key->labelcolor(rpn_menu_is_directory[5]);    
  Xcas_F1_Key->color(xcas::Xcas_background_color);    
  Xcas_F2_Key->color(xcas::Xcas_background_color);    
  Xcas_F3_Key->color(xcas::Xcas_background_color);    
  Xcas_F4_Key->color(xcas::Xcas_background_color);    
  Xcas_F5_Key->color(xcas::Xcas_background_color);    
  Xcas_F6_Key->color(xcas::Xcas_background_color);    
  Xcas_VAR_Key->color(xcas::Xcas_background_color);   
  Xcas_Home_button->color(xcas::Xcas_background_color);    
  Xcas_CST_Key->color(xcas::Xcas_background_color);    
  Xcas_PREV_Key->color(xcas::Xcas_background_color);    
  Xcas_NXT_Key->color(xcas::Xcas_background_color);    
  Xcas_Bandeau_Keys->redraw();} {}
} 

Function {Xcas_resize_mainwindow()} {return_type void
} {
  code {int h=Xcas_Main_Window_->h();
    int w_=Xcas_Main_Window_->w(),i=Xcas_Main_Window_->labelsize(),y=i+4;
    int dy=0;
    int bs=Xcas_Messages->visible()?4*y:0;
    int bottom=bs;
    int kh=4*(i+5); // keyboard size
    int bh=(i+5); // bandeau size
    if (Xcas_Keyboard_Group->visible()) dy += kh ;
    if (Xcas_Bandeau_Keys->visible()) dy += bh;
    Xcas_main_menu->resize(0,0,w_,y);
    Xcas_Main_Tab->resize(0,y,w_,h-y-bottom-dy);
    Xcas_Main_Tab->redraw();
    Xcas_Keyboard_Group->resize(0,h-bottom-dy,w_,kh);
    Xcas_Keyboard_Group->redraw();
    Xcas_Bandeau_Keys->resize(0,h-bottom-bh,w_,bh);
    Xcas_Bandeau_Keys->redraw();
    Xcas_Messages->resize(0,h-bottom,w_,bs);
    Xcas_Messages->redraw();
    Xcas_Main_Window_->init_sizes();} {}
} 

Function {Xcas_change_labelsize(int i)} {return_type void
} {
  code {xcas::change_group_fontsize(Xcas_Main_Window_,i);
    Xcas_resize_mainwindow();
    if (xcas::Xcas_Debug_Window){ 
      xcas::Xcas_Debug_Window->labelfont(Xcas_Main_Window_->labelfont());
      xcas::change_group_fontsize(xcas::Xcas_Debug_Window,i);
    }
    if (xcas::Xcas_DispG_Window){
       xcas::Xcas_DispG_Window->labelfont(Xcas_Main_Window_->labelfont());
       xcas::change_group_fontsize(xcas::Xcas_DispG_Window,i);
    }
    if (Xcas_Script_Window){
       Xcas_Script_Window->labelfont(Xcas_Main_Window_->labelfont());
       xcas::change_group_fontsize(Xcas_Script_Window,i);
    }
    Fl_Menu_Bar * menu = dynamic_cast<Fl_Menu_Bar *>(Xcas_Main_Window_->child(0));
    if (menu) 
      menu->labelfont(Xcas_Main_Window_->labelfont());
    xcas::change_group_fontsize(menu,i);
//Xcas_History_font_output->value(giac::print_INT_(i).c_str());} {}
} 

Function {Xcas_widget_size(const giac::gen & g,const giac::context * cptr)} {return_type {giac::gen}
} {
  code {int f=14,ff=0;
    int x=Xcas_Main_Window_->x(),y=Xcas_Main_Window_->y(),w=Xcas_Main_Window_->w(),h=Xcas_Main_Window_->h();
    const giac::context * contextptr=Xcas_get_context();
    if (g.type==giac::_VECT){
      giac::vecteur & v=*g._VECTptr;
      int s=v.size();
      if (s && v[0].type==giac::_INT_)
	f=v[0].val;
      if (s && v[0].type==giac::_DOUBLE_)
	f=int(v[0]._DOUBLE_val);
      if (s && v[0].type==giac::_VECT){
        giac::vecteur & w = *v[0]._VECTptr;
        int ws=w.size();
        if (ws && w[0].type==giac::_INT_)
	 ff=w[0].val;
        if (ws && w[0].type==giac::_DOUBLE_)
	 ff=int(w[0]._DOUBLE_val);
        if (ws>1 && w[1].type==giac::_INT_)
	 f=w[1].val;
        if (ws>1 && w[1].type==giac::_DOUBLE_)
	 f=int(w[1]._DOUBLE_val);
        if (ws>2 && w[2].type==giac::_INT_){
         xcas::Flv_Table_Gen::def_rows=giac::absint(w[2].val);
         Xcas_default_rows->value(giac::absint(w[2].val));
        }
        if (ws>3 && w[3].type==giac::_INT_){
         xcas::Flv_Table_Gen::def_cols=giac::absint(w[3].val);
         Xcas_default_cols->value(giac::absint(w[3].val));
        }
      }
      if (s>1 && v[1].type==giac::_INT_)
	x=v[1].val;
      if (s>1 && v[1].type==giac::_DOUBLE_)
	x=int(v[1]._DOUBLE_val);
      if (s>2 && v[2].type==giac::_INT_)
	y=v[2].val;
      if (s>2 && v[2].type==giac::_DOUBLE_)
	y=int(v[2]._DOUBLE_val);
      if (s>3 && v[3].type==giac::_INT_)
	w=v[3].val;
      if (s>3 && v[3].type==giac::_DOUBLE_)
	w=int(v[3]._DOUBLE_val);
      if (s>4 && v[4].type==giac::_INT_)
	h=v[4].val;
      if (s>4 && v[4].type==giac::_DOUBLE_)
	h=int(v[4]._DOUBLE_val);
      if (s>5 && v[5].type==giac::_INT_) { 
        int i=v[5].val;
        if (i%2) Xcas_Keyboard_Group->show(); else Xcas_Keyboard_Group->hide(); 
        if (i/2) Xcas_Bandeau_Keys->show(); else Xcas_Bandeau_Keys->hide(); 
      }
      if (s>6 && v[6].type==giac::_INT_){ // Arg 6 was used for number of windows, now for auto-help
        Xcas_automatic_help_browser->value(v[6].val % 2);
        Xcas_automatic_completion_browser->value( (v[6].val/2) %2);
        xcas::do_helpon=Xcas_automatic_completion_browser->value();
        Xcas_tooltip_disabled->value( (v[6].val/4) %2);
	Xcas_disable_try_parse_test_i->value(v[6].val/8);
        Fl_Tooltip::enable(!Xcas_tooltip_disabled->value());
        giac::try_parse_i(0)=giac::try_parse_i(xcas::get_context(xcas::Xcas_input_focus))=!Xcas_disable_try_parse_test_i->value();
      }
      if (s>7 && v[7].type==giac::_INT_){ // Arg 7 was used for showing bandeau
        if (v[7].val) Xcas_Messages->show(); else Xcas_Messages->hide();
      }
      if (s>8 && v[8].type==giac::_VECT){ // colors (was pretty print in old xcas)
        giac::vecteur w=*giac::evalf_double(v[8],1,contextptr)._VECTptr;
        int ws=w.size();
        if (ws>=10){
          xcas::Xcas_input_color=Fl_Color(int(w[0]._DOUBLE_val));
          xcas::Xcas_input_background_color=Fl_Color(int(w[1]._DOUBLE_val));
	  xcas::Xcas_comment_color=Fl_Color(int(w[2]._DOUBLE_val));
	  xcas::Xcas_comment_background_color=Fl_Color(int(w[3]._DOUBLE_val));
	  xcas::Xcas_log_color=Fl_Color(int(w[4]._DOUBLE_val));
	  xcas::Xcas_log_background_color=Fl_Color(int(w[5]._DOUBLE_val));
	  xcas::Xcas_equation_color=Fl_Color(int(w[6]._DOUBLE_val));
	  xcas::Xcas_equation_background_color=Fl_Color(int(w[7]._DOUBLE_val));
	  xcas::Xcas_editor_color=Fl_Color(int(w[8]._DOUBLE_val));
	  xcas::Xcas_editor_background_color=Fl_Color(int(w[9]._DOUBLE_val));
        }
        if (ws>=11)
	  xcas::Xcas_background_color=Fl_Color(int(w[10]._DOUBLE_val));
        xcas::set_colors(Xcas_Main_Window_);
      }
      xcas::use_external_browser=false;
      unsetenv("BROWSER");
      if (s>9 && v[9].type==giac::_STRNG){
	std::string browser=*v[9]._STRNGptr;
	if (browser.size()!=0 && browser!="builtin"){
\#ifdef WIN32 // FIXME, check_file_path under windows
           setenv("BROWSER",browser.c_str(),1);
           xcas::use_external_browser=true;
\#else
          if (!giac::check_file_path(browser))
            fl_alert("%s",("Error, browser "+browser+" not found").c_str());
          else {
           setenv("BROWSER",browser.c_str(),1);
           xcas::use_external_browser=true;
          }
\#endif
        }
      }
      if (s>10 ){ // User level
	if (v[10].type==giac::_INT_)
          xcas_user_level=v[10].val;
	if (v[10].type==giac::_DOUBLE_)
          xcas_user_level=int(v[10]._DOUBLE_val); 
        std::string ss;
        switch(xcas_user_level){
          case 0: ss=gettext("CAS"); break;
          case 1: ss=gettext("Program CAS"); break;
          case 2: ss=gettext("Spreadsheet"); break;
          case 3: ss=gettext("Geometry"); break;
          case 8: ss=gettext("Turtle"); break;
        }
        Xcas_level_output->value(gettext(ss.c_str()));
      }
      if (s>11){ 
        if (v[11].type==giac::_INT_)
          giac::step_infolevel(v[11].val,contextptr);
        if (v[11].type==giac::_DOUBLE_)
          giac::step_infolevel(v[12]._DOUBLE_val,contextptr);
        if (giac::step_infolevel(contextptr) && xcas::Xcas_DispG_Window) xcas::Xcas_DispG_Window->show();
      }     
      if (s>12 && v[12].type==giac::_STRNG){
	std::string browser=*v[12]._STRNGptr;
	if (browser.size()!=0)
	  setenv("GIAC_PREVIEW",browser.c_str(),1);
      }
      if (s>13 && v[13].type==giac::_STRNG){
	std::string browser=*v[13]._STRNGptr;
	if (browser.size()!=0)
	  setenv("http_proxy",browser.c_str(),1);
      }
    }
    else {
      if (g.type!=giac::_INT_)
	return giac::zero;
      f=g.val;
    }
    f=f>0?f:-f;
    f=f>8?f:8;
    f=f>40?40:f;
    if (ff>=xcas::fonts_available)
      ff=0;
    Xcas_Main_Window_->labelfont(ff);
    Xcas_change_labelsize(f);
    Xcas_Main_Window_->resize(x,y,w,h);
    Xcas_resize_mainwindow(); 	
    return giac::plus_one;} {}
} 

Function {make_history()} {open
} {
  code {Fl_Group * s = Xcas_Main_Tab;
        Fl_Group::current(0);
s->handle(FL_FOCUS);
xcas::History_Fold * w = new xcas::History_Fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,1);
w->end();
w->pack->contextptr = giac::clone_context(giac::context0);
w->handle(FL_FOCUS);
w->pack->handle(FL_FOCUS);
w->labelsize(s->labelsize());
w->pack->eval=xcas::Xcas_eval;
w->pack->_insert=xcas::Xcas_pack_insert;
w->pack->_select=xcas::Xcas_pack_select;  
Fl_Group::current(0);
if (xcas_user_level==8){
  Fl_Widget * e=new_program(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->h()/3,w->pack);
  e->labelsize(w->labelsize());
  w->pack->add_entry(-1,e);
  Fl_Widget * l=new_logo(hist_max(w->pack->w()-w->pack->_printlevel_w,1),(w->h())/2,w->pack);
  l->labelsize(w->labelsize());
  w->pack->add_entry(0,l);
}
if (xcas_user_level==3){
  Fl_Widget * e=new_figure(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()-2*w->labelsize(),w->pack,false);
  e->labelsize(w->labelsize());
  w->pack->add_entry(-1,e);
  w->add_entry(-1);
}
if (xcas_user_level==2){
  Fl_Widget * e=new_tableur(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()-2*w->labelsize(),w->pack);
  e->labelsize(w->labelsize());
  w->pack->add_entry(-1,e);
  w->add_entry(-1);
}
if (xcas_user_level==1){
  Fl_Widget * e=new_program(hist_max(w->pack->w()-w->pack->_printlevel_w,1),w->pack->h()/2,w->pack);
  e->labelsize(w->labelsize());
  w->pack->add_entry(-1,e);
  w->add_entry(-1);
}
if (!w->pack->children()) 
  w->add_entry(-1);
w->pack->clear_modified();
std::cerr << Xcas_Main_Window_->labelfont() << std::endl;
w->labelfont(Xcas_Main_Window_->labelfont());
w->pack->labelfont(Xcas_Main_Window_->labelfont());
xcas::change_group_fontsize(w,Xcas_Main_Window_->labelsize());
Xcas_Main_Tab->add(w);
Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
Xcas_resize_mainwindow();
Xcas_Main_Tab->redraw();} {}
} 

Function {load_history(int mws)} {open
} {
  code {Fl_Group * s = Xcas_Main_Tab;
Fl_Group::current(0);
xcas::History_Fold * w = new xcas::History_Fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,1);
w->end();
w->pack->contextptr = giac::clone_context(giac::context0);
w->pack->labelsize(Xcas_Main_Window_->labelsize());
w->pack->eval=xcas::Xcas_eval;
w->pack->_insert=xcas::Xcas_pack_insert;
w->pack->_select=xcas::Xcas_pack_select;  
if (!w->pack->insert_before(-1,true,mws)){
  delete w;
  return;
}
w->pack->clear_modified();
w->pack->focus(0,true);
std::cerr << Xcas_Main_Window_->labelfont() << std::endl;
w->labelfont(Xcas_Main_Window_->labelfont());
w->pack->labelfont(Xcas_Main_Window_->labelfont());
xcas::add_recent_filename(*w->pack->url,true);
xcas::change_group_fontsize(w,w->pack->labelsize());
Xcas_Main_Tab->add(w);
Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
Xcas_resize_mainwindow();
Xcas_Main_Tab->redraw();} {}
} 

Function {load_filename(const char * filename,bool modified)} {open
} {
  code {Fl_Group * s = Xcas_Main_Tab;
        xcas::History_Fold * w=xcas::load_history_fold(s->x()+2,s->y()+s->labelsize()+4,s->w()-4,s->h()-s->labelsize()-6,s->labelsize(),filename,modified);
        // w->pack->focus(0,true);
        Xcas_Main_Tab->add(w); 
        Xcas_Main_Tab->value(Xcas_Main_Tab->child(Xcas_Main_Tab->children()-1));
        Xcas_resize_mainwindow();
        s->redraw();} {}
} 

Function {cb_Insert_Example(Fl_Widget * w , void*)} {} {
  code {static std::string menu_buffer;
    if (xcas::fl_handle_lock)
      return ;
    const giac::context * contextptr=Xcas_get_context();
    Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(w);
    if (!m)
      return ;
    menu_buffer = (giac::giac_aide_dir()+"examples/");
    int pos=m->value();
    const Fl_Menu_Item * m0 = m->menu();
    const Fl_Menu_Item * mi = m->menu();
    std::string tmp="Exemples/";
    for (int i=0;;i++){
      const Fl_Menu_Item * m1=mi;
      for (;;){
        mi=m1;
        m1=m1->next();
        if (m1-m0>pos)
          break;
      }
      if (mi-m0>=pos)
        break;
      if (i>1){
        tmp += mi->text ;
        tmp += '/';
      }
      ++mi;
    }
    menu_buffer += tmp;
    tmp="";
    std::string last=m->text();
    std::vector<std::string> vfile;
    unsigned ls=last.size(),is=0;
    for (;is<ls;++is){
      if (last[is]==','){
        vfile.push_back(tmp);
        tmp="";
      }
      else tmp+=last[is];
    }
    vfile.push_back(tmp);
    int i=1;
    std::string filename=vfile.front();
\#ifdef __APPLE__
    std::string thepath="/tmp/";
\#else
    std::string thepath="";
\#endif
    if (giac::is_file_available((thepath+filename).c_str())){
      i=fl_ask("%s",("File "+std::string(m->text())+" exists. Overwrite?").c_str());
    }
    if (i){
      ls=vfile.size();
      for (is=0;is<ls;++is){
        std::ifstream in((menu_buffer+vfile[is]).c_str());
        std::ofstream out((thepath+vfile[is]).c_str());
        i=xcas::stream_copy(in,out);
        in.close();
        out.close();
      }
    }
    load_filename((thepath+filename).c_str(),false);} {}
} 

Function {cb_Insert_ItemName(Fl_Widget * w , void*)} {} {
  code {static std::string menu_buffer;
    if (xcas::fl_handle_lock)
      return ;
    Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(w);
    if (!m)
      return ;
    menu_buffer = m->text();
    int pos=menu_buffer.find(':');
    if (pos>0 && pos<menu_buffer.size()) menu_buffer=menu_buffer.substr(0,pos);
    Fl_Widget * f = xcas::Xcas_input_focus;
    if (!f) return;
    const giac::context * contextptr = xcas::get_context(f);
    giac::gen tmp(menu_buffer,contextptr);
    if (Xcas_automatic_help_browser->value())
      xcas::browser_help(tmp,giac::language(contextptr));
    else
      xcas::help_output(menu_buffer,giac::language(contextptr));
    if (tmp.type==giac::_FUNC){
      if (xcas::Equation * eqwptr = dynamic_cast<xcas::Equation *>(f)){
	eqwptr->parse_desactivate();
	if (eqwptr->output_equation)
	  eqwptr->eval_function(tmp);
	else 
	  eqwptr->replace_selection(giac::symbolic(*tmp._FUNCptr,eqwptr->get_selection()));
	return;
      }
      if (!Xcas_automatic_completion_browser->value())
        menu_buffer += '(';
    }
    static std::string ans;
    ans=menu_buffer;
    int remove;
    Fl_Widget * wid=f->window();
    if (!wid) wid=f;
    pos=menu_buffer.find('('); // detect a composite unit
    if (menu_buffer.size()>1 && menu_buffer!="%0" && !(pos>0 && pos<menu_buffer.size()) && Xcas_automatic_completion_browser->value()){
      if (!xcas::handle_tab(menu_buffer,(*giac::vector_completions_ptr()),2*wid->w()/3,2*wid->h()/3,remove,ans))
       return;
    }
    Fl::focus(f);
      if (xcas::Xcas_Text_Editor * in =dynamic_cast<xcas::Xcas_Text_Editor *>(f)){
	    in->buffer()->insert(in->insert_position(),ans.c_str());
	    in->insert_position(in->insert_position()+ans.size());
	  return;
	}
    if (Fl_Input * in = dynamic_cast<Fl_Input *>(f))
      in->insert(ans.c_str());
    else {
     Fl::e_text = (char * ) ans.c_str();
     Fl::e_length = ans.size();
     // Fl::e_keysym = '\\n';
     xcas::fl_handle(f);
    }} {}
} 

Function {cb_Assistant_ItemName(Fl_Widget * wid , void* ptr)} {} {
  code {static std::string menu_buffer;
    if (xcas::fl_handle_lock)
      return ;
    Fl_Menu_ * m =dynamic_cast<Fl_Menu_ *>(wid);
    if (!m)
      return ;
    menu_buffer = m->text();
    int pos=menu_buffer.find(':');
    if (pos>0 && pos<menu_buffer.size()) menu_buffer=menu_buffer.substr(0,pos);
    static std::string ans;
    ans = menu_buffer;
    int remove,ii;
    Fl_Widget * w=xcas::Xcas_input_focus;
    const giac::context * contextptr = xcas::get_context(w);
    xcas::help_output(menu_buffer,giac::language(contextptr));
    Fl_Window * wd=wid->window();
    if (!Xcas_automatic_completion_browser->value())
      ii=1;
    else
      ii=xcas::handle_tab(menu_buffer,(*giac::vector_completions_ptr()),wd->w()/3,wd->h()/3,remove,ans);
    Fl::focus(w);
    if (ii){ 
      if (ii==1)
	ans = ans +"()";
      if (xcas::Xcas_Text_Editor * in =dynamic_cast<xcas::Xcas_Text_Editor *>(w)){
	  if (ii>=1){
	    in->buffer()->insert(in->insert_position(),ans.c_str());
	    in->insert_position(in->insert_position()+ans.size()-1);
	  }
	  return;
	}
      Fl::e_text = (char * ) ans.c_str();
      Fl::e_length = ans.size();
      if (w){
	xcas::fl_handle(w);
	if (Fl_Input * in =dynamic_cast<Fl_Input *>(w)){
	  if (ii==1) in->position(in->position()-1);
	}
      }
    }
    else { if (w) w->redraw(); }} {}
} 

Function {load_autorecover_data()} {open
} {
  code {\#ifdef WIN32
    std::string configname=giac::xcasroot()+giac::xcasrc();
\#else
    std::string configname=giac::home_directory()+giac::xcasrc();
\#endif //
   if (!giac::is_file_available(configname.c_str())){
    Xcas_widget_size(giac::makevecteur(14,40,90,900,550,0,0,1),0);
    FILE * f =fopen(configname.c_str(),"w");
    if (f){
      fclose(f);
     // Xcas_Main_Window_->hide();
\#if 0
     int n=fl_choice(gettext("Choose syntax compatibility"),gettext("Python"),gettext("Xcas"),gettext("Other")),mm=-1; // n==2 other
    if (n<2) n=1-n;
\#else
     int n=fl_choice(gettext("Choose syntax compatibility"),gettext("Xcas"),gettext("Python"),gettext("Other")),mm=-1; // n==2 other
\#endif
     if (n==2){
        mm=fl_choice(gettext("Choose start mode"),gettext("Turtle"),gettext("Spreadsheet"),gettext("Geometry"));
        if (mm==0) mm=7;
     }
\#ifdef IPAQ // default with bandeau
     std::string configs="widget_size(12,1,1,300,240,1,2,1,";
\#else // ifndef IPAQ, 
     std::string configs="widget_size(14,40,90,900,550,"+giac::print_INT_(n!=0)+",2,0,";
\#endif // IPAQ
     configs += '7';
     configs += ','; 
     configs += '"'; 
// \#ifndef WIN32
     configs += Xcas_browser_name();
// \#endif
     configs += '"' ; 
     configs += ','; // end BROWSER
     configs+=giac::print_INT_(mm+1);
     configs += ",0";
     configs +=");xcas_mode(";
     if (n==1)
      configs+="256"; 
     else
      configs+='0';
     configs += ");xyztrange(-10.0,10.0,-10.0,10.0,-10.0,10.0,-10.0,10.0,-10.0,10.0,-1.4,1.1,1,0.0,1.0);";
     std::ofstream configfile(configname.c_str());
     configfile << configs << std::endl;
     configfile.close();
     // fl_alert("%s",("Configuration written to "+configname + "\\nUse the Cfg menu to modify.\\nLaunching tutorial.").c_str());
     n=fl_ask("%s",gettext("Launch tutorial in browser?"));
     if (n==1){
       if (giac::language(giac::context0)==1)
         giac::system_browser_command(doc_prefix+"tutoriel/index.html");
       else
         giac::system_browser_command(doc_prefix+"casinter/index.html");
     }
     giac::protected_read_config(giac::context0); // read xcas.rc
     xcas::History_cb_Kill(Xcas_current_session(),0);
     make_history();
    } // if (f) ...
   }
    std::vector<xcas::time_string> v;
    char buf[1024];
    bool autoload=true;
    if (xcas::autosave_folder.empty())
      autoload=getcwd(buf,1023);
    else
      strcpy(buf,xcas::autosave_folder.c_str());
    if ( autoload && has_autorecover_data(buf,v)){
      // Ask user: ignore or run file
      int i=fl_ask("%s",gettext("Auto-recovery files found. Load ?"),gettext("Yes"),gettext("No"));
      if (i!=1)
	return;
      xcas::geo_run=xcas::sheet_run=false;
      // Remove empty new session
      if (Xcas_Main_Tab->children()){
        xcas::History_Fold * hf = dynamic_cast<xcas::History_Fold *>(Xcas_Main_Tab->child(0));
        if (hf && hf->pack && hf->pack->children() < 2 ) { hf->pack->close(""); Xcas_Main_Tab->remove(hf);}
      }
      std::sort(v.begin(),v.end());
      int vs=v.size();
      for (int i=0;i<vs;++i){
        load_filename(v[i].s.c_str(),true);
        unlink(v[i].s.c_str());
      }
      fl_message("%s",gettext("Autorecover files have been loaded. Geometry and spreadsheet were not reevaled"));
    }} {}
} 

Function {gnuplot_setview()} {return_type void
} {
  code {\#ifdef WITH_GNUPLOT
  bool clrplot=false;
  int out_handle;
  FILE * gnuplot_out_readstream,* stream = giac::open_gnuplot(clrplot,gnuplot_out_readstream,out_handle);
  fprintf(stream,"%s %f,%f,%f,%f\\n%s\\n","set view ",Xcas_Rot_x->value(),Xcas_Rot_z->value(),Xcas_X_scale->value(),Xcas_Z_scale->value(),"replot");
  fflush(stream);
  giac::gnuplot_wait(out_handle,gnuplot_out_readstream,2);  
\#endif //} {}
} 

Function {Xcas_browser_name()} {return_type {std::string}
} {
  code {\#ifdef __APPLE__ //
return "open";
\#endif // apple
if (getenv("BROWSER"))
  return getenv("BROWSER");
\#ifdef WIN32 //
  return "cygstart.exe";
\#endif // win32
std::string tmp;
tmp="/usr/bin/firefox";
if (giac::is_file_available(tmp.c_str()))
   return tmp;
tmp="/usr/bin/mozilla";
if (giac::is_file_available(tmp.c_str()))
   return tmp;
tmp="/usr/bin/dillo";
if (giac::is_file_available(tmp.c_str()))
   return tmp;
tmp="/usr/bin/chromium";
if (giac::is_file_available(tmp.c_str()))
   return tmp;
\#ifdef WIN32 //
  tmp="/cygdrive/c/Program Files/Mozilla Firefox/firefox.exe";
 // if (giac::is_file_available(tmp.c_str())) return "'"+tmp+"'";
  return "'/cygdrive/c/Program Files/Internet Explorer/IEXPLORE.EXE'";
\#endif // 
return "";} {}
} 

Function {Xcas_load_general_setup()} {return_type void
} {
  code {// xcas::file_save_context has been removed for xcas 1.1.3
int ste=giac::step_infolevel(Xcas_get_context());
Xcas_stepbystep->value(ste);
Xcas_html_browser->value(Xcas_browser_name().c_str());
static std::string proxy;
if (getenv("http_proxy")){
  proxy=getenv("http_proxy");
  Xcas_proxy->value(proxy.c_str());
}
xcas::change_group_fontsize(Xcas_General_Setup,Xcas_Main_Window_->labelsize());
Xcas_General_Setup->resize(20,20,3*Xcas_Main_Window_->w()/4,3*Xcas_Main_Window_->h()/4);
  Xcas_General_Setup->show();} {}
} 

Function {Xcas_update_mode()} {return_type void
} {
  code {Fl_Widget * wid = Xcas_current_session();
  xcas::History_Fold * hf=xcas::get_history_fold(wid);
  if (hf) hf->update_status();} {}
} 

Function {Xcas_save_config(const giac::context * contextptr)} {return_type void
} {
  code {\#ifdef WIN32 
// Save config in home_dir or if not available in $XCAS_ROOT or current dir
std::string s((giac::home_directory()));
if (s.size()<2 && getenv("XCAS_ROOT"))
  s=getenv("XCAS_ROOT")+std::string("/");
if (s.size()<2)
  s="";
std::cerr << "Saving preferences in file " << s+giac::xcasrc() << std::endl;
std::ofstream of((s+giac::xcasrc()).c_str());
\#else
std::ofstream of((giac::home_directory()+giac::xcasrc()).c_str());
\#endif //
   of << "widget_size([" << giac::print_INT_(Xcas_Main_Window_->labelfont()) << "," << giac::print_INT_(Xcas_Main_Window_->labelsize()) << "," << giac::print_INT_(xcas::Flv_Table_Gen::def_rows) << "," << giac::print_INT_(xcas::Flv_Table_Gen::def_cols) << "]," << Xcas_Main_Window_->x() << "," << Xcas_Main_Window_->y() << "," << Xcas_Main_Window_->w() << "," << Xcas_Main_Window_->h() << "," ;
   of << Xcas_Keyboard_Group->visible()+2*Xcas_Bandeau_Keys->visible() <<",";
   of << Xcas_automatic_help_browser->value()+2*Xcas_automatic_completion_browser->value()+4*Xcas_tooltip_disabled->value() + 8*Xcas_disable_try_parse_test_i->value();
   of << "," << Xcas_Messages->visible() ;
   of << ",[" ; 
   of << giac::print_INT_(xcas::Xcas_input_color) << "," << giac::print_INT_(xcas::Xcas_input_background_color) << "," << giac::print_INT_(xcas::Xcas_comment_color) << "," << giac::print_INT_(xcas::Xcas_comment_background_color) << "," << giac::print_INT_(xcas::Xcas_log_color) << "," << giac::print_INT_(xcas::Xcas_log_background_color) << "," << giac::print_INT_(xcas::Xcas_equation_color) << "," << giac::print_INT_(xcas::Xcas_equation_background_color) << "," << giac::print_INT_(xcas::Xcas_editor_color) << "," << giac::print_INT_(xcas::Xcas_editor_background_color) << "," << giac::print_INT_(xcas::Xcas_background_color) ;
   of << "]";
   if (getenv("BROWSER")&&xcas::use_external_browser)
     of << "," << '"' << getenv("BROWSER") << '"' ;
   else
     of << "," << '"' << "builtin" << '"' ;
   of << "," << xcas_user_level ;
   of << "," << int(Xcas_stepbystep->value()) ;
   if (getenv("GIAC_PREVIEW"))
     of << "," << '"' << getenv("GIAC_PREVIEW") << '"' ;
   else
     of << "," << '"' << '"' ;
   if (getenv("http_proxy"))
     of << "," << '"' << getenv("http_proxy") << '"' ;
   else
     of << "," << '"' << '"' ;
   of << ");" << std::endl;
   of << giac::cas_setup_string(contextptr) << ";" << std::endl;
   of << giac::geo_setup_string() << ";" << std::endl;
   of << "autosimplify(" << giac::unlocalize(giac::autosimplify(contextptr)) << ")";
   giac::vecteur vv(*giac::_lsmod(giac::zero,contextptr)._VECTptr);
   giac::const_iterateur it=vv.begin(),itend=vv.end();
   for (;it!=itend;++it)
     of << "insmod(" << it->print(contextptr) << ");" << std::endl;} {}
} 

Function {Xcas_run(int argc,char ** argv)} {open
} {
  Fl_Window Xcas_Main_Window_ {
    label {Xcas New Interface} open
    xywh {95 113 865 520} type Single resizable visible
  } {
    Fl_Menu_Bar Xcas_main_menu {open
      xywh {0 0 775 25}
    } {
      Submenu Xcas_file_menu {
        label File
        xywh {0 0 100 20}
      } {
        MenuItem Xcas_new_session {
          label {New session}
          callback {make_history();}
          xywh {0 0 100 20}
        }
        Submenu Xcas_open {
          label Open
          xywh {0 0 70 21}
        } {
          MenuItem Xcas_open_session {
            label File
            callback {load_history(0);}
            xywh {15 15 100 20} shortcut 0x8006f
          }
        }
        MenuItem Xcas_open_recovery {
          label {Open (recovery mode)}
          callback {xcas::recovery_mode=true; load_history(0); xcas::recovery_mode=false;}
          xywh {10 10 100 20}
        }
        Submenu Xcas_Import {
          label Import
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_open_maple {
            label {Maple worksheet}
            callback {load_history(1);}
            xywh {15 15 100 20}
          }
          MenuItem Xcas_open_ti89 {
            label {TI89 program}
            callback {load_history(3);}
            xywh {15 15 100 20}
          }
          MenuItem Xcas_open_v200 {
            label {V200 program}
            callback {load_history(7);}
            xywh {15 15 100 20}
          }
        }
        Submenu Xcas_Clone {
          label Clone
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_CloneOffline {
            label Offline
            callback {std::string html5=giac::browser_command("doc/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session())); std::cout << html5 << std::endl; system(html5.c_str());}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_CloneOnline {
            label Online
            callback {std::string html5="http://www-fourier.univ-grenoble-alpes.fr/~parisse/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session()); std::cout << html5 << std::endl; giac::system_browser_command(html5);}
            xywh {10 10 100 20}
          }
        }
        Submenu Xcas_Insert {
          label Insert
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_Insert_Session {
            label {Xcas session}
            callback {xcas::History_cb_Insert(Xcas_current_session(),0);}
            xywh {55 55 100 20}
          }
          MenuItem Xcas_Firefox_Insert_Session {
            label {Xcas Firefox link}
            callback {fl_alert("Click on a history level then paste (Ctrl-V)");}
            xywh {55 55 100 20}
          }
          MenuItem Xcas_Insert_Figure {
            label Figure
            callback {xcas::History_cb_Insert_Figure(Xcas_current_session(),0);}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_Insert_Tableur {
            label Spreadsheet
            callback {xcas::History_cb_Insert_Tableur(Xcas_current_session(),0);}
            xywh {75 75 100 20}
          }
          MenuItem Xcas_Insert_Program {
            label Program
            callback {xcas::History_cb_Insert_Program(Xcas_current_session(),0);}
            xywh {85 85 100 20}
          }
        }
        MenuItem Xcas_save_current_session {
          label Save
          callback {xcas::History_cb_Save(Xcas_current_session(),0);}
          xywh {20 20 100 20} shortcut 0x80073
        }
        MenuItem Xcas_save_current_session_as {
          label {Save as}
          callback {xcas::History_cb_Save_as(Xcas_current_session(),0);}
          xywh {20 20 100 20}
        }
        MenuItem Xcas_save_all_sessions {
          label {Save all}
          callback {Xcas_save_all(Xcas_Main_Tab);}
          xywh {10 10 100 20}
        }
        Submenu Xcas_Export {
          label {Export as}
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_Export_Khicas {
            label {KhiCas}
            callback {xcas::History_cb_Save_as_xcas_casio(Xcas_current_session(),0);}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_Export_Xcas {
            label {Xcas text}
            callback {xcas::History_cb_Save_as_xcas_text(Xcas_current_session(),0);}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_Export_XcasPy {
            label {Xcas-Python text}
            callback {xcas::History_cb_Save_as_xcaspy_text(Xcas_current_session(),0);}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_Export_Maple {
            label {Maple text}
            callback {xcas::History_cb_Save_as_maple_text(Xcas_current_session(),0);}
            xywh {75 75 100 20}
          }
          MenuItem Xcas_Export_Mupad {
            label {Mupad text}
            callback {xcas::History_cb_Save_as_mupad_text(Xcas_current_session(),0);}
            xywh {85 85 100 20}
          }
          MenuItem Xcas_Export_TI {
            label {TI text}
            callback {xcas::History_cb_Save_as_ti_text(Xcas_current_session(),0);}
            xywh {95 95 100 20}
          }
        }
        MenuItem Xcas_Close {
          label Kill
          callback {xcas::History_cb_Kill(Xcas_current_session(),0);}
          xywh {45 45 100 20}
        }
        Submenu Xcas_Print {
          label Print
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_Print_Preview {
            label Preview
            callback {xcas::History_cb_Preview(Xcas_current_session(),0);}
            xywh {95 95 100 20}
          }
          MenuItem Xcas_Print_Printer {
            label {To printer}
            callback {xcas::History_cb_Print(Xcas_current_session(),0);}
            xywh {105 105 100 20}
          }
          MenuItem Xcas_Print_Preview_Selected {
            label {Preview selected levels}
            callback {xcas::History_cb_Preview_selected(Xcas_current_session(),0);}
            xywh {115 115 100 20}
          }
        }
        Submenu Xcas_Print_Latex {
          label LaTeX
          xywh {15 15 100 20}
        } {
          MenuItem Xcas_LaTeX_Print_Preview {
            label {LaTeX preview}
            callback {xcas::History_cb_LaTeX_Preview(Xcas_current_session(),0);}
            xywh {110 110 100 20}
          }
          MenuItem Xcas_LaTeX_Print_Printer {
            label {LaTeX print}
            callback {xcas::History_cb_LaTeX_Print(Xcas_current_session(),0);}
            xywh {120 120 100 20}
          }
          MenuItem Xcas_LaTeX_Print_Selection {
            label {LaTeX print selection}
            callback {xcas::History_cb_LaTeX_Print_sel(Xcas_current_session(),0);}
            xywh {130 130 100 20}
          }
        }
        MenuItem Xcas_screen_capture {
          label {Screen capture}
          callback {xcas::widget_ps_print(Xcas_Main_Window_,"window",true,3,true,false,true);}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_do_nothing1 {
          label {--- }
          xywh {10 10 100 20}
        }
        MenuItem Xcas_create_links {
          label {Create links (Mac OS)}
          callback {\#ifdef __APPLE__
system("/usr/X11/bin/xterm -fn 10x20 -e sudo /Applications/usr/bin/makelinks");
\#endif}
          xywh {30 30 100 20}
        }
        MenuItem Xcas_quit_update {
          label {Quit and update Xcas}
          callback {Fl::remove_idle(xcas::Xcas_idle_function,0);
if (!Xcas_save_all(Xcas_Main_Tab)){
  Fl::add_idle(xcas::Xcas_idle_function,0);
  return;
}
Xcas_Main_Window_->hide(); 
// xcas::Xcas_Plot_Setup->hide();
// xcas::Xcas_Cas_Setup->hide(); 
Xcas_General_Setup->hide();
Xcas_Script_Window->hide(); 
if (xcas::Xcas_help_window) xcas::Xcas_help_window->hide();
Xcas_DispG_Window_->hide();
if (xcas::Xcas_Debug_Window) xcas::Xcas_Debug_Window->hide();
if (xcas::handle_tab_w)
  xcas::handle_tab_w->hide();
update_xcas=1;}
          xywh {20 20 100 20}
        }
        MenuItem Xcas_do_nothing2 {
          label {--- }
          xywh {10 10 100 20}
        }
        MenuItem Xcas_quit {
          label Quit
          callback {cb_Xcas_quit_update(0,0); 
update_xcas=0;}
          xywh {10 10 100 20} shortcut 0x40071
        }
      }
      Submenu Xcas_Edit {
        label Edit
        xywh {0 0 100 20}
      } {
        MenuItem Xcas_Execute_Worksheet {
          label {Execute worksheet}
          callback {xcas::History_cb_Run_Worksheet(Xcas_current_session(),0);}
          xywh {140 140 100 20} shortcut 0x4ffc6
        }
        MenuItem Xcas_Execute_Worksheet_Delay {
          label {Execute worksheet with pauses}
          callback {const char * ch=fl_input("Enter delay in seconds","1.5"); 
              if (ch){
                Fl_Widget * wid=Xcas_current_session();
                xcas::History_Pack * hp=dynamic_cast<xcas::History_Pack *>(wid);
                int i=std::floor(atof(ch)*1e6);
                if (hp && i>0 && i<120e6){ hp->next_delay=i;xcas::History_cb_Run_Worksheet(wid,0);}
             }}
          xywh {140 140 100 20}
        }
        MenuItem Xcas_Execute_Below {
          label {Execute below}
          callback {xcas::History_cb_Run_Below(Xcas_current_session(),0);}
          xywh {150 150 100 20}
        }
        MenuItem Xcas_Remove_Answers {
          label {Remove answers below}
          callback {xcas::cb_Rm_Answers(Xcas_current_session(),0);}
          xywh {160 160 100 20}
        }
        MenuItem Xcas_Undo {
          label Undo
          callback {if (xcas::get_history_pack(xcas::Xcas_input_focus)) xcas::History_cb_Undo(xcas::Xcas_input_focus,0); else xcas::History_cb_Undo(Xcas_current_session(),0);}
          xywh {230 230 100 20} shortcut 0x4007a
        }
        MenuItem Xcas_Redo {
          label Redo
          callback {if (xcas::get_history_pack(xcas::Xcas_input_focus)) xcas::History_cb_Redo(xcas::Xcas_input_focus,0); else xcas::History_cb_Redo(Xcas_current_session(),0);}
          xywh {240 240 100 20} shortcut 0x40079
        }
        MenuItem Xcas_Paste {
          label Paste
          callback {xcas::cb_Paste(Xcas_current_session(),0);}
          xywh {180 180 100 20}
        }
        MenuItem Xcas_Delete {
          label {Del selected levels}
          callback {xcas::cb_Delete(Xcas_current_session(),0);}
          xywh {190 190 100 20}
        }
        MenuItem Xcas_Tex_Selection {
          label {Selection -> LaTeX}
          callback {static std::string s; giac::gen g;
    const giac::context * contextptr=xcas::get_context(xcas::Xcas_input_focus);
  try {
   if (xcas::Xcas_Text_Editor * ptr=dynamic_cast<xcas::Xcas_Text_Editor *> (xcas::Xcas_input_focus)){
     int a,b;
     ptr->buffer()->selection_position(&a,&b);
    char * ch=ptr->buffer()->text_range(a,b);
    g=giac::gen(ch,contextptr);
    free(ch);
  }
   if (xcas::Equation * ptr=dynamic_cast<xcas::Equation *> (xcas::Xcas_input_focus))
    g=ptr->get_selection();
   if (xcas::Flv_Table_Gen * ptr=dynamic_cast<xcas::Flv_Table_Gen *> (xcas::Xcas_input_focus))
    g=extractmatricefromsheet(ptr->selected);
   if (Fl_Input_ * ptr=dynamic_cast<Fl_Input *>(xcas::Xcas_input_focus)){
    int i=ptr->position(),j=ptr->mark();
    if (i>j) std::swap<int>(i,j);
    s=ptr->value();
    s=s.substr(i,j-i);
    g=giac::gen(s,contextptr);
   }
   s=giac::gen2tex(g,contextptr);
  } 
  catch (std::runtime_error & e){
    s = e.what()+g.print();
  }
Xcas_parse_error_output->value(s.c_str());
int ss=s.size();
Fl::copy(s.c_str(),ss,0);
Fl::copy(s.c_str(),ss,1);}
          xywh {190 190 100 20} shortcut 0x40074
        }
        MenuItem Xcas_Add_Entry1 {
          label {New entry}
          callback {xcas::cb_New_Input(Xcas_current_session(),0);}
          xywh {60 60 100 20} shortcut 0x8006e
        }
        MenuItem Xcas_Add_Parameter {
          label {New parameter}
          callback {std::string tmp,name;
double tmin,tmax,tcur,tstep;
Fl_Widget * wid = xcas::Xcas_input_focus;
int pos;
xcas::History_Pack * hp=xcas::get_history_pack(wid,pos);
if (hp && xcas::figure_param_dialog(xcas::Xcas_input_focus,false,tmin,tmax,tcur,tstep,name,false,tmp)){
 if (hp){
   Fl_Widget * q=xcas::new_question_multiline_input(giac::giacmax(hp->w()-hp->_printlevel_w,1),hp->labelsize()+12);	
    hp->add_entry(pos,q);
    hp->set_value(pos,tmp,true);
 }
}}
          xywh {70 70 100 20} shortcut 0x40070
        }
        MenuItem Xcas_Insert_Newline {
          label {Insert newline}
          callback {xcas::History_cb_Newline(Xcas_current_session(),0);}
          xywh {170 170 100 20}
        }
        MenuItem Xcas_Merge {
          label {Merge selected levels}
          callback {xcas::History_cb_Merge(Xcas_current_session(),0);}
          xywh {210 210 100 20}
        }
        MenuItem Xcas_Add_HF {
          label {New group}
          callback {xcas::History_cb_New_HF(Xcas_current_session(),0);}
          xywh {130 130 100 20}
        }
        MenuItem Xcas_Fold {
          label {Group selected levels}
          callback {xcas::History_cb_Fold(Xcas_current_session(),0);}
          xywh {200 200 100 20}
        }
        MenuItem Xcas_Flatten {
          label {Degroup selected levels}
          callback {xcas::History_cb_Flatten(Xcas_current_session(),0);}
          xywh {220 220 100 20}
        }
      }
      Submenu Xcas_main_configuration {
        label Cfg
        xywh {0 0 100 20}
      } {
        MenuItem Xcas_cas_config_ {
          label {Cas configuration}
          callback {const giac::context * contextptr=Xcas_get_context();
xcas::Xcas_load_cas_setup(contextptr);}
          xywh {20 20 100 20}
        }
        MenuItem Xcas_graph_config_ {
          label {Graph configuration}
          callback {const giac::context * contextptr=Xcas_get_context();
xcas::Xcas_load_graph_setup(contextptr);}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_general_config_ {
          label {General configuration}
          callback {Xcas_load_general_setup();}
          xywh {20 20 100 20}
        }
        Submenu Xcas_config_program {
          label {Mode (syntax)}
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_Set_Xcas0 {
            label Xcas
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=0;
giac::python_compat(contextptr)=0;
xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_Set_Python0 {
            label {Python ^==**}
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=0;
giac::python_compat(contextptr)=1;
xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_Set_Python0xor {
            label {Python ^==xor}
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=0;
giac::python_compat(contextptr)=2;
xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_Set_Maple0 {
            label Maple
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=1;
xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_Set_Mupad0 {
            label Mupad
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=2;
xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_Set_TI0 {
            label {TI89/92}
            callback {const giac::context * contextptr=Xcas_get_context();
giac::xcas_mode(contextptr)=3;xcas_user_level=0;
Xcas_update_mode();}
            xywh {40 40 100 20}
          }
        }
        Submenu Xcas_show_something {
          label Show
          xywh {5 5 100 20}
        } {
          MenuItem Xcas_show_DispG {
            label DispG
            callback {Xcas_DispG_Window_->show(); 
Xcas_DispG_Cancel_->hide();}
            xywh {45 45 100 20} shortcut 0x80064
          }
          MenuItem Xcas_show_keyboard {
            label Keyboard
            callback {Xcas_Keyboard_Group->show(); Xcas_resize_mainwindow();}
            xywh {30 30 100 20}
          }
          MenuItem Xcas_show_bandeau {
            label Bandeau
            callback {Xcas_Bandeau_Keys->show(); Xcas_resize_mainwindow();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_show_msg {
            label Msg
            callback {Xcas_Messages->show(); Xcas_resize_mainwindow();}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_show_script_window {
            label {Show script window}
            callback {Xcas_Script_Window->show();}
            xywh {20 20 100 20} hide
          }
        }
        Submenu Xcas_Hide_Something {
          label Hide
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_hide_DispG {
            label DispG
            callback {Xcas_DispG_Window_->hide(); 
Xcas_DispG_Cancel_->hide();}
            xywh {55 55 100 20}
          }
          MenuItem Xcas_hide_keyboard {
            label Keyboard
            callback {Xcas_Keyboard_Group->hide(); Xcas_resize_mainwindow();}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_hide_bandeau {
            label Bandeau
            callback {Xcas_Bandeau_Keys->hide(); Xcas_resize_mainwindow();}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_hide_msg {
            label Msg
            callback {Xcas_Messages->hide(); Xcas_resize_mainwindow();}
            xywh {45 45 100 20}
          }
        }
        Submenu Xcas_index_language {
          label {Index language}
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_index_Francais {
            label Francais
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(1,giac::context0);
doc_prefix=giac::set_language(1,contextptr);
giac::language(1,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_index_English {
            label English
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(2,giac::context0);
doc_prefix=giac::set_language(2,contextptr);
giac::language(2,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_index_Espanol {
            label Espanol
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(3,giac::context0);
doc_prefix=giac::set_language(3,contextptr);
giac::language(3,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_index_Greek {
            label Greek
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(4,giac::context0);
doc_prefix=giac::set_language(4,contextptr);
giac::language(4,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_index_Chinese {
            label Chinese
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(4,giac::context0);
doc_prefix=giac::set_language(8,contextptr);
giac::language(8,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_index_German {
            label Deutsch
            callback {const giac::context * contextptr=Xcas_get_context();
// doc_prefix=giac::set_language(3,giac::context0);
doc_prefix=giac::set_language(9,contextptr);
giac::language(9,giac::context0);
giac::html_help_init("aide_cas",1);}
            xywh {0 0 100 20}
          }
        }
        Submenu Xcas_Colors {
          label Colors open
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_background_color_item {
            label {Default background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_background_color);
xcas::Xcas_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {10 10 100 20}
          }
          MenuItem Xcas_input_text_color {
            label {Input text}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_input_color);
xcas::Xcas_input_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_input_text_background_color {
            label {Input background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_input_background_color);
xcas::Xcas_input_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_comment_color_item {
            label {Comment text}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_comment_color);
xcas::Xcas_comment_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_comment_background_color_item {
            label {Comment background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_comment_background_color);
xcas::Xcas_comment_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_log_color_item {
            label {Log text}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_log_color);
xcas::Xcas_log_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_log_background_color_item {
            label {Log background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_log_background_color);
xcas::Xcas_log_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_equation_color_item {
            label {Equation text}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_equation_color);
xcas::Xcas_equation_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_equation_background_color_item {
            label {Equation background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_equation_background_color);
xcas::Xcas_equation_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20}
          }
          MenuItem Xcas_editor_color_item {
            label {Editor text}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_editor_color);
xcas::Xcas_editor_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20} hide
          }
          MenuItem Xcas_editor_background_color_item {
            label {Editor background}
            callback {Fl_Color c=fl_show_colormap(xcas::Xcas_editor_background_color);
xcas::Xcas_editor_background_color=c;
xcas::set_colors(Xcas_Main_Window_);}
            xywh {0 0 100 20} hide
          }
        }
        MenuItem Xcas_change_current_fontsize {
          label {Session font}
          callback {Fl_Widget * wid=Xcas_Main_Tab->value();
 if (wid){
  int taille=wid->labelsize();
  Fl_Font police=wid->labelfont();
  if (xcas::get_font(police,taille)){
   wid->labelfont(police);
   xcas::change_group_fontsize(wid,taille);
  }
  Xcas_Main_Window_->redraw();
 }}
          xywh {0 0 100 20}
        }
        MenuItem Xcas_change_fontsize {
          label {All fonts}
          callback {Fl_Widget * wid=Xcas_Main_Window_;
 if (wid){
  int taille=wid->labelsize();
  Fl_Font police=wid->labelfont();
  if (xcas::get_font(police,taille)){
   wid->labelfont(police);
   xcas::change_group_fontsize(wid,taille);
  }
  Xcas_change_labelsize(taille);
  Xcas_Main_Window_->redraw();
 }}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_browser {
          label Browser
          callback {std::string s=Xcas_browser_name();
const char * ch=fl_input(gettext("Enter new help browser program (empty line for builtin)"),s.c_str());
if (!ch)
  return;
if (strlen(ch) && strcmp(ch,"builtin")){
  setenv("BROWSER",ch,1);
xcas::use_external_browser=true;
}
else
  xcas::use_external_browser=false;}
          xywh {5 5 100 20}
        }
        MenuItem Save_config {
          label {Save configuration}
          callback {Xcas_save_config(Xcas_get_context());}
          xywh {10 10 100 20}
        }
      }
      Submenu Xcas_help_menu {
        label Help open
        xywh {0 0 100 20}
      } {
        MenuItem Xcas_help_index {
          label Index
          callback {static std::string ans; 
   int remove,ii;
   Fl_Widget * w=xcas::Xcas_input_focus;
   if (
   (ii=xcas::handle_tab("",(*giac::vector_completions_ptr()),Xcas_Main_Window_->w()/3,Xcas_Main_Window_->h()/3,remove,ans)) ){ 
    if (ii==1)
      ans = ans +"()";
    Fl::e_text = (char * ) ans.c_str();
    Fl::e_length = ans.size();
    if (w){
      xcas::fl_handle(w);
      if (Fl_Input * in =dynamic_cast<Fl_Input *>(w)){
        if (ii==1) in->position(in->position()-1);
      }
    }
  }}
          xywh {0 0 100 20}
        }
        MenuItem Xcas_help_find {
          label {Find word in HTML help}
          callback {xcas::help_fltk("");}
          xywh {10 10 100 20} shortcut 0xffc9
        }
        MenuItem Xcas_help_casinter {
          label Interface
          callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"casinter/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casinter/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_help_fiches {
          label {Reference card, fiches}
          callback {if (giac::language(Xcas_get_context())==1) giac::system_browser_command(giac::giac_aide_dir()+"doc/fr/troussesurvie_fr.pdf"); else giac::system_browser_command(giac::giac_aide_dir()+"doc/en/troussesurvie_en.pdf");}
          xywh {25 25 100 20}
        }
        Submenu Xcas_help_manuals {
          label Manuals
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_CAS {
            label {CAS reference}
            callback {const giac::context * contextptr=Xcas_get_context();
if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"cascmd_"+giac::find_lang_prefix(giac::language(contextptr))+"index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cascmd_"+giac::find_lang_prefix(giac::language(contextptr))+"index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_graphtheory {
            label {Graph theory}
            callback {if (xcas::use_external_browser)
           giac::system_browser_command("doc/graphtheory-user_manual.pdf");
        else {
         if (xcas::Xcas_help_window){ //disabled because it crashes with builin browser
           fl_message("%s",("Open with your browser "+giac::giac_aide_dir()+"doc/graphtheory-user_manual.pdf").c_str());
           // xcas::Xcas_help_window->load((giac::giac_aide_dir()+"algo.html").c_str());
           // xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_algo {
            label {Algorithmes (HTML)}
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"algo.html");
        else {
         if (xcas::Xcas_help_window){ //disabled because it crashes with builin browser
           fl_message("%s",("Open with your browser "+giac::giac_aide_dir()+doc_prefix+"algo.html").c_str());
           // xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"algo.html").c_str());
           // xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_algo_pdf {
            label {Algorithmes (PDF)}
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"algo.pdf");
        else {
         if (xcas::Xcas_help_window){
           fl_message("%s",("Open "+giac::giac_aide_dir()+doc_prefix+"algo.pdf").c_str());
           // xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"algo.pdf").c_str());
           // xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_Geo {
            label Geometry
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"casgeo/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casgeo/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_Prog {
            label Programmation
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"casrouge/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casrouge/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
          MenuItem Xcas_help_Tableur {
            label Simulation
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"cassim/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cassim/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {15 15 100 20}
          }
          MenuItem Xcas_help_Tortue {
            label Turtle
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"castor/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"castor/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_Exercices {
            label Exercices
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"casexo/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"casexo/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_Amusement {
            label Amusement
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"cascas/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"cascas/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_PARI {
            label {PARI-GP}
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(giac::giac_aide_dir()+"doc/pari/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+"doc/pari/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {5 5 100 20}
          }
        }
        Submenu Xcas_help_internet {
          label Internet open
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_forum {
            label Forum
            callback {const giac::context * contextptr = xcas::get_context(xcas::Xcas_input_focus);
 giac::system_browser_command(giac::language(contextptr)==4?"http://www.inf.uth.gr/xcas/":"https://xcas.univ-grenoble-alpes.fr/forum");}
            xywh {15 15 100 20}
          }
          MenuItem Xcas_help_lycee_card {
            label {Aide-memoire lycee}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/irem/placlycee.pdf");}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_lycee {
            label {Documents pedagogiques lycee}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/irem.html");}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_algo_lycee {
            label {Documents algorithmique}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/algoxcas.html");}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_connan {
            label {Site Lycee de G. Connan}
            callback {giac::system_browser_command("http://gconnan.free.fr/?page=33");}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_alb {
            label {Site Lycee de L. Briel}
            callback {giac::system_browser_command("http://lycee-rodezlaroque.eap.entmip.fr/le-lycee/xcas/");}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_cheval {
            label {Calcul formel au lycee, par D. Chevallier}
            callback {giac::system_browser_command("http://courelectr.free.fr/Xcas/Xcas_calcul_formel_lycee.pdf");}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_han {
            label {Site de F. Han}
            callback {giac::system_browser_command("http://www.math.jussieu.fr/~han/xcas");}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_capes {
            label {Ressources Capes}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/capes.html");}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_agreg {
            label {Ressources Agregation externe}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/agreg.html");}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_agregint {
            label {Ressources Agregation interne}
            callback {giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/agregint.html");}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_load {
            label {Update help}
            callback {\#ifdef WIN32
  fl_message("%s","Xcas will launch your browser to get the help archive giacshare.tgz.\\nAfter the download is completed, please unarchive casdoc.tgz\\nin the Xcas directory (c:Ês by default)");
 giac::system_browser_command("http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/casdoc.tgz");
 return;
\#endif
  std::string path=giac::xcasroot();
 int s=path.size(),i=s-1;
 for (--i;i>0;--i){
   if (path[i]=='/')
     break;
 }
 path=path.substr(0,i+1)+"share";
 i=fl_ask("%s",("Check that you can write over "+path+",\\ncheck that your Internet connection is ready\\nand check that wget, tar and gzip are installed.\\nProceed?").c_str());
  if (i){
    fl_message("%s",("Executing: mkdir /tmp ; cd /tmp && wget http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/giacshare.tgz && cd "+path+" && tar xvfz /tmp/giacshare.tgz").c_str());
    system(("mkdir /tmp ; cd /tmp && wget http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/giacshare.tgz && cd "+path+" && tar xvfz /tmp/giacshare.tgz").c_str());
  }}
            xywh {5 5 100 20}
          }
        }
        Submenu Xcas_help_start {
          label {Start with CAS}
          xywh {5 5 100 20}
        } {
          MenuItem Xcas_help_tutorial {
            label Tutorial
            callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"tutoriel/index.html");
        else {
         if (xcas::Xcas_help_window){
           xcas::Xcas_help_window->load((giac::giac_aide_dir()+doc_prefix+"tutoriel/index.html").c_str());
           xcas::Xcas_help_window->show();
          }
         }}
            xywh {15 15 100 20}
          }
          MenuItem Xcas_help_solution {
            label Solutions
            callback {const char * ch=fl_input(gettext("Exercise number (from 1 to 25)?"));
if (!ch) return;
int i=atoi(ch);
if (i>0 && i<26){
  std::string name="demarr"+giac::print_INT_(i)+".xws";
  std::ifstream in((giac::giac_aide_dir()+"doc/dxcas/"+name).c_str());
  std::ofstream out(name.c_str());
  bool b=xcas::stream_copy(in,out);
  in.close();
  out.close();
  if (b)
    load_filename(name.c_str(),false);
  else
    load_filename((giac::giac_aide_dir()+"doc/dxcas/"+name).c_str(),false);
}}
            xywh {5 5 100 20}
          }
        }
        MenuItem Xcas_help_start_algoseconde {
          label {Tutoriel algo}
          callback {if (xcas::use_external_browser)
           giac::system_browser_command(doc_prefix+"../algolycee.html");}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_help_make_index {
          label {Rebuild help cache}
          callback {const giac::context * contextptr=Xcas_get_context();
giac::html_help_init("aide_cas",language(contextptr),true,true);}
          xywh {10 10 100 20}
        }
        MenuItem Xcas_a_propos {
          label About
          callback {a_propos();   Xcas_Messages->show(); 
  Xcas_resize_mainwindow();}
          xywh {5 5 100 20}
        }
      }
      Submenu Xcas_help_CASmenu {
        label Toolbox
        xywh {20 20 100 20}
      } {
        MenuItem Xcas_Add_Entry {
          label {New entry}
          callback {xcas::cb_New_Input(Xcas_current_session(),0);}
          xywh {50 50 100 20} shortcut 0x8006e
        }
        MenuItem Xcas_Add_Comment {
          label {New comment}
          callback {xcas::History_cb_New_Comment_Input(Xcas_current_session(),0);}
          xywh {40 40 100 20} shortcut 0x80063
        }
        Submenu Xcas_help_equations {
          label Equations
          xywh {5 5 100 20}
        } {
          MenuItem Xcas_help_solve {
            label {solve: Solve equation or system}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_fsolve {
            label {fsolve: Solve equation numerically}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_proot {
            label {proot: Roots of a polynomial}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_linsolve {
            label {linsolve: Solve linear system}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_desolve {
            label {desolve: Solve differential equation}
            xywh {25 25 100 20}
          }
          MenuItem Xcas_help_odesolve {
            label {odesolve: Solve differential equation (numeric)}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_rsolve {
            label {rsolve: Solve recurrence equation}
            xywh {45 45 100 20}
          }
        }
        Submenu Xcas_help_calculus {
          label Calculus
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_int {
            label {integrate: Integration (definite/indefinite)}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_diff {
            label {diff: Derivative}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_limit {
            label {limit: Limit}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ptayl {
            label {ptayl: Taylor polynomial}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_series {
            label {series: series expansion (with remainder)}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_sum {
            label {sum: Discrete summation}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_laplace {
            label {laplace: Laplace transform}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ilaplace {
            label {ilaplace: invert Laplace transform}
            xywh {35 35 100 20}
          }
        }
        Submenu Xcas_help_Simplify {
          label Simplify
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_simplify {
            label {simplify: Simplify expression}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_normal {
            label {normal: Simplify rational and algebraic expression}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ratnormal {
            label {ratnormal: Simplify rational expressions}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_factor {
            label {factor: Factorization}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_cfactor {
            label {cfactor: Factorization over C}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_partfrac {
            label {partfrac: Partial fraction decomposition}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_cpartfrac {
            label {cpartfrac: Partial fraction decomposition over C}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_sep1 {
            label {---}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_subst {
            label {subst: Substitution of variables by expressions}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_reorder {
            label {reorder: Reorder expression wrt list of variables}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_sep2 {
            label {---}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_lin {
            label {lin: Linearization of exponentials}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_tlin {
            label {tlin: Trigonometric linearization}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_texpand {
            label {texpand: Expand transcendental expressions}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_lncollect {
            label {lncollect: Collect logarithms}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_exp2pow {
            label {exp2pow: Convert exp(a*ln(b)) to b^a}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_exp2trig {
            label {exp2trig: Convert complex exponentials to trig}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_trig2exp {
            label {trig2exp: Convert trig to complex exponentials}
            xywh {35 35 100 20}
          }
        }
        Submenu Xcas_help_arit {
          label Arithmetic
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_isprime {
            label {isprime: test if an integer is prime}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ifactor {
            label {ifactor: factorize an integer}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_iquo {
            label {iquo: quotient for integers}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_irem {
            label {irem: remainder for integers}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_iabcuv {
            label {iabcuv: Solve a.u+b.v=c in Z}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ichinrem {
            label {ichinrem: Chinese remainder for integers}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_sep3 {
            label {---}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_gcd {
            label {gcd: gcd of integers or polynomials}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_lcm {
            label {lcm: lcm of integers or polynomials}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_powmod {
            label {powmod: fast powering modulo}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_sep4 {
            label {---}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_quo {
            label {quo: quotient (poly. synthetic division)}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_rem {
            label {rem: remainder (poly. synthetic division)}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_abcuv {
            label {abcuv: Solve a.u+b.v=c for polynomials}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_chinrem {
            label {chinrem: Chinese remainder for polynomials}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_pourcent {
            label {%: Z/pZ, p prime}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_GF {
            label {GF: Finite non prime fields}
            xywh {35 35 100 20}
          }
        }
        Submenu Xcas_help_linal {
          label {Linear algebra}
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_matrix {
            label {matrix: Create a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_tran {
            label {tran: Transpose a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_ker {
            label {ker: Kernel of a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_image {
            label {image: Image of a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_inverse {
            label {inv: Invert a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_det {
            label {det: Determinant of a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_charpoly {
            label {charpoly: Characteristic polynomial}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_egv {
            label {egv: Eigenvectors of a matrix}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_egvl {
            label {egvl: Eigenvalues of a matrix}
            xywh {35 35 100 20}
          }
        }
        Submenu Xcas_help_proba {
          label Proba
          xywh {0 0 100 20}
        } {
          MenuItem Xcas_help_binomial {
            label {binomial: Binomial distribution}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_comb {
            label {comb: comb(n,k) n choose k}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_normald {
            label {normald: Normal density}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_seq {
            label {seq: list}
            xywh {50 50 100 20}
          }
          MenuItem Xcas_help_rand {
            label {rand: random number}
            xywh {50 50 100 20}
          }
          MenuItem Xcas_help_ranm {
            label {ranm: random vector/matrix}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_randmarkov {
            label {randmarkov: random Markov matrix or chain}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_markov {
            label {markov: transition matrix decomposition}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_cdf {
            label {cdf: cumulated distribution function}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_icdf {
            label {icdf: inverse cumulated distributed function}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_proba_plot {
            label {=== see also plots in Graph ====}
            xywh {35 35 100 20}
          }
          Submenu {} {
            label {Continuous (densities)} open
            xywh {0 0 62 20}
          } {
            MenuItem Xcas_help_betad {
              label {betad: Beta density}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_cauchy {
              label {cauchyd: Cauchy density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_chisquare {
              label {chisquared: Chi 2 density}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_exponential {
              label {exponentiald: Exponential density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_fisher {
              label {fisherd: Fisher-Snedecor density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_gammad {
              label {gammad: Gamma density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_normald2 {
              label {normald: Normal density}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_student {
              label {studentd: Student density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_uniform {
              label {uniformd: Uniform density}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_weibull {
              label {weibulld: Weibull density}
              xywh {40 40 100 20}
            }
          }
          Submenu {} {
            label {Discrete distributions} open
            xywh {0 0 62 20}
          } {
            MenuItem Xcas_help_binomial2 {
              label {binomial: Binomial distribution}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_negbinomial {
              label {negbinomial: Negative binomial distribution}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_geometric {
              label {geometric: Geometric distribution}
              xywh {40 40 100 20}
            }
            MenuItem Xcas_help_poisson {
              label {poisson: poisson distribution}
              xywh {40 40 100 20}
            }
          }
          Submenu {} {
            label Tests open
            xywh {0 0 62 20}
          } {
            MenuItem Xcas_help_chisquare_icdf {
              label {chisquared_icdf: Chi 2 inverse}
              xywh {60 60 100 20}
            }
            MenuItem Xcas_help_chisquaret {
              label {chisquaret: Chi 2 test}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_kolmogorovd {
              label {kolmogorovd: K-Smirnov density}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_kolmogorovt {
              label {kolmogorovt: K-Smirnov test}
              xywh {45 45 100 20}
            }
            MenuItem Xcas_help_normald_icdf2 {
              label {normald_icdf: Normal inverse}
              xywh {60 60 100 20}
            }
            MenuItem Xcas_help_normalt {
              label {normalt: Z-Test}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_studentd_icdf2 {
              label {studentd_icdf: Student inverse}
              xywh {60 60 100 20}
            }
            MenuItem Xcas_help_studentt {
              label {studentt: T-Test}
              xywh {50 50 100 20}
            }
            MenuItem Xcas_help_wilcoxont {
              label {wilcoxont: Test}
              xywh {50 50 100 20}
            }
          }
        }
      }
      Submenu Xcas_help_expression {
        label Expression
        xywh {40 40 100 20}
      } {
        MenuItem Xcas_Add_Expression {
          label {New expression}
          callback {xcas::History_cb_New_Equation(Xcas_current_session(),0);}
          xywh {125 125 100 20} shortcut 0x80065
        }
      }
      Submenu Xcas_help_allcmds {
        label Cmds
        xywh {85 85 100 20}
      } {
        Submenu Xcas_help_constants {
          label Constants open
          xywh {15 15 100 20}
        } {
          MenuItem Xcas_help_i {
            label {i: sqrt(-1)}
            callback {int mode=giac::xcas_mode(Xcas_get_context()); if (mode==1 || mode==2) xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"I",'I'); else xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"i",'i');}
            xywh {35 35 100 20}
          }
          MenuItem Xcas_help_e {
            label {e: exp(1)}
            callback {int mode=giac::xcas_mode(Xcas_get_context()); if (mode==1 || mode==2) xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"exp(1)",'e'); else xcas::in_Xcas_input_char(xcas::Xcas_input_focus,"e",'e');}
            xywh {35 35 100 20}
          }
        }
      }
      Submenu Xcas_help_prog {
        label Prg
        xywh {55 55 100 20}
      } {
        MenuItem Xcas_Add_Program {
          label {New program}
          callback {xcas::History_cb_New_Program(Xcas_current_session(),0);}
          xywh {110 110 100 20} shortcut 0x80070
        }
        MenuItem Xcas_help_debug {
          label {debug: debug a program}
          xywh {65 65 100 20}
        }
      }
      Submenu Xcas_help_graph {
        label Graphic
        xywh {40 40 100 20}
      } {
        MenuItem Xcas_help_attributs {
          label Attributs
          callback {static int res=0;
bool untranslate=false,approx=false,formel=false;
Fl_Widget * w=xcas::Xcas_input_focus;
Fl_Input_ * i=dynamic_cast<Fl_Input_*>(w);
xcas::Xcas_Text_Editor * ed=dynamic_cast<xcas::Xcas_Text_Editor *>(w);
if (i && xcas::change_line_type(res,false,approx,"Attributs",false,formel,untranslate,false,
Xcas_Main_Window_->labelsize())!=1){
  std::string s="display="+xcas::print_color(res);
  i->insert(s.c_str()); 
  Fl::focus(i);
}
if (ed && xcas::change_line_type(res,false,approx,"Attributs",false,formel,untranslate,false,
Xcas_Main_Window_->labelsize())!=1){
  std::string s="display="+xcas::print_color(res);
  ed->insert(s.c_str()); 
  Fl::focus(ed);
}}
          xywh {65 65 100 20} shortcut 0x8006b
        }
        Submenu Xcas_help_curves {
          label Curves
          xywh {10 10 100 20}
        } {
          MenuItem Xcas_help_plot {
            label {plotfunc: Plot a 1-var function}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && tablefunc_dialog(f,arg,true,0,gettext("Graph of a function"))){
	f->add_entry(pos);
	arg="plot(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotparam2d {
            label {plotparam: Parametric 2-d curve}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,0)){
	f->add_entry(pos);
	arg="plotparam(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotpolar {
            label {plotpolar: Polar 2-d curve}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,-1)){
	f->add_entry(pos);
	arg="plotpolar(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotarea {
            label {plotarea: Area under curve}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && tablefunc_dialog(f,arg,true,2,gettext("Area under curve"))){
	f->add_entry(pos);
	arg="plotarea(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotimplicit {
            label {plotimplicit: Implicit plot}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,3)){
	f->add_entry(pos);
	arg="plotimplicit(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotcontour {
            label {plotcontour: Level curves}
            xywh {40 40 100 20}
          }
          MenuItem Xcas_help_plotdensity {
            label {plotdensity: 2-d z view as color}
            xywh {50 50 100 20}
          }
        }
        Submenu Xcas_help_graph_surfaces {
          label Surfaces
          xywh {75 75 100 20}
        } {
          MenuItem Xcas_help_plot3d {
            label {plotfunc: Plot a 2-var function}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && tablefunc_dialog(f,arg,true,1,gettext("Graph of a function"))){
	f->add_entry(pos);
	arg="plotfunc(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_plotparam3d {
            label {plotparam: Parametric 3-d surface}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,1)){
	f->add_entry(pos);
	arg="plotparam(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {45 45 100 20}
          }
        }
        Submenu Xcas_help_graph_suite {
          label Sequence
          xywh {65 65 100 20}
        } {
          MenuItem Xcas_help_plotseq {
            label {plotseq: Recurrent sequence plot}
            callback {int pos;
std::string arg,u0param;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && tableseq_dialog(f,arg,true,gettext("Graph of a recurrent sequence"),u0param)){
	f->add_entry(pos);
	arg=u0param+"; plotseq(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_plotlist {
            label {plotlist: plot a list of values}
            xywh {55 55 100 20}
          }
        }
        Submenu Xcas_help_graph_ode {
          label Ode
          xywh {75 75 100 20}
        } {
          MenuItem Xcas_help_plotfield {
            label {plotfield: 2-d or 3-d field}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,2)){
	f->add_entry(pos);
	arg="plotfield(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_plotode {
            label {plotode: Diff. equation plot}
            xywh {45 45 100 20}
          }
          MenuItem Xcas_help_iplotode {
            label {interactive_odeplot: Interactive diff. equation plot}
            callback {int pos;
std::string arg;
xcas::History_Pack * f=xcas::get_history_pack(xcas::Xcas_input_focus,pos);
if (f && plotparam_dialog(f,arg,2)){
	f->add_entry(pos);
	arg="interactive_plotode(" +arg+")";
	f->set_value(pos,arg,true);
      }}
            xywh {55 55 100 20}
          }
        }
        Submenu Xcas_help_graph_stats {
          label {Proba Stats}
          xywh {65 65 100 20}
        } {
          MenuItem Xcas_help_camembert {
            label {camembert: 1-d stats}
            xywh {55 55 100 20}
          }
          MenuItem Xcas_help_baton {
            label {bar_plot: bar plot}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_help_histogram {
            label {histogram: 1-d stats}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_help_plotstat {
            label {plot: plot distribution law}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_help_plotcdf {
            label {plotcdf: plot cumulated distribution function}
            xywh {65 65 100 20}
          }
          MenuItem Xcas_help_moustache {
            label {moustache: 1-d stats}
            xywh {75 75 100 20}
          }
          MenuItem Xcas_help_scatterplot {
            label {scatterplot: 2-d stats}
            xywh {85 85 100 20}
          }
          MenuItem Xcas_help_polygonplot {
            label {polygonplot: 2-d stats}
            xywh {95 95 100 20}
          }
          MenuItem Xcas_help_polygonscatterplot {
            label {polygonscatterplot: 2-d stats}
            xywh {95 95 100 20}
          }
          MenuItem Xcas_help_linear_regression_plot {
            label {linear_regressionplot: 2-d stats}
            xywh {95 95 100 20}
          }
          MenuItem Xcas_help_plotproba {
            label {plotproba: probabilistic graph}
            xywh {65 65 100 20}
          }
        }
      }
      Submenu Xcas_help_geo {
        label Geo
        xywh {40 40 100 20}
      } {
        MenuItem Xcas_Add_Figure {
          label {New figure 2d}
          callback {xcas::History_cb_New_Figure(Xcas_current_session(),0);}
          xywh {75 75 100 20} shortcut 0x80067
        }
        MenuItem Xcas_Add_Figure3d {
          label {New figure 3d}
          callback {xcas::History_cb_New_Figure3d(Xcas_current_session(),0);}
          xywh {85 85 100 20} shortcut 0x80068
        }
      }
      Submenu Xcas_help_tableur {
        label Spreadsheet
        xywh {30 30 100 20}
      } {
        MenuItem Xcas_Add_Tableur {
          label {New spreadsheet}
          callback {xcas::History_cb_New_Tableur(Xcas_current_session(),0);}
          xywh {60 60 100 20} shortcut 0x80074
        }
      }
      Submenu Xcas_help_phys {
        label Phys open
        xywh {95 95 100 20}
      } {}
      Submenu Xcas_help_scolaire {
        label Highschool open
        xywh {75 75 100 20}
      } {}
      Submenu Xcas_help_tortue {
        label Turtle open
        xywh {65 65 100 20}
      } {
        MenuItem Xcas_Add_Logo {
          label {New turtle}
          callback {xcas::History_cb_New_Logo(Xcas_current_session(),0);} selected
          xywh {105 105 100 20} shortcut 0x8006c
        }
      }
    }
    Fl_Tabs Xcas_Main_Tab {open
      xywh {0 25 775 360} selection_color 215 resizable
      class {xcas::Xcas_Tabs}
    } {}
    Fl_Group Xcas_Keyboard_Group {open
      xywh {0 415 455 100}
    } {
      Fl_Group Xcas_Alpha_Keyboard {
        xywh {0 415 305 100} hide
      } {
        Fl_Button Xcas_a_key {
          label a
          xywh {0 415 30 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_b_key {
          label b
          xywh {30 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_c_key {
          label c
          xywh {55 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_d_key {
          label d
          xywh {80 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_e_key {
          label e
          xywh {105 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_f_key {
          label f
          xywh {130 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_g_key {
          label g
          xywh {155 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_h_key {
          label h
          xywh {180 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_i_key {
          label i
          xywh {205 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_j_key {
          label j
          xywh {230 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_k_key {
          label k
          xywh {255 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_l_key {
          label l
          xywh {280 415 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_m_key {
          label m
          xywh {0 440 30 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_n_key {
          label n
          xywh {30 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_o_key {
          label o
          xywh {55 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_p_key {
          label p
          xywh {80 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_q_key {
          label q
          xywh {105 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_r_key {
          label r
          xywh {130 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_s_key {
          label s
          xywh {155 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_t_key {
          label t
          xywh {180 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_u_key {
          label u
          xywh {205 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_v_key {
          label v
          xywh {230 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_w_key {
          label w
          xywh {255 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_x_key {
          label x
          xywh {280 440 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_y_key {
          label y
          xywh {0 465 30 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_z_key {
          label z
          xywh {30 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Inferieur_key {
          label {<}
          xywh {55 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Superieur_key {
          label {>}
          xywh {80 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Backslash_key {
          label {\\}
          xywh {30 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Parenthese_ouvrante_key {
          label {(}
          xywh {105 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Parenthese_fermante_key {
          label {)}
          xywh {130 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Espace_key {
          label { }
          xywh {255 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Point_exclamation_key {
          label {!}
          xywh {180 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Crochet_fermant_key {
          label {]}
          xywh {180 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Crochet_ouvrant_key {
          label {[}
          xywh {155 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Accolade_ouvrant_key {
          label {\{}
          xywh {205 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Accolade_fermant_key {
          label {\}}
          xywh {230 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Deux_points_key {
          label {:}
          xywh {130 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Equal_key {
          label {=}
          xywh {155 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Guillemet_key {
          label {"}
          xywh {280 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Souligne_key {
          label _
          xywh {55 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Majuscule_key {
          label Maj
          callback {if (Xcas_Majuscule_key->label()==std::string(gettext("min"))){
  Xcas_Majuscule_key->label(gettext("Maj"));
  Xcas_a_key->label("a");
  Xcas_b_key->label("b");
  Xcas_c_key->label("c");
  Xcas_d_key->label("d");
  Xcas_e_key->label("e");
  Xcas_f_key->label("f");
  Xcas_g_key->label("g");
  Xcas_h_key->label("h");
  Xcas_i_key->label("i");
  Xcas_j_key->label("j");
  Xcas_k_key->label("k");
  Xcas_l_key->label("l");
  Xcas_m_key->label("m");
  Xcas_n_key->label("n");
  Xcas_o_key->label("o");
  Xcas_p_key->label("p");
  Xcas_q_key->label("q");
  Xcas_r_key->label("r");
  Xcas_s_key->label("s");
  Xcas_t_key->label("t");
  Xcas_u_key->label("u");
  Xcas_v_key->label("v");
  Xcas_w_key->label("w");
  Xcas_x_key->label("x");
  Xcas_y_key->label("y");
  Xcas_z_key->label("z");
\#ifdef _HAVE_FL_UTF8_HDR_
if (Xcas_Greek_key->label()==std::string("A")){
  Xcas_a_key->label("α");
  Xcas_b_key->label("β");
  Xcas_g_key->label("γ");
  Xcas_d_key->label("δ");
  Xcas_e_key->label("ε");
  Xcas_z_key->label("ζ");
  Xcas_h_key->label("η");
  Xcas_q_key->label("θ");
  Xcas_i_key->label("ι");
  Xcas_k_key->label("κ");
  Xcas_l_key->label("λ");
  Xcas_m_key->label("μ");
  Xcas_n_key->label("ν");
  Xcas_x_key->label("ξ");
  Xcas_o_key->label("ο");
  Xcas_p_key->label("π");
  Xcas_r_key->label("ρ");
  Xcas_s_key->label("σ");
  Xcas_t_key->label("τ");
  Xcas_u_key->label("υ");
  Xcas_f_key->label("φ");
  Xcas_c_key->label("χ");
  Xcas_y_key->label("ψ"); // FIXME
  Xcas_w_key->label("ω");
  Xcas_j_key->label("ϒ"); // FIXME
  Xcas_v_key->label("ϖ"); // FIXME
}
\#endif
}
else {
  Xcas_Majuscule_key->label(gettext("min"));
  Xcas_a_key->label("A");
  Xcas_b_key->label("B");
  Xcas_c_key->label("C");
  Xcas_d_key->label("D");
  Xcas_e_key->label("E");
  Xcas_f_key->label("F");
  Xcas_g_key->label("G");
  Xcas_h_key->label("H");
  Xcas_i_key->label("I");
  Xcas_j_key->label("J");
  Xcas_k_key->label("K");
  Xcas_l_key->label("L");
  Xcas_m_key->label("M");
  Xcas_n_key->label("N");
  Xcas_o_key->label("O");
  Xcas_p_key->label("P");
  Xcas_q_key->label("Q");
  Xcas_r_key->label("R");
  Xcas_s_key->label("S");
  Xcas_t_key->label("T");
  Xcas_u_key->label("U");
  Xcas_v_key->label("V");
  Xcas_w_key->label("W");
  Xcas_x_key->label("X");
  Xcas_y_key->label("Y");
  Xcas_z_key->label("Z");
\#ifdef _HAVE_FL_UTF8_HDR_
if (Xcas_Greek_key->label()==std::string("A")){
  Xcas_a_key->label("Α");
  Xcas_b_key->label("Β");
  Xcas_g_key->label("Γ");
  Xcas_d_key->label("Δ");
  Xcas_e_key->label("Ε");
  Xcas_z_key->label("Ζ");
  Xcas_h_key->label("Η");
  Xcas_q_key->label("Θ");
  Xcas_i_key->label("Ι");
  Xcas_k_key->label("Κ");
  Xcas_l_key->label("Λ");
  Xcas_m_key->label("Μ");
  Xcas_n_key->label("Ν");
  Xcas_x_key->label("Ξ");
  Xcas_o_key->label("Ο");
  Xcas_p_key->label("Π");
  Xcas_r_key->label("Ρ");
  Xcas_s_key->label("Σ");
  Xcas_t_key->label("Τ");
  Xcas_u_key->label("Υ");
  Xcas_f_key->label("Φ");
  Xcas_c_key->label("Χ");
  Xcas_y_key->label("Ψ"); // FIXME
  Xcas_w_key->label("Ω");
  Xcas_j_key->label("ϒ"); // FIXME
  Xcas_v_key->label("ϖ"); // FIXME
}
\#endif
}
Xcas_Alpha_Keyboard->redraw();}
          xywh {0 490 30 25} color 1 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Diese_key {
          label {\#}
          xywh {205 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Pi_key {
          label {Π}
          xywh {230 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Greek_key {
          label a
          callback {\#ifdef _HAVE_FL_UTF8_HDR_
if (Xcas_Greek_key->label()==std::string("α")){
  Xcas_Greek_key->label("A");
}
else {
  Xcas_Greek_key->label("α");
}
if (Xcas_Majuscule_key->label()==std::string(gettext("min")))
  Xcas_Majuscule_key->label(gettext("Maj"));
else
  Xcas_Majuscule_key->label(gettext("min"));
cb_Xcas_Majuscule_key(0,0);
\#else // _HAVE_FL_UTF8_HDR_
if (Xcas_Greek_key->label()==std::string("a")){
  Xcas_Greek_key->label("A");
  Xcas_a_key->labelfont(FL_SYMBOL);
  Xcas_b_key->labelfont(FL_SYMBOL);
  Xcas_c_key->labelfont(FL_SYMBOL);
  Xcas_d_key->labelfont(FL_SYMBOL);
  Xcas_e_key->labelfont(FL_SYMBOL);
  Xcas_f_key->labelfont(FL_SYMBOL);
  Xcas_g_key->labelfont(FL_SYMBOL);
  Xcas_h_key->labelfont(FL_SYMBOL);
  Xcas_i_key->labelfont(FL_SYMBOL);
  Xcas_j_key->labelfont(FL_SYMBOL);
  Xcas_k_key->labelfont(FL_SYMBOL);
  Xcas_l_key->labelfont(FL_SYMBOL);
  Xcas_m_key->labelfont(FL_SYMBOL);
  Xcas_n_key->labelfont(FL_SYMBOL);
  Xcas_o_key->labelfont(FL_SYMBOL);
  Xcas_p_key->labelfont(FL_SYMBOL);
  Xcas_q_key->labelfont(FL_SYMBOL);
  Xcas_r_key->labelfont(FL_SYMBOL);
  Xcas_s_key->labelfont(FL_SYMBOL);
  Xcas_t_key->labelfont(FL_SYMBOL);
  Xcas_u_key->labelfont(FL_SYMBOL);
  Xcas_v_key->labelfont(FL_SYMBOL);
  Xcas_w_key->labelfont(FL_SYMBOL);
  Xcas_x_key->labelfont(FL_SYMBOL);
  Xcas_y_key->labelfont(FL_SYMBOL);
  Xcas_z_key->labelfont(FL_SYMBOL);
}
else {
  Xcas_Greek_key->label("a");
  Xcas_a_key->labelfont(FL_HELVETICA);
  Xcas_b_key->labelfont(FL_HELVETICA);
  Xcas_c_key->labelfont(FL_HELVETICA);
  Xcas_d_key->labelfont(FL_HELVETICA);
  Xcas_e_key->labelfont(FL_HELVETICA);
  Xcas_f_key->labelfont(FL_HELVETICA);
  Xcas_g_key->labelfont(FL_HELVETICA);
  Xcas_h_key->labelfont(FL_HELVETICA);
  Xcas_i_key->labelfont(FL_HELVETICA);
  Xcas_j_key->labelfont(FL_HELVETICA);
  Xcas_k_key->labelfont(FL_HELVETICA);
  Xcas_l_key->labelfont(FL_HELVETICA);
  Xcas_m_key->labelfont(FL_HELVETICA);
  Xcas_n_key->labelfont(FL_HELVETICA);
  Xcas_o_key->labelfont(FL_HELVETICA);
  Xcas_p_key->labelfont(FL_HELVETICA);
  Xcas_q_key->labelfont(FL_HELVETICA);
  Xcas_r_key->labelfont(FL_HELVETICA);
  Xcas_s_key->labelfont(FL_HELVETICA);
  Xcas_t_key->labelfont(FL_HELVETICA);
  Xcas_u_key->labelfont(FL_HELVETICA);
  Xcas_v_key->labelfont(FL_HELVETICA);
  Xcas_w_key->labelfont(FL_HELVETICA);
  Xcas_x_key->labelfont(FL_HELVETICA);
  Xcas_y_key->labelfont(FL_HELVETICA);
  Xcas_z_key->labelfont(FL_HELVETICA);
}
\#endif
Xcas_Alpha_Keyboard->redraw();}
          xywh {280 490 25 25} color 1 selection_color 0 labelfont 12
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Alpha_virgule_key {
          label {,}
          xywh {80 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Alpha_point_virgule_key {
          label {;}
          xywh {105 490 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Alpha_quote_key {
          label {'}
          xywh {255 465 25 25} color 10 labelsize 10
          class {xcas::No_Focus_Button}
        }
      }
      Fl_Group Xcas_Scientific_Keyboard {open
        xywh {0 415 310 100}
      } {
        Fl_Group Lettre_keyboard {
          xywh {0 415 50 50}
        } {
          Fl_Button Xcas_Variable_x {
            label x
            xywh {0 415 25 25} shortcut 0x78 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Variable_y {
            label y
            xywh {25 415 25 25} shortcut 0x79 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Variable_z {
            label z
            xywh {0 440 25 25} shortcut 0x7a labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Variable_t {
            label t
            xywh {25 440 25 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Xcas_Delim_keyboard {
          xywh {50 415 140 50}
        } {
          Fl_Button Xcas_Double_quote {
            label {"}
            tooltip {String delimiter} xywh {70 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Parentheses {
            label {(}
            xywh {100 440 25 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Brackets {
            label {{}}
            tooltip {Bloc delimiter (set delimiter in maple compatible mode)} xywh {130 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Crochets {
            label {[]}
            tooltip {List, vector, matrix delimiter} xywh {100 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Quote {
            label {'}
            tooltip Quote xywh {50 415 20 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Virgule {
            label {,}
            xywh {125 440 20 25}
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Semi_button {
            label {;}
            xywh {160 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Sto {
            label {:=}
            tooltip Assign xywh {70 440 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Keyboard_suchthat {
            label {|}
            xywh {50 440 20 25}
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Keyboard_rp {
            label {)}
            xywh {145 440 25 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_RPN_space {
            label { }
            xywh {170 440 20 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Cst_keyboard {open
          xywh {190 415 60 50}
        } {
          Fl_Button Xcas_Cst_i {
            label i
            callback {const giac::context * contextptr=Xcas_get_context();
Xcas_input_0arg(Xcas_Cst_i,giac::printi(contextptr));}
            tooltip {Complex square root of -1} xywh {190 440 30 25} shortcut 0x69 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Cst_pi {
            label {π}
            callback {Xcas_input_0arg(Xcas_Cst_pi,"pi");}
            tooltip {The pi number} xywh {220 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Keyboard_infinity {
            label oo
            callback {Xcas_input_0arg(Xcas_Keyboard_infinity,"+infinity");}
            tooltip {Infinity (unsigned)} xywh {190 415 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Racine_carree {
            label sqrt
            callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"sqrt",true);}
            tooltip {Square root} xywh {220 440 30 25} labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Rewrite_keyboard {open
          xywh {0 465 60 50}
        } {
          Fl_Button Xcas_approx_key {
            label {~}
            callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"approx",true);}
            tooltip Evalf xywh {0 465 15 25} shortcut 0x80061 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_simplify_key {
            label simplify
            callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"simplify",true);}
            tooltip {simplify: Simplify expression} xywh {0 490 30 25} shortcut 0xc0073 labelsize 10 align 84
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_factor_key {
            label factor
            callback {xcas::in_Xcas_input_1arg(xcas::Xcas_input_focus,"factor",true);}
            tooltip {factor: Factorization} xywh {30 465 30 25} shortcut 0x80066 labelsize 10 align 84
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_convert_key {
            label {=>}
            callback {Xcas_input_0arg(Xcas_convert_key," => ");}
            tooltip {Sto/Convert to} xywh {15 465 15 25} shortcut 0x80063 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Menu_Button Xcas_Prg_Menubutton {
            label prg open
            xywh {30 490 30 25} labelsize 10
          } {
            MenuItem Xcas_Prg_si {
              label si
              callback {Fl::e_text=(char *)" si alors sinon fsi; ";Fl::e_length=21; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
            MenuItem Xcas_Prg_pour {
              label pour
              callback {Fl::e_text=(char *)" pour de jusque faire  fpour; ";Fl::e_length=30; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
            MenuItem Xcas_Prg_tantque {
              label tantque
              callback {Fl::e_text=(char *)" tantque faire ftantque; ";Fl::e_length=25; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
            MenuItem Xcas_Prg_repeter {
              label repeter
              callback {Fl::e_text=(char *)" repeter jusqua ; ";Fl::e_length=18; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
            MenuItem Xcas_Prg_fonction {
              label fonction
              callback {Fl::e_text=(char *)"f(x,y):= { local ;  }";
Fl::e_length=21; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
            MenuItem Xcas_Prg_return {
              label return
              callback {Fl::e_text=(char *)"return ;";
Fl::e_length=8; xcas::fl_handle(xcas::Xcas_input_focus);}
              xywh {0 0 31 20} labelsize 10
            }
          }
        }
        Fl_Group Xcas_calculus_group {open
          xywh {60 465 40 50}
        } {
          Fl_Button Xcas_diff_key {
            label {∂}
            callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_diff_key,"∂"); else xcas::Xcas_input_arg(Xcas_diff_key,"diff");}
            tooltip diff xywh {60 465 20 25} shortcut 0x80064 labelfont 10 labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_int_key {
            label {∫}
            callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_int_key,"∫"); else xcas::Xcas_input_arg(Xcas_int_key,"integrate");}
            tooltip Integral xywh {80 465 20 25} shortcut 0x80069 labelfont 10 labelsize 12
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_sigma_key {
            label {Σ}
            callback {if (calc_mode(Xcas_get_context())==38) xcas::Xcas_input_arg(Xcas_sigma_key,"Σ"); else xcas::Xcas_input_arg(Xcas_sigma_key,"sum");}
            tooltip Sum xywh {80 490 20 25} labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_limit_key {
            label lim
            callback {xcas::Xcas_input_arg(Xcas_limit_key,"limit");}
            tooltip Limit xywh {60 490 20 25} shortcut 0x8006c labelsize 10
            class {xcas::No_Focus_Button}
          }
        }
        Fl_Group Transcendental {open
          xywh {100 465 150 50}
        } {
          Fl_Group Trig_keyboard {open
            xywh {100 465 150 25}
          } {
            Fl_Button Xcas_Sinus_button {
              label sin
              tooltip Sinus xywh {115 465 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Cosinus_button {
              label cos
              xywh {165 465 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Tangeant_button {
              label tan
              tooltip Tangent xywh {215 465 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Asinus_button {
              label a
              callback {Xcas_input_arg(Xcas_Asinus_button,"asin");}
              tooltip Arcsinus xywh {100 465 15 25} color 29 labelsize 10 labelcolor 4
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Acosinus_button {
              label a
              callback {Xcas_input_arg(Xcas_Acosinus_button,"acos");}
              tooltip Arccosinus xywh {150 465 15 25} color 29 labelsize 10 labelcolor 4
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Atangeant_button {
              label a
              callback {Xcas_input_arg(Xcas_Atangeant_button,"atan");}
              tooltip Arctangent xywh {200 465 15 25} color 29 labelsize 10 labelcolor 4
              class {xcas::No_Focus_Button}
            }
          }
          Fl_Group Exp_keyboard {open
            xywh {100 490 150 25}
          } {
            Fl_Button Xcas_Exp_button {
              label exp
              tooltip Exponential xywh {135 490 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Dix_puissance {
              label {10^}
              xywh {215 490 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Ln10_button {
              label log10
              tooltip {base 10 logarithm} xywh {170 490 45 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
            Fl_Button Xcas_Ln_button {
              label ln
              tooltip {Natural logarithm} xywh {100 490 35 25} labelsize 10 align 64
              class {xcas::No_Focus_Button}
            }
          }
        }
        Fl_Group Operations_keyboard {open
          xywh {250 415 60 100}
        } {
          Fl_Button Xcas_Plus {
            label {+}
            xywh {280 415 30 25} shortcut 0x2b
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Moins {
            label {-}
            tooltip Subtract xywh {290 440 20 25} shortcut 0x2d
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Fois {
            label {*}
            xywh {280 465 30 25} shortcut 0x2a
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Divise {
            label {/}
            xywh {280 490 30 25} shortcut 0x2f
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Puissance {
            label {^}
            xywh {250 465 30 25} shortcut 0x5e labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_C_mod {
            label {%}
            tooltip Modulo xywh {250 490 30 25} labelsize 10
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Inverse_button {
            label inv
            tooltip Inverse xywh {250 415 30 25} labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Neg_button {
            label neg
            tooltip Opposite xywh {270 440 20 25} labelsize 10 align 64
            class {xcas::No_Focus_Button}
          }
          Fl_Button Xcas_Superieur {
            label {>}
            xywh {250 440 20 25} shortcut 0x2d
            class {xcas::No_Focus_Button}
          }
        }
      }
      Fl_Group Numeric_numbers {
        xywh {310 415 75 100}
      } {
        Fl_Button Xcas_Un {
          label 1
          xywh {310 465 25 25} shortcut 0x31
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Deux {
          label 2
          xywh {335 465 25 25} shortcut 0x32
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Trois {
          label 3
          xywh {360 465 25 25} shortcut 0x33
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Quatre {
          label 4
          xywh {310 440 25 25} shortcut 0x34
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Cinq {
          label 5
          xywh {335 440 25 25} shortcut 0x35
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Six {
          label 6
          xywh {360 440 25 25} shortcut 0x36
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Sept {
          label 7
          xywh {310 415 25 25} shortcut 0x37
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Huit {
          label 8
          xywh {335 415 25 25} shortcut 0x38
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Neuf {
          label 9
          xywh {360 415 25 25} shortcut 0x39
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Zero {
          label 0
          xywh {310 490 25 25} shortcut 0x30
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Point {
          label {.}
          xywh {335 490 25 25}
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_EEX {
          label E
          xywh {360 490 25 25} labelsize 10
          class {xcas::No_Focus_Button}
        }
      }
      Fl_Group Kbd_control {open
        xywh {385 415 70 100}
      } {
        Fl_Button Xcas_Echap {
          label esc
          callback {;
static char petit_buffer[]="";
Fl::e_length=0;
Fl::e_text=petit_buffer;
Fl::e_keysym=FL_Escape;
xcas::fl_handle(xcas::Xcas_input_focus);}
          tooltip {Cancel (erase cmdline, stop interactive_plotode)} xywh {385 415 35 20} shortcut 0xff1b labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Alpha {
          label abc
          callback {if (Xcas_Alpha_Keyboard->visible()){
  Xcas_Alpha_Keyboard->hide();
  Xcas_Scientific_Keyboard->show();
}
else {
  Xcas_Alpha_Keyboard->show();
  Xcas_Scientific_Keyboard->hide();
}}
          tooltip {Show/Hide alphabetic keyboard} xywh {420 475 35 20} shortcut 0xff1b labelsize 10 labelcolor 4 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Cmds {
          label cmds
          callback {Xcas_Keyboard_Switch(4);}
          tooltip {Show commands bandeau} xywh {420 435 35 20} shortcut 0xff1b color 17 labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Msg {
          label msg
          callback {Xcas_Keyboard_Switch(2);}
          tooltip {Show messages} xywh {420 455 35 20} shortcut 0xff1b color 17 labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_b7 {
          label b7
          callback {xcas::alt_ctrl=4+Xcas_Alpha_Keyboard->visible();
  Xcas_Alpha_Keyboard->show();
  Xcas_Scientific_Keyboard->hide();}
          tooltip {Set bit 7 for next key entry} xywh {385 435 35 20} shortcut 0xff1b labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Ctrl {
          label ctrl
          callback {xcas::alt_ctrl=2+Xcas_Alpha_Keyboard->visible();
  Xcas_Alpha_Keyboard->show();
  Xcas_Scientific_Keyboard->hide();}
          tooltip Control xywh {385 455 35 20} shortcut 0xff1b labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_close_keyboard {
          label X
          callback {Xcas_Keyboard_Switch(1);}
          tooltip {Close keyboard} xywh {420 415 35 20} color 17 labelsize 10
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_main_del_button {
          label {@<}
          callback {static char petit_buffer[]="";
      petit_buffer[0]=0;
      Fl::e_length=0;
      Fl::e_text=petit_buffer;
      Fl::e_keysym=FL_BackSpace;
      xcas::fl_handle(xcas::Xcas_input_focus);}
          tooltip Backspace xywh {420 495 35 20} shortcut 0x40076 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_main_paste_button {
          label paste
          callback {xcas::cb_Paste(0,0);}
          xywh {385 475 35 20} shortcut 0x40076 labelsize 10 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_main_enter_button {
          label {@returnarrow}
          callback {static char petit_buffer[]="";
      petit_buffer[0]=0;
      Fl::e_length=0;
      Fl::e_text=petit_buffer;
      Fl::e_keysym=FL_Enter;
      xcas::fl_handle(xcas::Xcas_input_focus);}
          xywh {385 495 35 20} shortcut 0x40076 color 167 labelcolor 49 align 64
          class {xcas::No_Focus_Button}
        }
      }
    }
    Fl_Group Xcas_Bandeau_Keys {open
      xywh {0 515 455 30}
    } {
      Fl_Group Xcas_Bandeau_Keys_Group {
        xywh {0 515 420 30}
      } {
        Fl_Button Xcas_PREV_Key {
          label {<<}
          callback {if (rpn_menu_page )
  --rpn_menu_page;
else
  rpn_menu_page=rpn_menu.size()/6;
show_rpn_menu(rpn_menu_page);}
          tooltip {Previous menu page} xywh {40 515 25 30} shortcut 0xffc7 color 7 labelcolor 1 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F1_Key {
          callback {rpn_button(Xcas_F1_Key,0);}
          xywh {65 515 45 30} shortcut 0xffbe color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F2_Key {
          callback {rpn_button(Xcas_F2_Key,1);}
          xywh {110 515 45 30} shortcut 0xffbf color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F3_Key {
          callback {rpn_button(Xcas_F3_Key,2);}
          xywh {155 515 45 30} shortcut 0xffc0 color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F4_Key {
          callback {rpn_button(Xcas_F4_Key,3);}
          xywh {200 515 45 30} shortcut 0xffc1 color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F5_Key {
          callback {rpn_button(Xcas_F5_Key,4);}
          xywh {245 515 45 30} shortcut 0xffc2 color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_F6_Key {
          callback {rpn_button(Xcas_F6_Key,5);}
          xywh {290 515 45 30} shortcut 0xffc3 color 8 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_NXT_Key {
          label {>>}
          callback {if ( ((rpn_menu_page+1)*6) < rpn_menu.size() )
   ++rpn_menu_page;
else
   rpn_menu_page=0;
show_rpn_menu(rpn_menu_page);}
          tooltip {Next menu page} xywh {335 515 25 30} shortcut 0xffc4 color 7 labelcolor 1 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_CST_Key {
          label cust
          callback {giac::gen e=giac::protecteval(giac::CST__IDNT_e,2,Xcas_get_context());
  if (e.type==giac::_VECT){
    rpn_menu=*e._VECTptr;
    show_rpn_menu(0);
  }}
          tooltip {Custom menu} xywh {390 515 30 30} shortcut 0xffc8 color 7 labelcolor 4 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_VAR_Key {
          label var
          callback {const giac::context * contextptr=Xcas_get_context();
giac::gen e=giac::_VARS(1,contextptr);
    rpn_menu=*e._VECTptr;
    show_rpn_menu(0);}
          tooltip {Show list of variables} xywh {360 515 30 30} shortcut 0xffc5 color 7 labelcolor 4 align 64
          class {xcas::No_Focus_Button}
        }
        Fl_Button Xcas_Home_button {
          label home
          callback {rpn_menu=home_menu;
show_rpn_menu(0);}
          tooltip {Home menu} xywh {0 515 40 30} shortcut 0xffc6 color 7 labelcolor 1 align 64
          class {xcas::No_Focus_Button}
        }
      }
      Fl_Button Xcas_close_bandeau {
        label X
        callback {Xcas_Keyboard_Switch(4);}
        xywh {420 515 35 30} color 17 labelsize 10
        class {xcas::No_Focus_Button}
      }
    }
    Fl_Group Xcas_Messages {open
      xywh {0 545 775 45}
    } {
      Fl_Scroll Xcas_Messages_Scroll {open
        xywh {0 545 755 45}
      } {
        Fl_Output Xcas_parse_error_output {
          tooltip Messages xywh {0 545 755 45} type Multiline labelfont 2
          class {xcas::Enlargable_Multiline_Output}
        }
      }
      Fl_Button Xcas_close_messages {
        label X
        callback {Xcas_Messages->hide();
Xcas_resize_mainwindow();}
        xywh {755 545 20 25} color 17 labelsize 10
        class {xcas::No_Focus_Button}
      }
    }
  }
  Fl_Window Xcas_General_Setup {
    label {Xcas General Setup} open
    xywh {349 164 305 345} type Double hide resizable
  } {
    Fl_Menu_Button Xcas_Level {
      label Level
      tooltip {Choose user level (from tortue to university)} xywh {170 15 130 25} align 64 when 3
    } {
      MenuItem Xcas_CAS_level {
        label CAS
        callback {xcas_user_level=0;
Xcas_update_mode();
Xcas_level_output->value("University");}
        xywh {15 15 100 20}
      }
      MenuItem Xcas_Prog_level {
        label {Program CAS}
        callback {xcas_user_level=1;
Xcas_update_mode();
Xcas_level_output->value(gettext("CAS"));}
        xywh {25 25 100 20}
      }
      MenuItem Xcas_Tableur_level {
        label Spreadsheet
        callback {xcas_user_level=2;
Xcas_update_mode();
Xcas_level_output->value(gettext("Tableur"));}
        xywh {35 35 100 20}
      }
      MenuItem Xcas_Geometry_level {
        label Geometry
        callback {xcas_user_level=3;
Xcas_update_mode();
Xcas_level_output->value(gettext("Geometry"));}
        xywh {45 45 100 20}
      }
      MenuItem Xcas_Tortue_level {
        label Turtle
        callback {xcas_user_level=8;
Xcas_update_mode();
Xcas_level_output->value("Tortue");}
        xywh {55 55 100 20}
      }
    }
    Fl_Output Xcas_level_output {
      label Size
      xywh {170 40 130 25} labeltype NO_LABEL align 68
    }
    Fl_Check_Button Xcas_automatic_help_browser {
      label {Auto HTML help}
      tooltip {Selecting a menu item displays fulls help in browser} xywh {10 105 160 25} down_box DOWN_BOX align 84
    }
    Fl_Input Xcas_html_browser {
      label browser
      callback {const char * ch =Xcas_html_browser->value();
                 xcas::use_external_browser=false;
                unsetenv("BROWSER");
                 if (strlen(ch) && strcmp(ch,"builtin")){
                   setenv("BROWSER",ch,1);
                   xcas::use_external_browser=true;
                  }}
      xywh {100 75 195 25} align 68 when 8
    }
    Fl_Value_Input Xcas_default_rows {
      label rows
      callback {xcas::Flv_Table_Gen::def_rows=int(Xcas_default_rows->value());}
      tooltip {Number of rows for new->spreadsheet} xywh {245 175 55 30} align 68 maximum 1000 step 1 value 40
    }
    Fl_Value_Input Xcas_default_cols {
      label cols
      callback {xcas::Flv_Table_Gen::def_cols=int(Xcas_default_cols->value());}
      tooltip {Number of columns for new->spreadsheet} xywh {245 210 55 30} align 68 maximum 100 step 1 value 10
    }
    Fl_Return_Button Xcas_general_setup_save {
      label Save
      callback {Xcas_General_Setup->hide();
const char * ch =Xcas_html_browser->value();
                 xcas::use_external_browser=false;
                unsetenv("BROWSER");
                 if (strlen(ch) && strcmp(ch,"builtin")){
                   setenv("BROWSER",ch,1);
                   xcas::use_external_browser=true;
                  }
Xcas_save_config(Xcas_get_context());}
      tooltip {Close window and save as default configuration} xywh {15 315 125 25} align 64
    }
    Fl_Button Xcas_general_setup_close {
      label Close
      callback {Xcas_General_Setup->hide();}
      xywh {175 315 125 25} shortcut 0xff1b align 64
    }
    Fl_Group Print_config {open
      xywh {5 145 295 165}
    } {
      Fl_Menu_Button Xcas_Page_format {
        label {Print format}
        tooltip {Printer page format} xywh {10 145 165 30} align 64 when 3 textsize 10
      } {
        MenuItem Xcas_Page_A4 {
          label A4
          callback {\#ifdef FL_DEVICE
xcas::printer_format=Fl_Printer::A4;
\#endif
Xcas_Page_Format_Output->value("A4");}
          xywh {35 35 100 20}
        }
        MenuItem Xcas_Page_A5 {
          label A5
          callback {\#ifdef FL_DEVICE
xcas::printer_format=Fl_Printer::A5;
\#endif
Xcas_Page_Format_Output->value("A5");}
          xywh {35 35 100 20}
        }
        MenuItem Xcas_Page_A3 {
          label A3
          callback {\#ifdef FL_DEVICE
xcas::printer_format=Fl_Printer::A5;
\#endif
Xcas_Page_Format_Output->value("A3");}
          xywh {45 45 100 20}
        }
        MenuItem Xcas_Page_LETTER {
          label LETTER
          callback {\#ifdef FL_DEVICE
xcas::printer_format=Fl_Printer::LETTER;
\#endif
Xcas_Page_Format_Output->value("LETTER");}
          xywh {55 55 100 20}
        }
        MenuItem Xcas_Page_ENVELOPE {
          label ENVELOPE
          callback {\#ifdef FL_DEVICE
xcas::printer_format=Fl_Printer::ENVELOPE;
\#endif
Xcas_Page_Format_Output->value("8");}
          xywh {65 65 100 20}
        }
      }
      Fl_Output Xcas_Page_Format_Output {
        label Format
        xywh {10 175 165 30} labeltype NO_LABEL align 68
      }
      Fl_Check_Button Xcas_Printer_landscape {
        label Landscape
        callback {xcas::printer_landscape=Xcas_Printer_landscape->value();}
        tooltip {Landscape or Portrait} xywh {10 210 165 25} down_box DIAMOND_DOWN_BOX color 51 selection_color 1 align 84
      }
      Fl_Input Xcas_ps_preview {
        label {PS view}
        callback {setenv("GIAC_PREVIEW",Xcas_ps_preview->value(),1);}
        tooltip {Postscript previewer program (put no for no preview)} xywh {70 245 105 30} align 68
      }
      Fl_Input Xcas_proxy {
        label Proxy
        callback {setenv("http_proxy",Xcas_proxy->value(),1);}
        tooltip {Proxy server for update, e.g. http://cache.domain:3128} xywh {70 280 230 30} align 68
      }
    }
    Fl_Button Xcas_All_Fonts {
      label Font
      callback {cb_Xcas_change_fontsize(0,0);}
      xywh {15 15 110 25}
    }
    Fl_Check_Button Xcas_automatic_completion_browser {
      label {Auto index help}
      callback {xcas::do_helpon=Xcas_automatic_completion_browser->value();}
      tooltip {Selecting a menu item displays short index help} xywh {180 105 125 25} down_box DOWN_BOX align 84
    }
    Fl_Check_Button Xcas_stepbystep {
      label {Step by step}
      callback {giac::step_infolevel(Xcas_get_context())=Xcas_stepbystep->value();}
      tooltip {If not checked, save context information, incompatible with Xcas < 0.8.1} xywh {180 245 125 25} down_box DOWN_BOX align 84
    }
    Fl_Check_Button Xcas_tooltip_disabled {
      label {Disable tooltips}
      callback {Fl_Tooltip::enable(!Xcas_tooltip_disabled->value());}
      tooltip {Check box to disable tooltips} xywh {180 145 125 25} down_box DOWN_BOX align 84
    }
    Fl_Check_Button Xcas_disable_try_parse_test_i {
      label {Disable test i}
      callback {giac::try_parse_i(0)=giac::try_parse_i(xcas::get_context(xcas::Xcas_input_focus))=!Xcas_disable_try_parse_test_i->value();}
      tooltip {Check to disable replacement of i inside loop by a variable} xywh {15 45 110 20} down_box DOWN_BOX align 84
    }
  }
  Fl_Window Xcas_Script_Window {
    label {Xcas Script Window}
    xywh {483 87 540 345} type Double resizable visible
  } {}
  Fl_Window Xcas_DispG_Window_ {
    label {Xcas DispG Window} open
    xywh {483 123 540 550} type Double resizable
    class {xcas::DispG_Window} visible
  } {
    Fl_Menu_Bar Xcas_DispG_Menu {
      xywh {0 0 95 25} align 64
    } {
      Submenu {} {
        label Print open
        xywh {0 0 100 20}
      } {
        MenuItem {} {
          label Preview
          callback {xcas::widget_ps_print(Xcas_DispG_,"DispG",true,3,true,true,true);}
          xywh {0 0 100 20}
        }
        MenuItem {} {
          label Print
          callback {xcas::widget_print(Xcas_DispG_);}
          xywh {0 0 100 20}
        }
        MenuItem {} {
          label {LaTeX preview}
          callback {latex_save_DispG("DispG.tex"); xcas::xdvi("DispG.tex")}
          xywh {0 0 100 20}
        }
        MenuItem {} {
          label {LaTeX print}
          callback {latex_save_DispG("DispG.tex"); xcas::dvips("DispG.tex")}
          xywh {0 0 100 20}
        }
        MenuItem {} {
          label Close
          callback {Xcas_DispG_Window_->hide();}
          xywh {0 0 100 20}
        }
      }
    }
    Fl_Button Xcas_DispG_Cancel_ {
      label {Click or Cancel}
      callback {Xcas_DispG_->waiting_click=false;Xcas_DispG_->waiting_click_value=giac::undef;}
      tooltip {Click in graph or here to cancel} xywh {220 0 365 25} align 64
    }
    Fl_Tile Xcas_DispG_Tile {open
      xywh {0 25 545 550}
    } {
      Fl_Box Xcas_DispG_ {
        label label
        xywh {0 25 545 320} labeltype NO_LABEL
        class {xcas::Graph2d}
      }
      Fl_Box Xcas_PrintG_ {
        label label
        xywh {0 345 545 205} labeltype NO_LABEL resizable
        class {xcas::Equation}
      }
    }
    Fl_Button Xcas_DispG_ClrGraph {
      label Clear
      callback {Xcas_DispG_->clear(0); Xcas_PrintG_->set_data(giac::gen(giac::makevecteur(giac::string2gen("",false),giac::string2gen("Step by step console",false)),giac::_HIST__VECT));}
      tooltip {Clear DispG graphic} xywh {95 0 125 25} align 64
    }
  }
  code {xcas::Xcas_Main_Window=Xcas_Main_Window_;
xcas::Xcas_DispG=Xcas_DispG_;
giac::my_gprintf=xcas::xcas_gprintf;
Xcas_PrintG_->modifiable=false;
xcas::Xcas_PrintG=Xcas_PrintG_;
xcas::Xcas_DispG_Window=Xcas_DispG_Window_;
xcas::Xcas_DispG_Cancel=Xcas_DispG_Cancel_;
xcas::Xcas_Cancel=0;
xcas::Xcas_help_output=Xcas_parse_error_output;
Xcas_Sinus_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Cosinus_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Tangeant_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Exp_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Ln_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Dix_puissance->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Ln10_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Inverse_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Neg_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_a_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_b_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_c_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_d_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_e_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_f_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_g_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_h_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_i_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_j_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_k_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_l_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_m_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_n_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_o_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_p_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_q_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_r_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_s_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_t_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_u_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_v_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_w_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_x_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_y_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_z_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Inferieur_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Superieur_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Backslash_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Parenthese_ouvrante_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Parenthese_fermante_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Espace_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Point_exclamation_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Crochet_fermant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Crochet_ouvrant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Accolade_ouvrant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Accolade_fermant_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Deux_points_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Equal_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Guillemet_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Souligne_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Diese_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Pi_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Alpha_virgule_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Alpha_point_virgule_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Alpha_quote_key->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Double_quote->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Parentheses->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Brackets->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Crochets->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Quote->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Virgule->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Semi_button->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Sto->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_RPN_space->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Keyboard_rp->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Variable_x->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Variable_y->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Variable_z->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Variable_t->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Un->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Deux->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Trois->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Quatre->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Cinq->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Six->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Sept->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Huit->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Neuf->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Zero->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Point->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_EEX->callback((Fl_Callback *)xcas::Xcas_input_char);
Xcas_Plus->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_Moins->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_Fois->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_Divise->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_Puissance->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_C_mod->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_Keyboard_suchthat->callback((Fl_Callback *)xcas::Xcas_binary_op);
Xcas_help_solve->callback(cb_Assistant_ItemName);
Xcas_help_fsolve->callback(cb_Assistant_ItemName);
Xcas_help_fsolve->callback(cb_Assistant_ItemName);
Xcas_help_proot->callback(cb_Assistant_ItemName);
Xcas_help_linsolve->callback(cb_Assistant_ItemName);
Xcas_help_desolve->callback(cb_Assistant_ItemName);
Xcas_help_odesolve->callback(cb_Assistant_ItemName);
Xcas_help_rsolve->callback(cb_Assistant_ItemName);
Xcas_help_int->callback(cb_Assistant_ItemName);
Xcas_help_diff->callback(cb_Assistant_ItemName);
Xcas_help_limit->callback(cb_Assistant_ItemName);
Xcas_help_ptayl->callback(cb_Assistant_ItemName);
Xcas_help_series->callback(cb_Assistant_ItemName);
Xcas_help_sum->callback(cb_Assistant_ItemName);
Xcas_help_laplace->callback(cb_Assistant_ItemName);
Xcas_help_ilaplace->callback(cb_Assistant_ItemName);
Xcas_help_simplify->callback(cb_Insert_ItemName);
Xcas_help_normal->callback(cb_Insert_ItemName);
Xcas_help_ratnormal->callback(cb_Insert_ItemName);
Xcas_help_factor->callback(cb_Insert_ItemName);
Xcas_help_cfactor->callback(cb_Insert_ItemName);
Xcas_help_partfrac->callback(cb_Insert_ItemName);
Xcas_help_cpartfrac->callback(cb_Insert_ItemName);
Xcas_help_subst->callback(cb_Assistant_ItemName);
Xcas_help_reorder->callback(cb_Assistant_ItemName);
Xcas_help_lin->callback(cb_Insert_ItemName);
Xcas_help_tlin->callback(cb_Insert_ItemName);
Xcas_help_texpand->callback(cb_Insert_ItemName);
Xcas_help_exp2trig->callback(cb_Insert_ItemName);
Xcas_help_trig2exp->callback(cb_Insert_ItemName);
Xcas_help_exp2pow->callback(cb_Insert_ItemName);
Xcas_help_lncollect->callback(cb_Insert_ItemName);
Xcas_help_isprime->callback(cb_Assistant_ItemName);
Xcas_help_ifactor->callback(cb_Insert_ItemName);
Xcas_help_iquo->callback(cb_Assistant_ItemName);
Xcas_help_irem->callback(cb_Assistant_ItemName);
Xcas_help_iabcuv->callback(cb_Assistant_ItemName);
Xcas_help_ichinrem->callback(cb_Assistant_ItemName);
Xcas_help_gcd->callback(cb_Assistant_ItemName);
Xcas_help_lcm->callback(cb_Assistant_ItemName);
Xcas_help_powmod->callback(cb_Assistant_ItemName);
Xcas_help_quo->callback(cb_Assistant_ItemName);
Xcas_help_rem->callback(cb_Assistant_ItemName);
Xcas_help_abcuv->callback(cb_Assistant_ItemName);
Xcas_help_chinrem->callback(cb_Assistant_ItemName);
Xcas_help_pourcent->callback(cb_Assistant_ItemName);
Xcas_help_GF->callback(cb_Assistant_ItemName);
Xcas_help_plotcontour->callback(cb_Assistant_ItemName);
Xcas_help_plotdensity->callback(cb_Assistant_ItemName);
Xcas_help_plotode->callback(cb_Assistant_ItemName);
//Xcas_help_iplotode->callback(cb_Assistant_ItemName);
Xcas_help_plotlist->callback(cb_Assistant_ItemName);
Xcas_help_scatterplot->callback(cb_Assistant_ItemName);
Xcas_help_polygonscatterplot->callback(cb_Assistant_ItemName);
Xcas_help_linear_regression_plot->callback(cb_Assistant_ItemName);
Xcas_help_moustache->callback(cb_Assistant_ItemName);
Xcas_help_histogram->callback(cb_Assistant_ItemName);
Xcas_help_plotstat->callback(cb_Assistant_ItemName);
Xcas_help_plotcdf->callback(cb_Assistant_ItemName);
Xcas_help_baton->callback(cb_Assistant_ItemName);
Xcas_help_camembert->callback(cb_Assistant_ItemName);
Xcas_help_debug->callback(cb_Assistant_ItemName);
Xcas_help_matrix->callback(cb_Assistant_ItemName);
Xcas_help_tran->callback(cb_Assistant_ItemName);
Xcas_help_ker->callback(cb_Assistant_ItemName);
Xcas_help_image->callback(cb_Assistant_ItemName);
Xcas_help_inverse->callback(cb_Assistant_ItemName);
Xcas_help_det->callback(cb_Assistant_ItemName);
Xcas_help_charpoly->callback(cb_Assistant_ItemName);
Xcas_help_egv->callback(cb_Assistant_ItemName);
Xcas_help_egvl->callback(cb_Assistant_ItemName);
Xcas_help_rand->callback(cb_Assistant_ItemName);
Xcas_help_ranm->callback(cb_Assistant_ItemName);
Xcas_help_markov->callback(cb_Assistant_ItemName);
Xcas_help_randmarkov->callback(cb_Assistant_ItemName);
Xcas_help_cdf->callback(cb_Assistant_ItemName);
Xcas_help_icdf->callback(cb_Assistant_ItemName);
Xcas_help_binomial->callback(cb_Assistant_ItemName);
Xcas_help_comb->callback(cb_Assistant_ItemName);
Xcas_help_plotproba->callback(cb_Assistant_ItemName);
Xcas_help_binomial2->callback(cb_Assistant_ItemName);
Xcas_help_negbinomial->callback(cb_Assistant_ItemName);
Xcas_help_normald->callback(cb_Assistant_ItemName);
Xcas_help_normald_icdf2->callback(cb_Assistant_ItemName);
Xcas_help_normalt->callback(cb_Assistant_ItemName);
Xcas_help_studentd_icdf2->callback(cb_Assistant_ItemName);
Xcas_help_studentt->callback(cb_Assistant_ItemName);
Xcas_help_wilcoxont->callback(cb_Assistant_ItemName);
Xcas_help_normald2->callback(cb_Assistant_ItemName);
Xcas_help_poisson->callback(cb_Assistant_ItemName);
Xcas_help_student->callback(cb_Assistant_ItemName);
Xcas_help_fisher->callback(cb_Assistant_ItemName);
Xcas_help_geometric->callback(cb_Assistant_ItemName);
Xcas_help_exponential->callback(cb_Assistant_ItemName);
Xcas_help_uniform->callback(cb_Assistant_ItemName);
Xcas_help_chisquare->callback(cb_Assistant_ItemName);
Xcas_help_chisquare_icdf->callback(cb_Assistant_ItemName);
Xcas_help_chisquaret->callback(cb_Assistant_ItemName);
Xcas_help_kolmogorovd->callback(cb_Assistant_ItemName);
Xcas_help_kolmogorovt->callback(cb_Assistant_ItemName);
Xcas_help_cauchy->callback(cb_Assistant_ItemName);
Xcas_help_weibull->callback(cb_Assistant_ItemName);
Xcas_help_gammad->callback(cb_Assistant_ItemName);
Xcas_help_betad->callback(cb_Assistant_ItemName);

Xcas_help_debug->callback(cb_Assistant_ItemName);

\#ifdef IPAQ
static unsigned char Xcas_racine_carree_bitmap[]={0,0xe0,0x20,0x20,0x10,0x11,0x0a,0x0c}; // {0xc0,0xe0,0xe0,0x60,0x30,0x31,0x1b,0x1e,0x0c};
Fl_Bitmap * Xcas_Racine_carree_image=new Fl_Bitmap(Xcas_racine_carree_bitmap,8,8);
Xcas_Racine_carree->image(Xcas_Racine_carree_image);
\#else
\#ifndef __APPLE__
\#ifndef _HAVE_FL_UTF8_HDR_
Xcas_Keyboard_infinity->label("¥");
Xcas_Keyboard_infinity->labelfont(FL_SYMBOL);
\#endif
\#endif
\#ifdef _HAVE_FL_UTF8_HDR_
Xcas_Greek_key->label("α");
Xcas_Greek_key->labelfont(FL_HELVETICA);
// Xcas_Neg_button->label("-");
Xcas_Neg_button->label("-");
// Xcas_Neg_button->label("−");
Xcas_Neg_button->callback((Fl_Callback* )xcas::Xcas_input_1arg);
Xcas_Superieur->callback((Fl_Callback* )xcas::Xcas_binary_op);
\#else
Xcas_Racine_carree->label("Ö");
Xcas_Racine_carree->labelfont(FL_SYMBOL);
Xcas_approx_key->label("»");
Xcas_approx_key->labelfont(FL_SYMBOL);
\#endif
\#endif} {}
  code {// First take control of signals
signal(SIGINT,giac::ctrl_c_signal_handler);
giac::child_id=1;
giac::print_rewrite_prod_inv=true;
doc_prefix=giac::read_env(giac::context0); // Set giac::language and modes from environment
xcas::read_aide("aide_cas",giac::language(giac::context0));
giac::set_language(giac::language(giac::context0),giac::context0);
// Add spreadsheet menu
Fl_Menu_Item * tmpitem = xcas::Tableur_menu;
xcas::copy_menu(Xcas_main_menu,gettext("Spreadsheet")+std::string("/"),tmpitem);
tmpitem=xcas::Figure_menu;
xcas::copy_menu(Xcas_main_menu,gettext("Geo")+std::string("/"),tmpitem);
tmpitem=xcas::Graph2d3d_menu+1;
xcas::copy_menu(Xcas_main_menu,gettext("Graphic")+std::string("/"),tmpitem);
tmpitem=xcas::Editeur_menu;
xcas::copy_menu(Xcas_main_menu,gettext("Prg")+std::string("/"),tmpitem);
xcas::add_user_menu(Xcas_main_menu,"xcasex",doc_prefix,cb_Insert_Example); // Load User menus
xcas::add_user_menu(Xcas_main_menu,"xcasmenu",doc_prefix,cb_Insert_ItemName); // Load User menus
xcas::menu2rpn_callback=cb_Insert_ItemName;
// Add RPN-like menus, skip the first four items
Fl_Menu_Item * menu_xcas_tmp= (Fl_Menu_Item *)Xcas_main_menu->menu();
for (int i=0;i<6;i++){
 if (menu_xcas_tmp->text)
  xcas::nextfl_menu(menu_xcas_tmp);
}
home_menu.clear();
for (;menu_xcas_tmp->text;){
  giac::gen tmp1=giac::string2gen(menu_xcas_tmp->text,false);
  giac::gen tmp2=xcas::fl_menu2rpn_menu(menu_xcas_tmp);
  if (tmp2.type!=giac::_VECT || !tmp2._VECTptr->empty())
    home_menu.push_back(giac::makevecteur(tmp1,tmp2));
  ++menu_xcas_tmp;
}
rpn_menu=home_menu;
int ii=home_menu.size();
/*
int n=Xcas_Bandeau_Keys->find(Xcas_RPN1_button),c=Xcas_Bandeau_Keys->children();
for (int i=0;i<ii && n+i<c;++i){
  giac::gen tmp=home_menu[i];
  if (tmp.type==giac::_VECT && tmp._VECTptr->size()==2 && tmp._VECTptr->back().type==giac::_VECT){
    rpnn_menu[i]=*tmp._VECTptr->back()._VECTptr;
    rpnn_menu_string[i]=giac::gen2string(tmp._VECTptr->front());
    Xcas_Bandeau_Keys->child(n+i)->label(rpnn_menu_string[i].c_str());
  }
}
*/
// try for localisation
if (!getenv("LANG")){
  if (std::string(Xcas_Main_Window_->label())=="Xcas Nouvelle Interface"){
    giac::set_language(1,giac::context0);
    giac::html_help_init("aide_cas",1);
  }
}
// add here redefinition of interactive functions
giac::__click.op=&xcas::Xcas_fltk_input;
giac::__input.op=&xcas::Xcas_fltk_inputform;
giac::__inputform.op=&xcas::Xcas_fltk_inputform;
giac::__interactive.op=&xcas::Xcas_fltk_interactive;
giac::__widget_size.op=&Xcas_widget_size;
giac::__getKey.op=&xcas::Xcas_fltk_getKey;
//__keyboard.op=&fltk_keyboard;
giac::__current_sheet.op=&xcas::Xcas_fltk_current_sheet;
giac::__Row.op=&xcas::Xcas_fltk_Row;
giac::__Col.op=&xcas::Xcas_fltk_Col;
giac::__xyztrange.op=&xcas::Xcas_xyztrange;
giac::MAX_PRINTABLE_ZINT=3200;
//fl_widget_delete_function=&fltk_fl_widget_delete_function;
//fl_widget_archive_function=&fltk_fl_widget_archive_function;
//fl_widget_unarchive_function=&fltk_fl_widget_unarchive_function;
//fl_widget_texprint_function=&fltk_fl_widget_texprint_function;
//fl_widget_updatepict_function=&fltk_fl_widget_updatepict_function;
giac::protected_read_config(giac::context0); // read xcas.rc
xcas::read_recent_filenames(Xcas_main_menu); 
xcas::Xcas_load_filename=load_filename;
giac::secure_run=false;
xcas::interrupt_button=true;
xcas::Keyboard_Switch=Xcas_Keyboard_Switch;
int nargs=0;
int argstart=Fl::args(argc,argv,nargs);
Xcas_Main_Window_->show(argc,argv);
Fl_Group::current(Xcas_Script_Window);
xcas::Editeur * t = new xcas::Editeur(0,0,Xcas_Script_Window->w(),Xcas_Script_Window->h());
Xcas_Script_Window->add(t);
Xcas_Script_Window->hide();
Xcas_update_mode();
//Xcas_parse_error_output->resize(Xcas_parse_error_output->x(),Xcas_parse_error_output->y(),Xcas_parse_error_output->w(),10*Xcas_parse_error_output->textsize());
xcas::initialize_function=load_autorecover_data;
xcas::alt_ctrl_cb=Xcas_alt_ctrl_cb;
Fl::add_idle(xcas::Xcas_idle_function,0);
xcas::idle_function=Xcas_update_mode;
Xcas_Page_Format_Output->value("A4");
if (getenv("GIAC_PREVIEW")) Xcas_ps_preview->value(getenv("GIAC_PREVIEW"));
xcas::Xcas_update_mode_ptr=Xcas_update_mode;
xcas::Xcas_save_config_ptr=Xcas_save_config;
Fl_Tooltip::delay(0.2); // hoverdelay may be defined too
// Now load files from commandline
fl_font(FL_HELVETICA,Xcas_Main_Window_->labelsize());
a_propos();
show_rpn_menu(0);
if (argc>argstart){
  bool link=false;
  if (!strcmp(argv[argstart],"--online")){
    link=true; ++argstart; 
  }
  for (int i=argstart;i<argc;++i){
    load_filename(argv[i],false);
    if (link){
      std::string html5="http://www-fourier.univ-grenoble-alpes.fr/~parisse/xcasfr.html\#"+xcas::widget_html5(Xcas_current_session()); std::cout << html5 << std::endl; giac::system_browser_command(html5);
    }
  }
  if (link){
    return 0;
  }
}
else make_history();
  giac::python_compat(0,giac::context0);  // otherwise factor(x^4-4,sqrt(2)) fails if pari is disabled
  bool running=true;
\#ifdef WIN32
  static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (win"+giac::print_INT_(8*sizeof(long))+")";
\#else
\#ifdef __APPLE__ 
  static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (osx"+giac::print_INT_(8*sizeof(long))+")";
\#else
  static std::string windowname=std::string("Xcas ")+GIAC_VERSION+" (linux"+giac::print_INT_(8*sizeof(long))+")";
\#endif
\#endif
  Xcas_Main_Window_->label(windowname.c_str());
  while (running){
    while (Xcas_Main_Window_->visible() || Xcas_Main_Window_->shown() ) {
      Fl::wait();
    }
    running=!Xcas_save_all(Xcas_Main_Tab);
    if (running) Xcas_Main_Window_->show();
  }
  return 0;} {}
} 

Function {main(int argc,char ** argv)} {open return_type int
} {
  code {if (argc==2 && strlen(argv[1])==0)
  argc=1;
if (getenv("XCAS_AUTOSAVE_FOLDER")){
  xcas::autosave_folder=getenv("XCAS_AUTOSAVE_FOLDER");
  if (!xcas::autosave_folder.empty() && xcas::autosave_folder[xcas::autosave_folder.size()-1]!='/')
    xcas::autosave_folder += '/';
}
\#if defined WIN32 || defined __APPLE__
static std::string arg0;
if (!getenv("XCAS_ROOT")){
\#ifdef __APPLE__
  setenv("XCAS_ROOT","/Applications/usr/bin/",1);
\#else
  arg0=xcas::unix_path(argv[0]);
  int s=arg0.size(),i;
  for (i=s-1;i>0;--i){
    if (arg0[i]=='/')
      break;
  }
  arg0=arg0.substr(0,i);
  if (i>0)
    setenv("XCAS_ROOT",arg0.c_str(),1);
\#endif
}
\#endif
\#ifdef HAVE_LIBGSL //
   std::cerr << "GSL error handler off" << std::endl;
    gsl_set_error_handler_off();
\#endif //
xcas_argc=argc; xcas_argv=argv;
\#ifdef HAVE_LIBPTHREAD //
Fl::lock(); 
\#ifdef __APPLE__
//chdir(giac::home_directory().c_str());
if (xcas::autosave_folder.empty())
xcas::autosave_folder=giac::home_directory();
//Fl::unlock();
\#endif
\#endif //
Fl::gl_visual(FL_RGB | FL_DEPTH | FL_ACCUM | FL_ALPHA);
xcas::fonts_available=Fl::set_fonts(0);
fl_register_images();
Xcas_run(argc,argv);
\#ifdef WITH_GNUPLOT
giac::kill_gnuplot();
\#endif
if (update_xcas){
\#ifdef WIN32
// chdir(getenv("XCAS_ROOT"));
// system("./bash.exe update.sh &");
fl_message("%s",gettext("Please close this window and run update.bat in the Xcas installation directory"));
\#else
\#ifdef __APPLE__
system("cd ~ && rm -f ~/Desktop/xcas_osx6.dmg.gz && open http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/xcas_osx6.dmg.gz &");
\#else
if (giac::is_file_available("/usr/bin/xcas")){
  if (giac::is_file_available("/usr/bin/apt-get"))
    system("xterm -e 'sudo apt-get update ; sudo apt-get install giac'");
  else
\#ifdef __x86_64__ 
    system("xterm -e 'rm -f giac64.rpm && wget http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/giac64.rpm && sudo rpm -e giac && sudo rpm -U gia64c.rpm'");    
\#else
    system("xterm -e 'rm -f giac32.rpm && wget http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/giac32.rpm && sudo rpm -e giac && sudo rpm -U giac32.rpm'");    
\#endif
}
else {
  if (giac::is_file_available("/usr/local/bin/xcas")){
    system("cd /tmp && wget http://www-fourier.univ-grenoble-alpes.fr/~parisse/giac/xcas.tgz && cd /usr/local && xterm -e 'sudo tar xvfz tmp/xcas.tgz' &");
  }
  else
    fl_alert("%s","Update implemented only for debian/rpm packages");
}
\#endif // __APPLE__
\#endif // __WIN32__
}} {}
} 
