]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsStyle.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / FormMathsStyle.C
index 155dbb9b4c35ed02078541eb4cdf9a02d2f23b42..48c486dae2f0915cee6d0082ee13273d29d4fff1 100644 (file)
@@ -8,25 +8,28 @@
  * \author John Levon
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  * Adapted from FormMathsSpace martin.vermeer@hut.fi
  */
 
 #include <config.h>
 
-
 #include "FormMathsStyle.h"
 #include "forms/form_maths_style.h"
 #include "ControlMath.h"
 #include "xformsBC.h"
 
+#include "lyx_forms.h"
 #include "bmtable.h"
 
-#include FORMS_H_LOCATION
-
 #include "style.xbm"
 #include "font.xbm"
 
+namespace lyx {
+namespace frontend {
+
+namespace {
+
 char const * latex_mathstyle[] = {
        "displaystyle", "textstyle", "scriptstyle", "scriptscriptstyle"
 };
@@ -36,11 +39,13 @@ kb_action latex_mathfontcmds[] = {
        LFUN_NOUN, LFUN_FRAK, LFUN_EMPH, LFUN_FREEFONT_APPLY, LFUN_DEFAULT
 };
 
+} // namespace anon
+
 
-typedef FormCB<ControlMathSub, FormDB<FD_maths_style> > base_class;
+typedef FormController<ControlMath, FormView<FD_maths_style> > base_class;
 
-FormMathsStyle::FormMathsStyle()
-       : base_class(_("Maths Styles & Fonts"), false),
+FormMathsStyle::FormMathsStyle(Dialog & parent)
+       : base_class(parent, _("Math Styles & Fonts"), false),
          style_(-1)
 {}
 
@@ -76,7 +81,7 @@ void FormMathsStyle::build()
 void FormMathsStyle::apply()
 {
        if ((style_ >= 0) && (style_ < 4))
-               controller().insertSymbol(latex_mathstyle[style_]);
+               controller().dispatchInsert(latex_mathstyle[style_]);
        else if ((style_ >= 4) && (style_ < 14))
                controller().dispatchFunc(latex_mathfontcmds[style_-4]);
 }
@@ -96,3 +101,6 @@ ButtonPolicy::SMInput FormMathsStyle::input(FL_OBJECT * ob, long data)
 
        return ButtonPolicy::SMI_VALID;
 }
+
+} // namespace frontend
+} // namespace lyx