X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FFormMathsDelim.C;h=b5bb49bac6a6dc5edc3df11eccc4cd01d48169a7;hb=27652900a60fd078f161ce866ddaed21dba21eff;hp=049cfb1a671b8269598372012f7ea8ea9681554f;hpb=8999098e942c66a013b052190617ef48de916dbe;p=lyx.git diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index 049cfb1a67..b5bb49bac6 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -19,10 +19,10 @@ #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" @@ -31,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) {} @@ -62,6 +62,7 @@ void FormMathsDelim::build() fl_set_pixmap_data(dialog_->button_pix, const_cast(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); @@ -74,19 +75,20 @@ 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); } 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) @@ -97,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 {