]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsDelim.C
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormMathsDelim.C
index 743dab08173c95155595122732aa510648b8bc15..442711a3e7661cb5813b3abecb55d7e53998379c 100644 (file)
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
 
 #include "FormMathsDelim.h"
 #include "forms/form_maths_delim.h"
+#include "ControlMath.h"
+#include "xformsBC.h"
+#include "ButtonController.h"
 
 #include "bmtable.h"
 
-#include "debug.h"
-#include "funcrequest.h"
-#include "lyxfunc.h"
-
-#include "frontends/LyXView.h"
-
 #include "support/lstrings.h"
 
 #include "Lsstream.h"
@@ -40,8 +34,8 @@
 
 
 static int const delim_rversion[] = {
-       1,1,3,3,4,5,7,7,9,9,10,11,
-       13,13,14,15,16,17,19,19,20,21,22,23
+1,1,3,3,4,5,7,7,9,9,10,11,
+
 };
 
 
@@ -54,18 +48,12 @@ static char const * delim_values[] = {
 
 using std::endl;
 
-FormMathsDelim::FormMathsDelim(LyXView & lv, Dialogs & d,
-                              FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Delimiters"), false)
-{}
 
+typedef FormCB<ControlMathSub, FormDB<FD_maths_delim> > base_class;
 
-FL_FORM * FormMathsDelim::form() const
-{
-       if (dialog_.get())
-               return dialog_->form;
-       return 0;
-}
+FormMathsDelim::FormMathsDelim()
+       : base_class(_("Maths Delimiters"), false)
+{}
 
 
 void FormMathsDelim::build()
@@ -83,15 +71,15 @@ void FormMathsDelim::build()
                            delim_width, delim_height, delim_bits);
        fl_set_bmtable_maxitems(dialog_->bmtable, 23);
 
-       bc().setOK(dialog_->button_ok);
-       bc().setApply(dialog_->button_apply);
-       bc().setCancel(dialog_->button_close);
+       bcview().setOK(dialog_->button_ok);
+       bcview().setApply(dialog_->button_apply);
+       bcview().setCancel(dialog_->button_close);
 
-       bc().addReadOnly(dialog_->bmtable);
-       bc().addReadOnly(dialog_->radio_right);
-       bc().addReadOnly(dialog_->radio_left);
-       bc().addReadOnly(dialog_->radio_both);
-       bc().addReadOnly(dialog_->button_pix);
+       bcview().addReadOnly(dialog_->bmtable);
+       bcview().addReadOnly(dialog_->radio_right);
+       bcview().addReadOnly(dialog_->radio_left);
+       bcview().addReadOnly(dialog_->radio_both);
+       bcview().addReadOnly(dialog_->button_pix);
 }
 
 
@@ -102,11 +90,17 @@ void FormMathsDelim::apply()
 
        ostringstream os;
        os << delim_values[left] << ' ' << delim_values[right];
-       parent_.dispatchFunc(LFUN_MATH_DELIM, STRCONV(os.str()));
+       controller().dispatchFunc(LFUN_MATH_DELIM, STRCONV(os.str()));
+}
+
+
+void FormMathsDelim::update()
+{
+       bc().valid();
 }
 
 
-bool FormMathsDelim::input(FL_OBJECT *, long)
+ButtonPolicy::SMInput FormMathsDelim::input(FL_OBJECT *, long)
 {
        int left = int(dialog_->radio_left->u_ldata);
        int right= int(dialog_->radio_right->u_ldata);
@@ -149,5 +143,5 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
        dialog_->radio_left->u_ldata  = left;
        dialog_->radio_right->u_ldata = right;
 
-       return true;
+       return ButtonPolicy::SMI_VALID;
 }