]> git.lyx.org Git - features.git/commitdiff
Portability fixes; crash fix with external templates; small things
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 13 Jun 2000 17:10:47 +0000 (17:10 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 13 Jun 2000 17:10:47 +0000 (17:10 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@814 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
lib/examples/decimal.lyx [new file with mode: 0644]
sigc++/object.cc
src/frontends/.cvsignore
src/frontends/xforms/input_validators.c
src/frontends/xforms/input_validators.h
src/insets/ExternalTemplate.C

index a1ad739a1ca5760a5c567786481c2382919f34f5..198d7db07acec05ba0135ea38ef971c115a74d11 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2000-06-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
+       * lib/examples/decimal.lyx: new example file from Mike.
+
+       * src/insets/ExternalTemplate.C (readTemplates): Use LibFileSearch()
+       to find template definitions (from Dekel)
+
+       * src/frontends/.cvsignore: add a few things.
+
+       * src/frontends/xforms/input_validators.[ch]: remove C++ comments.
+
        * src/Timeout.C (TimeOut): remove default argument.
 
        * src/LyXView.C (LyXView_AutosaveTimerCB): this should not have
diff --git a/lib/examples/decimal.lyx b/lib/examples/decimal.lyx
new file mode 100644 (file)
index 0000000..98d96e7
--- /dev/null
@@ -0,0 +1,157 @@
+#LyX 1.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 2.16
+\textclass article
+\begin_preamble
+\usepackage{dcolumn}
+\newcolumntype{d}[1]{D{.}{.}{#1}}
+\end_preamble
+\language default
+\inputencoding latin1
+\fontscheme default
+\graphics default
+\paperfontsize default
+\spacing single 
+\papersize Default
+\paperpackage a4
+\use_geometry 0
+\use_amsmath 0
+\paperorientation portrait
+\secnumdepth 3
+\tocdepth 3
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\quotes_times 2
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+
+\layout Title
+
+A Better Decimal-Alignment Solution
+\layout Standard
+
+An alternative way to have decimal alignment in tables is through the dcolumn
+ package.
+ Add the following to the LateX preamble:
+\layout LyX-Code
+
+
+\backslash 
+usepackage{dcolumn} 
+\layout LyX-Code
+
+
+\backslash 
+newcolumntype{d}[1]{D{.}{.}{#1}}
+\layout Standard
+
+To have a column decimally aligned, enter in the 
+\family sans 
+Special Column Alignment
+\family default 
+ box of the 
+\family sans 
+Table extra
+\family default 
+ form the following:
+\layout LyX-Code
+
+d{number of decimals of the data}
+\layout Standard
+
+In the following table we entered 
+\family typewriter 
+d{4}
+\family default 
+:
+\layout Standard
+\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \LyXTable
+multicol5
+5 2 0 0 -1 -1 -1 -1
+0 1 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0
+0 0 0 0
+8 0 0 "" ""
+4 1 0 "" "d{4}"
+0 8 1 0 0 0 0 "" ""
+1 8 0 1 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+1 4 0 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+0 8 1 0 0 0 0 "" ""
+
+Expression
+\newline 
+Value 
+\newline 
+
+\begin_inset Formula \( \pi  \)
+\end_inset 
+
+
+\newline 
+3.1416
+\newline 
+
+\begin_inset Formula \( \pi ^{\pi } \)
+\end_inset 
+
+
+\newline 
+36.462
+\newline 
+
+\begin_inset Formula \( (\pi ^{\pi })^{\pi } \)
+\end_inset 
+
+
+\newline 
+80663.
+\newline 
+
+\begin_inset Formula \( \pi ^{\pi ^{\pi }} \)
+\end_inset 
+
+
+\newline 
+1.3402e18
+\layout Standard
+
+To create extra column space just increase the number of decimals in 
+\family typewriter 
+d{}
+\family default 
+.
+ Setting the multicolumn attribute for a single cell makes it insensitive
+ to the decimal alignment which comes in handy as well.
+ A drawback of this method is that math mode is not allowed in a column
+ with decimal alignment except if the multicolumn attribute is set.
+\layout Standard
+
+This method offers the same flexibility as the 
+\family typewriter 
+dcolumn
+\family default 
+ package.
+ One could, for example, change the alignment separator, and have different
+ alignment separators for different columns by defining multiple column
+ types in the preamble.
+ The syntax is as follows: 
+\layout LyX-Code
+
+D{inputsep}{outputsep}{decimal places}
+\layout Standard
+
+The interested reader is directed towards the 
+\family typewriter 
+dcolumn
+\family default 
+ package documentation for more details.
+\the_end
index 06d4439b2aee923c9a272123f48fe6da04ebe0fe..ec21351b482605670ff6c4cd65b9408ba99deae6 100644 (file)
@@ -72,7 +72,7 @@ void ObjectReferenced::unreference()
 void ObjectScoped::register_data(ScopeNode *data)
   {
    list_.insert_direct(list_.end(),data);
-  };
+  }
 
 void ObjectScoped::register_scope(Scope *scope,const Scope *parent)
   {
index 282522db0342d8750454b3dc162493b5fc709cc8..e732222ccf3f60453cc1ea2342a3175217e53d98 100644 (file)
@@ -1,2 +1,6 @@
 Makefile
 Makefile.in
+*.deps
+*.lo
+.libs
+libfrontends.la
index 0b8fd9a09bd3f5b381df3488d49f77cd658f040f..d63f0facdb9b3aaaf265ac434f3bf18a05f60f06 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /* input_validators.C
  * A collection of input filtering and validating functions for use in
  * XForms popups.  Mainly meant for filtering input boxes although may
@@ -19,9 +18,9 @@ int fl_unsigned_int_filter(FL_OBJECT * ob,
                           char const * unused,
                           int c)
 {
-       if (c == 0 // final test before handing contents to app
+       if (c == 0 /* final test before handing contents to app */
            || strchr("0123456789", c)) {
-               // since we only accept numerals then it must be valid
+               /* since we only accept numerals then it must be valid */
                return FL_VALID;
        }
        return FL_INVALID|FL_RINGBELL;
@@ -29,36 +28,36 @@ int fl_unsigned_int_filter(FL_OBJECT * ob,
 
 
 #if 0
-// I've just moved this code here and written a few comments.
-// still to complete it.  ARRae 20000518
-//
+/* I've just moved this code here and written a few comments.
+   still to complete it.  ARRae 20000518 */
+
 void fl_print_range_filter(FL_OBJECT * ob,
                           char const * not_used,
                           char const * unused,
                           int c)
 {
-       // Started life as changes to PrintApplyCB by Stephan Witt
-       //  (stephan.witt@beusen.de), 19-Jan-99
-       // User may give a page (range) list
+       /* Started life as changes to PrintApplyCB by Stephan Witt
+          (stephan.witt@beusen.de), 19-Jan-99
+          User may give a page (range) list */
 
        if (strchr("0123456789", c)) {
-               // Numerals are always valid
+               /* Numerals are always valid */
                return FL_VALID;
        } else if (strchr("-,", c)) {
-               // make sure that the character can go there
+               /* make sure that the character can go there */
        } else if (c == 0) {
-               // final test before handing contents to app
-               // make sure the last char isn't a "-,"
-               // That might be acceptable if there was a "to_page"
-               // entry however if you start making a page range in the "from"
-               // field you can do it all in the "from" field.  That is, a
-               // range in the "from" field immmediately blanks the "to" 
-               // field.
+               /* final test before handing contents to app
+                  make sure the last char isn't a "-,"
+                  That might be acceptable if there was a "to_page"
+                  entry however if you start making a page range in the "from"
+                  field you can do it all in the "from" field.  That is, a
+                  range in the "from" field immmediately blanks the "to" 
+                  field. */
        }
        return FL_INVALID|FL_RINGBELL;
 
-       // The code above should do the same sort of checking as the
-       // code below.
+       /* The code above should do the same sort of checking as the
+          code below. */
 
        string pages = subst(fl_get_input(fd_form_print->input_pages), ';',',');
        pages = subst(pages, '+',',');
index c8c55d33da44c721050d90490e90867ac9f13641..462cf7313ce14a13accd4470261920fe7be7a3fd 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /* This file is part of
  * ====================================================== 
  *
@@ -25,7 +24,7 @@ extern "C"
 {
 #endif
 
-/// Only allow whole numbers no '+' or '-' signs or exponents.
+  /** Only allow whole numbers no '+' or '-' signs or exponents. */
 int fl_unsigned_int_filter(FL_OBJECT *, char const *, char const *, int);
 
 #if defined(__cplusplus)
index 3251d0e99b78a5de2c4f2137c5a6c4a5d0112639..9637544a7cf95ba57aa99c179baf58694a31eb3f 100644 (file)
@@ -138,8 +138,14 @@ void ExternalTemplateManager::readTemplates(string const & path)
                { "templateend", TM_END }
        };
 
+       string filename = LibFileSearch("", "external_templates");
+       if (filename.empty()) {
+               lyxerr << "No template file" << endl;
+               return;
+       }
+
        LyXLex lex(templatetags, TM_END);
-       if (!lex.setFile("external_templates")) {
+       if (!lex.setFile(filename)) {
                lyxerr << "No template file" << endl;
                return;
        }