#include "form_maths_delim.h"
#include "Dialogs.h"
#include "LyXView.h"
-#include "lyxfunc.h"
#include "bmtable.h"
#include "debug.h"
-#include "mathed/symbol_def.h"
+#include "support/lstrings.h"
+#include "lyxfunc.h"
#include "delim.xbm"
#include "delim0.xpm"
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)
{}
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);
bc().addReadOnly(dialog_->bmtable);
bc().addReadOnly(dialog_->radio_right);
bc().addReadOnly(dialog_->radio_left);
+ bc().addReadOnly(dialog_->radio_both);
bc().addReadOnly(dialog_->button_pix);
-
- bc().refresh();
}
void FormMathsDelim::apply()
{
- int left = int(dialog_->radio_left->u_ldata);
- int 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);
- 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)
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 {