]> git.lyx.org Git - lyx.git/commitdiff
Martin's latest math dialog patch using LFUNs.
authorAngus Leeming <leeming@lyx.org>
Thu, 10 Jan 2002 16:47:03 +0000 (16:47 +0000)
committerAngus Leeming <leeming@lyx.org>
Thu, 10 Jan 2002 16:47:03 +0000 (16:47 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3331 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/LyXAction.C
src/commandtags.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormMathsPanel.h
src/frontends/xforms/FormMathsStyle.C
src/mathed/ChangeLog
src/mathed/formulabase.C
src/mathed/math_support.C

index b9aaf44572a772e5115aaed9046ed6353a481cf4..54c59f98f5391d348d9f37fd5a90d86b9ff6458d 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-10  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * commandtags.h:
+       * LyXAction.C: two new LFUNS, LFUN_FRAK and LFUN_ITAL.
+
 2002-01-10  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * lyxrc.[Ch]: change names and descriptions of popup font variables to
index dd15b2ee5e4fbf7625e12e0cdf07b7118c7aab55..26b5459413113f2473bdc5d25a354b81791636b2 100644 (file)
@@ -210,6 +210,8 @@ void LyXAction::init()
                { LFUN_ROMAN, "font-roman", N_("Toggle roman font style"),
                  Noop },
                { LFUN_SANS, "font-sans", N_("Toggle sans font style"), Noop },
+               { LFUN_FRAK, "font-frak", N_("Toggle fraktur font style"), Noop },
+               { LFUN_ITAL, "font-ital", N_("Toggle italic font style"), Noop },
                { LFUN_FONT_SIZE, "font-size", N_("Set font size"), Noop },
                { LFUN_FONT_STATE, "font-state", N_("Show font state"),
                  ReadOnly },
index 9a68f354bb809d6e56acaa4245c5f018471dae69..62ffb4b8346185af555395b99fd6afd0a24825e9 100644 (file)
@@ -59,6 +59,8 @@ enum kb_action {
        LFUN_BOLD,
        LFUN_ROMAN,
        LFUN_NOUN,
+       LFUN_ITAL,
+       LFUN_FRAK,
        LFUN_RIGHT,
        LFUN_LEFT,  // 40
        LFUN_UP,
index 45d41f131594cb4ed2b7558fb258d814421d4660..81c8626a812cfe26295b52c74487ae4c374b987b 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-10  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * FormMathsPanel.[Ch] (dispatchFunc): new method. Invokes
+       LyXFunc::dispatch.
+
+       * FormMathsStyle.C (apply): use LFUNs to apply, not insertSymbol.
+
 2002-01-10  Angus Leeming  <a.leeming@ic.ac.uk>
 
        * FormPreferences.C:
index 149b235529508ff69d3cd5419fbd3c8a8fa5a081..cc44f170b62b3fbbd2cc772d61ccaddd8814acb5 100644 (file)
@@ -301,6 +301,10 @@ void FormMathsPanel::insertSymbol(string const & sym) const
        lv_->getLyXFunc()->dispatch(LFUN_INSERT_MATH, '\\' + sym);
 }
 
+void FormMathsPanel::dispatchFunc(string const & funcode) const
+{
+       lv_->getLyXFunc()->dispatch(funcode);
+}
 
 void FormMathsPanel::mathDisplay() const
 {
index 77245cdbc4d1275c7a11715ae87911f5085e4126..a6c0d96de02ab3a2efad30f198853a259aa08c34 100644 (file)
@@ -63,7 +63,8 @@ public:
        void setActive(FormMathsSub *) const;
        /// dispatch a symbol insert 
        void insertSymbol(string const & sym) const;
-
+       /// dispatch an LFUN:
+       void dispatchFunc(string const & funcode) const;
 private:
        /// Pointer to the actual instantiation of the ButtonController.
        virtual xformsBC & bc();
index 37c73ece85a4fc9c26358fa6ceacba43066d9a9f..50ed4959ea568d353671c3b2df5c52347309bffa 100644 (file)
@@ -20,6 +20,7 @@
 #include "form_maths_style.h"
 
 extern char * latex_mathstyle[];
+extern char * latex_mathfontcmds[];
 
 FormMathsStyle::FormMathsStyle(LyXView * lv, Dialogs * d,
                               FormMathsPanel const & p)
@@ -66,8 +67,10 @@ void FormMathsStyle::build()
 
 void FormMathsStyle::apply()
 {
-       if (style_ >= 0)
+       if ( (style_ >= 0) && (style_ < 4) )
                parent_.insertSymbol(latex_mathstyle[style_]);
+       else
+               parent_.dispatchFunc(latex_mathfontcmds[style_ - 4]);
 }
 
 bool FormMathsStyle::input(FL_OBJECT *, long data)
index 495f1af737d25502054ac0bea6b382f1705f3982..bd7ca57973660a2eeeac59cd7ba4629d7c48539e 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-10  Martin Vermeer  <martin.vermeer@hut.fi>
+
+       * formulabase.C (localDispatch): handle LFUN_FRAK and LFUN_ITAL.
+
+       * math_support.C: separate  string arrays for math style and for
+       font commands.
+
 2002-01-10  Dekel Tsur  <dekelts@tau.ac.il>
 
        * math_parser.C (parse_normal): Support for \begin{math}
index 3eb3d1eceaf844de197abaab9b065e532e11d59d..94b3a8569a57f4d019e1e689485272810f99e461 100644 (file)
@@ -368,7 +368,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        hideInsetCursor(bv);
 
        mathcursor->normalize();
-
        switch (action) {
 
                // --- Cursor Movements ---------------------------------------------
@@ -517,6 +516,8 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        case LFUN_EMPH:         handleFont(bv, LM_TC_CAL); break;
        case LFUN_ROMAN:        handleFont(bv, LM_TC_RM); break;
        case LFUN_CODE:         handleFont(bv, LM_TC_TT); break;
+       case LFUN_FRAK:         handleFont(bv, LM_TC_EUFRAK); break;
+       case LFUN_ITAL:         handleFont(bv, LM_TC_IT); break;
        case LFUN_NOUN:         handleFont(bv, LM_TC_BB); break;
        case LFUN_DEFAULT:      handleFont(bv, LM_TC_VAR); break;
        case LFUN_FREE:         handleFont(bv, LM_TC_TEXTRM); break;
index 14c37c95c552540227253498569cef8c431c3af8..5ef9bc8bdef5cbb1affeb18c2147ad3b50000d9a 100644 (file)
@@ -777,9 +777,12 @@ char const * latex_mathspace[] = {
 
 
 char const * latex_mathstyle[] = {
-       "textstyle", "displaystyle", "scriptstyle", "scriptscriptstyle", 
-       "mathbf", "mathcal","mathrm","mathtt", "mathsf", "mathit",
-       "mathbb","mathfrak", "textrm", "mathnormal"
+       "textstyle", "displaystyle", "scriptstyle", "scriptscriptstyle" 
+};
+
+char const * latex_mathfontcmds[] = {
+       "font-bold", "font-emph", "font-roman", "font-code", "font-sans",
+       "font-ital", "font-noun", "font-frak", "font-free", "font-default"
 };