]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsMatrix.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormMathsMatrix.C
index 10541873a85b3e4564bc923c386e16a856f29412..9a12b1684acf67535fd45c76a4a170fe2c0d6d74 100644 (file)
@@ -8,26 +8,27 @@
  * \author John Levon
  * \author Angus Leeming
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
-
 #include "FormMathsMatrix.h"
 #include "forms/form_maths_matrix.h"
 #include "ControlMath.h"
+
 #include "xformsBC.h"
-#include "ButtonController.h"
 
-#include "support/LAssert.h"
+#include "controllers/ButtonController.h"
+
 #include "support/lyxalgo.h" // lyx::count
 
-#include "Lsstream.h"
+#include "lyx_forms.h"
+
+#include "support/std_sstream.h"
 
-#include FORMS_H_LOCATION
 
-#include <algorithm>
+using std::ostringstream;
 
 #ifndef CXX_GLOBAL_CSTD
 using std::strlen;
@@ -44,20 +45,20 @@ extern "C" {
        int C_FormMathsMatrixAlignFilter(FL_OBJECT * ob, char const *,
                                         char const * cur, int c)
        {
-               lyx::Assert(ob);
+               BOOST_ASSERT(ob);
                FormMathsMatrix * pre =
                        static_cast<FormMathsMatrix *>(ob->u_vdata);
-               lyx::Assert(pre);
+               BOOST_ASSERT(pre);
                return pre->AlignFilter(cur, c);
        }
 
 }
 
 
-typedef FormCB<ControlMathSub, FormDB<FD_maths_matrix> > base_class;
+typedef FormController<ControlMath, FormView<FD_maths_matrix> > base_class;
 
-FormMathsMatrix::FormMathsMatrix()
-       : base_class(_("Maths Matrix"), false)
+FormMathsMatrix::FormMathsMatrix(Dialog & parent)
+       : base_class(parent, _("Math Matrix"), false)
 {}
 
 
@@ -65,7 +66,8 @@ void FormMathsMatrix::build()
 {
        dialog_.reset(build_maths_matrix(this));
 
-       fl_addto_choice(dialog_->choice_valign, _("Top | Center | Bottom"));
+       fl_addto_choice(dialog_->choice_valign,
+                       _("Top | Middle | Bottom").c_str());
        fl_set_choice(dialog_->choice_valign, 2);
        fl_set_input(dialog_->input_halign, h_align_str);
        dialog_->input_halign->u_vdata = this;
@@ -93,7 +95,7 @@ void FormMathsMatrix::apply()
 
        ostringstream os;
        os << nx << ' ' << ny << ' ' << c << ' ' << sh;
-       controller().dispatchFunc(LFUN_INSERT_MATRIX, STRCONV(os.str()));
+       controller().dispatchMatrix(os.str());
 }