2 * \file FormMathsDeco.C
3 * See the file COPYING.
5 * \author Alejandro Aguilar Sierra
6 * \author Pablo De Napoli
8 * \author Angus Leeming
10 * Full author contact details are available in file CREDITS
16 #pragma implementation
19 #include "FormMathsDeco.h"
20 #include "forms/form_maths_deco.h"
22 #include FORMS_H_LOCATION
27 static char const * decoration_names[] = {
28 "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
29 "overline", "underbrace", "underline", "underleftarrow", "underrightarrow",
30 "underleftrightarrow", "overleftrightarrow",
31 "hat", "acute", "bar", "dot",
32 "check", "grave", "vec", "ddot",
37 static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
39 FormMathsDeco::FormMathsDeco(LyXView & lv, Dialogs & d,
40 FormMathsPanel const & p)
41 : FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
45 FL_FORM * FormMathsDeco::form() const
53 void FormMathsDeco::build()
55 dialog_.reset(build_maths_deco(this));
57 fl_set_bmtable_data(dialog_->bmtable_deco1, 3, 4,
58 deco1_width, deco1_height, deco1_bits);
59 fl_set_bmtable_maxitems(dialog_->bmtable_deco1, 12);
61 fl_set_bmtable_data(dialog_->bmtable_deco2, 4, 3,
62 deco2_width, deco2_height, deco2_bits);
63 fl_set_bmtable_maxitems(dialog_->bmtable_deco2, 10);
65 bc().setCancel(dialog_->button_close);
66 bc().addReadOnly(dialog_->bmtable_deco1);
67 bc().addReadOnly(dialog_->bmtable_deco2);
71 void FormMathsDeco::apply()
73 if (deco_ < nr_decoration_names)
74 parent_.insertSymbol(decoration_names[deco_]);
78 bool FormMathsDeco::input(FL_OBJECT * ob, long)
80 deco_ = fl_get_bmtable(ob);
83 //if (ob == dialog_->bmtable_deco1)
85 if (ob == dialog_->bmtable_deco2)