]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsDelim.C
Yet more dialog tweaking from Rob.
[lyx.git] / src / frontends / xforms / FormMathsDelim.C
index 4d87e976f30717a03a9ad055b227b0b59a4541ad..36d00877240abf07573cc69390118e2c24b1523f 100644 (file)
@@ -1,12 +1,14 @@
 /**
  * \file FormMathsDelim.C
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
  * \author Alejandro Aguilar Sierra
- * \author Pablo De Napoli, pdenapo@dm.uba.ar
- * \author John Levon, moz@compsoc.man.ac.uk
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Pablo De Napoli
+ * \author John Levon
+ * \author Angus Leeming 
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
 #endif
 
 #include "FormMathsDelim.h"
-#include "form_maths_delim.h"
-#include "Dialogs.h"
-#include "frontends/LyXView.h"
+#include "forms/form_maths_delim.h"
+
 #include "bmtable.h"
+
 #include "debug.h"
-#include "support/lstrings.h"
+#include "funcrequest.h"
 #include "lyxfunc.h"
 
+#include "frontends/LyXView.h"
+
+#include "support/lstrings.h"
+
+#include "Lsstream.h"
+
+#include FORMS_H_LOCATION
+
 #include "delim.xbm"
 #include "delim0.xpm"
 #include "delim1.xpm"
 
+
 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 };
+       13,13,14,15,16,17,19,19,20,21,22,23
+};
+
 
 static char const * delim_values[] = {
        "(", ")", "lceil",  "rceil",  "uparrow",  "Uparrow",
@@ -41,7 +54,7 @@ static char const * delim_values[] = {
 
 using std::endl;
 
-FormMathsDelim::FormMathsDelim(LyXView * lv, Dialogs * d,
+FormMathsDelim::FormMathsDelim(LyXView & lv, Dialogs & d,
                               FormMathsPanel const & p)
        : FormMathsSub(lv, d, p, _("Maths Delimiters"), false)
 {}
@@ -57,7 +70,7 @@ FL_FORM * FormMathsDelim::form() const
 
 void FormMathsDelim::build()
 {
-       dialog_.reset(build_maths_delim());
+       dialog_.reset(build_maths_delim(this));
 
        fl_set_button(dialog_->radio_left, 1);
        // Initialize button_pix to "()" as found in images/delim0.xpm:
@@ -66,7 +79,7 @@ void FormMathsDelim::build()
        dialog_->radio_right->u_ldata = 1;
        //dialog_->radio_both->u_ldata = 2;
 
-       fl_set_bmtable_data(dialog_->bmtable, 6, 4,
+       fl_set_bmtable_data(dialog_->bmtable, 12, 2,
                            delim_width, delim_height, delim_bits);
        fl_set_bmtable_maxitems(dialog_->bmtable, 23);
 
@@ -84,15 +97,16 @@ void FormMathsDelim::build()
 
 void FormMathsDelim::apply()
 {
-       int const left = int(dialog_->radio_left->u_ldata);
-       int const right= int(dialog_->radio_right->u_ldata);
+       int const left  = int(dialog_->radio_left->u_ldata);
+       int const right = int(dialog_->radio_right->u_ldata);
 
-       ostringstream ost;
-       ost << delim_values[left] << ' ' << delim_values[right];
+       ostringstream os;
+       os << delim_values[left] << ' ' << delim_values[right];
 
-       lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, ost.str().c_str());
+       lv_.dispatch(FuncRequest(LFUN_MATH_DELIM, os.str().c_str()));
 }
 
+
 bool FormMathsDelim::input(FL_OBJECT *, long)
 {
        int left = int(dialog_->radio_left->u_ldata);
@@ -129,8 +143,8 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
        Pixmap p1;
        fl_get_pixmap_pixmap(dialog_->button_pix, &p1, 0);
        
-       fl_draw_bmtable_item(dialog_->bmtable, left, p1, -2, 0);
-       fl_draw_bmtable_item(dialog_->bmtable, right, p1, 14, 0);
+       fl_draw_bmtable_item(dialog_->bmtable, left, p1, 0, 0);
+       fl_draw_bmtable_item(dialog_->bmtable, right, p1, 16, 0);
        fl_redraw_object(dialog_->button_pix);
 
        dialog_->radio_left->u_ldata  = left;