From 9e3610c75f8ceeebb8e59db2c641f21082979856 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 25 Apr 2000 01:57:51 +0000 Subject: Bug fixes where I was getting the value from the input field instead of the global pointer (caused random crashes.) Now default to no file variable for catgets() mode, and declare and initialize (as needed) a static _catalog variable when a global file variable is not provided. The catalog name is the basename of the fluid file (no .fl)... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@1084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/code.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'fluid/code.cxx') diff --git a/fluid/code.cxx b/fluid/code.cxx index d1ffcde91..fbed3ab3a 100644 --- a/fluid/code.cxx +++ b/fluid/code.cxx @@ -1,5 +1,5 @@ // -// "$Id: code.cxx,v 1.9.2.4 2000/04/24 18:22:50 mike Exp $" +// "$Id: code.cxx,v 1.9.2.5 2000/04/25 01:57:51 mike Exp $" // // Code output routines for the Fast Light Tool Kit (FLTK). // @@ -285,14 +285,16 @@ int write_code(const char *s, const char *t) { } write_declare("#include "); - if (i18n_type && i18n_include_input->value()[0]) { - if (i18n_include_input->value()[0] != '<' && - i18n_include_input->value()[0] != '\"') - write_c("#include \"%s\"\n", i18n_include_input->value()); + if (i18n_type && i18n_include[0]) { + if (i18n_include[0] != '<' && + i18n_include[0] != '\"') + write_c("#include \"%s\"\n", i18n_include); else - write_c("#include %s\n", i18n_include_input->value()); - if (i18n_type == 2) - write_c("extern nl_catd %s;\n", i18n_file_input->value()); + write_c("#include %s\n", i18n_include); + if (i18n_type == 2) { + if (i18n_file[0]) write_c("extern nl_catd %s;\n", i18n_file); + else write_c("static nl_catd _catalog = (nl_catd)-1;\n"); + } } if (t && include_H_from_C) write_c("#include \"%s\"\n", filename_name(t)); @@ -367,7 +369,7 @@ int write_strings(const char *sfile) { msgnum = 1; fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n", FL_VERSION); - fprintf(fp, "$set %s\n", i18n_set_input->value()); + fprintf(fp, "$set %s\n", i18n_set); fputs("$quote \"\n", fp); for (p = Fl_Type::first; p; p = p->next) { @@ -397,5 +399,5 @@ void Fl_Type::write_code1() { void Fl_Type::write_code2() {} // -// End of "$Id: code.cxx,v 1.9.2.4 2000/04/24 18:22:50 mike Exp $". +// End of "$Id: code.cxx,v 1.9.2.5 2000/04/25 01:57:51 mike Exp $". // -- cgit v1.2.3