]> git.lyx.org Git - features.git/commitdiff
popup fixes from Juergen ; insetgraphics fix from Herbert ; menus fix from Andre...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 13 Nov 2001 14:47:35 +0000 (14:47 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 13 Nov 2001 14:47:35 +0000 (14:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3019 a592a061-630c-0410-9148-cb99ea01b6c8

16 files changed:
lib/ChangeLog
lib/ui/default.ui
src/BufferView_pimpl.C
src/ChangeLog
src/frontends/xforms/ChangeLog
src/frontends/xforms/form_external.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/forms/form_external.fd
src/frontends/xforms/forms/form_graphics.fd
src/insets/ChangeLog
src/insets/inset.h
src/insets/insetgraphics.C
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/paragraph.C
src/text.C

index ad5c0fd27733bd6f3ba53e2d169b945baf09b96b..364eb8f3c5333c151c968a0c5acef8d640c461c1 100644 (file)
@@ -1,3 +1,9 @@
+2001-11-13  André Pönitz  <poenitz@gmx.net>
+
+       * ui/default.ui: create a new Submenu Insert->Math, since placing
+       everything in the main insert menu seems not possible in the long
+       run...
+
 2001-11-08  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * ui/default.ui: move math panel from Edit to Insert.
index 6af054208cdc202365b9d975db22b9848a869e33..9abaf12ea3c28f18c37fde388927e1c462880e26 100644 (file)
@@ -182,14 +182,7 @@ Menuset
 # INSERT MENU
 #
     Menu "insert"
-       Item "Math Formula|h" "math-mode"
-       Item "Display Formula|D" "math-display"
-       Item "Math Panel|l" "math-panel"
-       #Item "Display Formula|D" "math-mode display"
-       #Item "Change to Inline Math Formula|q" "math-mutate simple"
-       #Item "Change to Displayed Math Formula|q" "math-mutate equation"
-       #Item "Change to Eqnarray Environment|q" "math-mutate eqnarray"
-       #Item "Change to Align Environment|g" "math-mutate align"
+        Submenu "Math|h" "insert_math"
        Separator
        Submenu "Special Character|S" "insert_special"
        Item "Citation Reference...|C" "citation-insert"
@@ -229,6 +222,21 @@ Menuset
        Item "Menu Separator|M" "menu-separator-insert"
     End
 
+    Menu "insert_math"
+       Item "Inline Formula|h" "math-mode"
+       Item "Display Formula|D" "math-display"
+       Item "Eqnarray environment|E" "command-sequence math-mode; math-mutate eqnarray;"
+       Item "AMS align environment|A" "command-sequence math-mode; math-mutate align;"
+       Item "AMS alignat environment|t" "command-sequence math-mode; math-mutate alignat;"
+       Item "AMS xalignat environment|x" "command-sequence math-mode; math-mutate xalignat;"
+       Item "AMS xxalignat environment" "command-sequence math-mode; math-mutate xxalignat;"
+  Separator
+       Item "Array environment|y" "math-insert matrix 2 2"
+       Item "Cases environment|C" "math-insert cases 2"
+  Separator
+       Item "Math Panel|l" "math-panel"
+    End
+
     Menu "insert_floats"
        FloatInsert
     End
index 34814ff384dbf94b9dcd0fa18af36980ef492ddc..0a9200cfdb50c1737459db1ef4a57467874a7927 100644 (file)
@@ -3241,19 +3241,23 @@ void BufferView::Pimpl::specialChar(InsetSpecialChar::Kind kind)
 
 void BufferView::Pimpl::smartQuote()
 {
+       LyXText const * lt = bv_->getLyXText();
+       Paragraph const * par = lt->cursor.par();
+       Paragraph::size_type pos = lt->cursor.pos();
        char c;
-       LyXText * lt = bv_->getLyXText();
 
-       if (lt->cursor.pos())
-               c = lt->cursor.par()->getChar(lt->cursor.pos() - 1);
-       else 
+       if (!pos
+           || (par->isInset(pos - 1)
+               && par->getInset(pos - 1)->isSpace()))
                c = ' ';
+       else
+               c = par->getChar(pos - 1);
+               
 
        hideCursor();
 
        LyXLayout const & style = textclasslist.Style(
-               bv_->buffer()->params.textclass,
-               lt->cursor.par()->getLayout());
+               bv_->buffer()->params.textclass, par->getLayout());
        
        if (style.pass_thru ||
                (!insertInset(new InsetQuotes(c, bv_->buffer()->params))))
index 9879aa62fb5f94a54e706db8e7a64dfa013cca7e..8132e4a0341077635aa93a8dc6c7e5213634394d 100644 (file)
@@ -1,3 +1,16 @@
+2001-11-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * text.C (selectNextWordToSpellcheck): do not test explicitely for
+       insets which are part of a word. Paragraph::isLetter takes care of
+       that now. Use Paragraph::isInset to identify insets.
+       (selectSelectedWord): do not test for hyphenation break.
+
+       * BufferView_pimpl.C (smartQuote): use Inset::isSpace, so
+       that protected spaces are considered as spaces.
+
+       * paragraph.C (isLetter): cleanup the code for ispell extras; use
+       Inset::isLetter. 
+
 2001-11-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyxserver.h:
index b7f4fab130779aa0beee0403d4ada7b2b2f7e29d..9f8fbf2323c2211d8ef2eeaa5ae91486e1d92d12 100644 (file)
@@ -1,3 +1,8 @@
+2001-11-13  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
+
+       * forms/form_graphics.fd: fixed shortcut clash
+       * forms/form-external.fd: added shortcut for "Apply"
+
 2001-11-12  John Levon  <moz@compsoc.man.ac.uk>
 
        * FormFiledialog.C: don't reset path if new dir
index ea9e8bbb37c50e89a54f8e2ea3d7a3ddfda0891c..2110fb7146e0812632e49e325dd7113ad500adf1 100644 (file)
@@ -93,7 +93,11 @@ FD_form_external * FormExternal::build_external()
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
     fl_set_object_callback(obj, C_FormBaseOKCB, 0);
-  fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 270, 90, 30, _("Apply"));
+  {
+    char const * const dummy = N_("Apply|#A");
+    fdui->button_apply = obj = fl_add_button(FL_NORMAL_BUTTON, 355, 270, 90, 30, idex(_(dummy)));
+    fl_set_button_shortcut(obj, scex(_(dummy)), 1);
+  }
     fl_set_object_color(obj, FL_COL1, FL_BLACK);
     fl_set_object_lsize(obj, FL_NORMAL_SIZE);
     fl_set_object_gravity(obj, FL_SouthEast, FL_SouthEast);
index 776fc2021c975db2892c3e45f73a0bbc720be043..5c2619cbecdc6e96c6b529143da3a7467008f2d5 100644 (file)
@@ -89,7 +89,7 @@ FD_form_graphics * FormGraphics::build_graphics()
     fl_set_object_callback(obj, C_FormBaseInputCB, 0);
   obj = fl_add_labelframe(FL_ENGRAVED_FRAME, 20, 230, 450, 90, _("Subcaption"));
   {
-    char const * const dummy = N_("Subcaption|#S");
+    char const * const dummy = N_("Subcaption|#u");
     fdui->check_subcaption = obj = fl_add_checkbutton(FL_PUSH_BUTTON, 110, 240, 30, 30, idex(_(dummy)));
     fl_set_button_shortcut(obj, scex(_(dummy)), 1);
   }
index 5168cc6401f30cad698b77dbccb9282ca6de1b21..71ca5971c246c81145bede6318c99308efc1f604 100644 (file)
@@ -202,7 +202,7 @@ alignment: FL_ALIGN_CENTER
 style: FL_NORMAL_STYLE
 size: FL_NORMAL_SIZE
 lcol: FL_BLACK
-label: Apply
+label: Apply|#A
 shortcut: 
 resize: FL_RESIZE_ALL
 gravity: FL_SouthEast FL_SouthEast
index ce5001485a649c6a2926ed4b3f49a7fb706c20f4..fae87e132a8208c4f72d915669938417d23c4555 100644 (file)
@@ -310,7 +310,7 @@ alignment: FL_ALIGN_LEFT
 style: FL_NORMAL_STYLE
 size: FL_DEFAULT_SIZE
 lcol: FL_BLACK
-label: Subcaption|#S
+label: Subcaption|#u
 shortcut: 
 resize: FL_RESIZE_ALL
 gravity: FL_NoGravity FL_NoGravity
index 084358601ee9e51316e5976d4260a598dd6a6011..130f235be2773518f719e092d226a8a53f396c00 100644 (file)
@@ -1,3 +1,15 @@
+2001-11-13  Herbert Voss  <voss@perce.de>
+
+       * insetgraphic.C: fix scale bug
+       
+2001-11-13  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * inset.h (isSpace): 
+       (isLetter): new virtual methods.
+
+       * insetspecialchar.C (isSpace): 
+       (isLetter): implement here.
+
 2001-11-04  John Levon  <moz@compsoc.man.ac.uk>
 
        * inset.h: new inline helpers
index 49e38c05de1ed05762650bbbbe69fd4bf3c368e4..47ef8c9125c1615014a778f17b5e7006ce4aa2ad 100644 (file)
@@ -295,6 +295,12 @@ public:
        // needed for spellchecking text
        ///
        virtual bool allowSpellcheck() { return false; }
+
+       // is this equivalent to a letter?
+       virtual bool isLetter() const { return false; }
+       // is this equivalent to a space?
+       virtual bool isSpace() const { return false; }
+
 protected:
        ///
        mutable int top_x;
index b0d556e9e0a45ad2843429b58df0b82526e2f400..264c83548f3be346732c25f7513683d90d06aa9a 100644 (file)
@@ -514,7 +514,7 @@ void formatResize(ostream & os, string const & key,
                break;
 
        case InsetGraphicsParams::SCALE:
-               os << "scale" << '=' << size << ',';
+               os << "scale" << '=' << size/100 << ',';
        }
 }
 
index 0524855dc050f543e523a4e94337d79f5377ec68..a57eb58f5102814aa7d9b0b3bc46a4c3832f1b24 100644 (file)
@@ -321,3 +321,15 @@ void InsetSpecialChar::validate(LaTeXFeatures & features) const
                features.lyxarrow = true;
        }
 }
+
+
+bool InsetSpecialChar::isLetter() const
+{
+       return kind_ == HYPHENATION || kind_ == LIGATURE_BREAK;
+}
+
+
+bool InsetSpecialChar::isSpace() const
+{
+       return kind_ == PROTECTED_SEPARATOR;
+}
index 6fcad6c89f62714959ede767d1baaef748989926..5acb4e22acfcdc20327610028cb870937bfae6bf 100644 (file)
@@ -82,6 +82,10 @@ public:
        };
        ///
        void validate(LaTeXFeatures &) const;
+       /// is this equivalent to a letter?
+       bool isLetter() const;
+       /// is this equivalent to a space?
+       bool isSpace() const;
 private:
        /// And which kind is this?
        Kind kind_;
index 8dd178d1de7d592ef1e58859b5692ea718ba161c..ece9443eb4b72688caaf3d7d481192d3f1a7d596 100644 (file)
@@ -1878,13 +1878,11 @@ bool Paragraph::isLetter(Paragraph::size_type pos) const
        value_type const c = getChar(pos);
        if (IsLetterChar(c))
                return true;
-       // '\0' is not a letter, allthough every string contains "" (below)
-       if (c == '\0')
-               return false;
+       if (isInset(pos)) 
+               return getInset(pos)->isLetter();
        // We want to pass the ' and escape chars to ispell
        string const extra = lyxrc.isp_esc_chars + '\'';
-       char ch[2] = { c, 0 };
-       return contains(extra, ch);
+       return contains(extra, c);
 }
  
  
index f219950b13eb7c2bdc107cb72fa07ff1bbdb2eb9..2a4d25aff374e63758fb35b8bdcfdb7bc1566018 100644 (file)
@@ -21,7 +21,6 @@
 #include "support/lstrings.h"
 #include "insets/insetbib.h"
 #include "insets/insettext.h"
-#include "insets/insetspecialchar.h"
 #include "lyx_gui_misc.h"
 #include "gettext.h"
 #include "bufferparams.h"
@@ -2365,16 +2364,10 @@ string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
        
        Inset * inset;
 
-       // and find the end of the word 
-       // (optional hyphens are part of a word)
+       // and find the end of the word (insets like optional hyphens
+       // and ligature break are part of a word)
        while (cursor.pos() < cursor.par()->size()
-              && (cursor.par()->isLetter(cursor.pos())) 
-              // assignment is intentional here
-              || ((inset = getInset())
-                  && inset->lyxCode() == Inset::SPECIALCHAR_CODE
-                  && static_cast<InsetSpecialChar *>(inset)->kind()
-                       == InsetSpecialChar::HYPHENATION
-                  ))
+              && (cursor.par()->isLetter(cursor.pos()))) 
                cursor.pos(cursor.pos() + 1);
 
        // Finally, we copy the word to a string and return it
@@ -2382,7 +2375,7 @@ string const LyXText::selectNextWordToSpellcheck(BufferView * bview,
        if (selection.cursor.pos() < cursor.pos()) {
                Paragraph::size_type i;
                for (i = selection.cursor.pos(); i < cursor.pos(); ++i) {
-                       if (cursor.par()->getChar(i) != Paragraph::META_INSET)
+                       if (!cursor.par()->isInset(i))
                                str += cursor.par()->getChar(i);
                }
        }
@@ -2406,13 +2399,7 @@ void LyXText::selectSelectedWord(BufferView * bview)
        
        // now find the end of the word
        while (cursor.pos() < cursor.par()->size()
-              && (cursor.par()->isLetter(cursor.pos())
-                  // assignment is intentional here
-                  || ((inset = getInset())
-                      && inset->lyxCode() == Inset::SPECIALCHAR_CODE
-                      && static_cast<InsetSpecialChar *>(inset)->kind()
-                               == InsetSpecialChar::HYPHENATION
-                      )))
+              && (cursor.par()->isLetter(cursor.pos())))
                cursor.pos(cursor.pos() + 1);
        
        setCursor(bview, cursor.par(), cursor.pos());