]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/FormMathsDelim.C
Yet another tweak from J�rgen.
[lyx.git] / src / frontends / xforms / FormMathsDelim.C
index 0ac0034a489c280090cb99febe94bc13afcbbe72..b5bb49bac6a6dc5edc3df11eccc4cd01d48169a7 100644 (file)
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 /**
  * \file FormMathsDelim.C
  * Copyright 2001 The LyX Team.
@@ -22,7 +21,7 @@
 #include "LyXView.h"
 #include "bmtable.h"
 #include "debug.h"
-#include "mathed/symbol_def.h"
+#include "support/lstrings.h"
 #include "lyxfunc.h"
 
 #include "delim.xbm"
@@ -32,18 +31,18 @@ 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 };
  
-static int delim_values[] = {
-       '(', ')', LM_lceil,  LM_rceil,  LM_uparrow,  LM_Uparrow,
-       '[', ']', LM_lfloor,  LM_rfloor,  LM_updownarrow, LM_Updownarrow,
-       '{', '}',  '/', LM_backslash,  LM_downarrow,  LM_Downarrow,
-       LM_langle,  LM_rangle, '|', LM_Vert, '.', 0
+static char const * delim_values[] = {
+       "(", ")", "lceil",  "rceil",  "uparrow",  "Uparrow",
+       "[", "]", "lfloor", "rfloor", "updownarrow", "Updownarrow",
+       "{", "}",  "/", "\\",  "downarrow",  "Downarrow",
+       "langle",  "rangle", "|", "Vert", ".", 0
 };
 
 using std::endl;
 
 FormMathsDelim::FormMathsDelim(LyXView * lv, Dialogs * d, 
                               FormMathsPanel const & p)
-       : FormMathsSub(lv, d, p, _("Maths Delimiters"))
+       : FormMathsSub(lv, d, p, _("Maths Delimiters"), false)
 {}
 
 
@@ -63,6 +62,7 @@ void FormMathsDelim::build()
        fl_set_pixmap_data(dialog_->button_pix, const_cast<char**>(delim0));
        dialog_->radio_left->u_ldata = 0;
        dialog_->radio_right->u_ldata = 1;
+       dialog_->radio_both->u_ldata = 2;
  
        fl_set_bmtable_data(dialog_->bmtable, 6, 4,
                            delim_width, delim_height, delim_bits);
@@ -75,6 +75,7 @@ void FormMathsDelim::build()
        bc().addReadOnly(dialog_->bmtable);
        bc().addReadOnly(dialog_->radio_right);
        bc().addReadOnly(dialog_->radio_left);
+       bc().addReadOnly(dialog_->radio_both);
        bc().addReadOnly(dialog_->button_pix);
 }
 
@@ -84,10 +85,10 @@ void FormMathsDelim::apply()
        int const left = int(dialog_->radio_left->u_ldata);
        int const right= int(dialog_->radio_right->u_ldata);
 
-       std::ostringstream ost;
+       ostringstream ost;
        ost << delim_values[left] << ' ' << delim_values[right];
 
-       lv_->getLyXFunc()->Dispatch(LFUN_MATH_DELIM, ost.str().c_str());
+       lv_->getLyXFunc()->dispatch(LFUN_MATH_DELIM, ost.str().c_str());
 }
 
 bool FormMathsDelim::input(FL_OBJECT *, long)
@@ -98,9 +99,10 @@ bool FormMathsDelim::input(FL_OBJECT *, long)
 
        int const i = fl_get_bmtable(dialog_->bmtable);
        int const button = fl_get_bmtable_numb(dialog_->bmtable);
-       bool const both = (button == FL_MIDDLE_MOUSE);
+       bool const both = (button == FL_MIDDLE_MOUSE) 
+                       || (fl_get_button(dialog_->radio_both) != 0);
        
-       if (i>= 0) {
+       if (i >= 0) {
                if (side || (button == FL_RIGHT_MOUSE))
                        right = i;
                else {