2 * \file FormMathsDeco.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
7 * \author Pablo De Napoli
9 * \author Angus Leeming
11 * Full author contact details are available in file CREDITS
17 #pragma implementation
20 #include "ControlMath.h"
21 #include "FormMathsDeco.h"
22 #include "forms/form_maths_deco.h"
26 #include FORMS_H_LOCATION
31 typedef FormCB<ControlMathSub, FormDB<FD_maths_deco> > base_class;
33 FormMathsDeco::FormMathsDeco()
34 : base_class(_("Maths Decorations & Accents"), false)
38 void FormMathsDeco::build()
40 dialog_.reset(build_maths_deco(this));
42 fl_set_bmtable_data(dialog_->bmtable_deco1, 3, 4,
43 deco1_width, deco1_height, deco1_bits);
44 fl_set_bmtable_maxitems(dialog_->bmtable_deco1, 12);
46 fl_set_bmtable_data(dialog_->bmtable_deco2, 4, 3,
47 deco2_width, deco2_height, deco2_bits);
48 fl_set_bmtable_maxitems(dialog_->bmtable_deco2, 10);
50 bc().setCancel(dialog_->button_close);
51 bc().addReadOnly(dialog_->bmtable_deco1);
52 bc().addReadOnly(dialog_->bmtable_deco2);
56 void FormMathsDeco::apply()
58 if (deco_ < nr_latex_deco)
59 controller().insertSymbol(latex_deco[deco_]);
63 ButtonPolicy::SMInput FormMathsDeco::input(FL_OBJECT * ob, long)
65 deco_ = fl_get_bmtable(ob);
67 return ButtonPolicy::SMI_INVALID;
68 //if (ob == dialog_->bmtable_deco1)
70 if (ob == dialog_->bmtable_deco2)
73 return ButtonPolicy::SMI_VALID;