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 "FormMathsDeco.h"
21 #include "forms/form_maths_deco.h"
23 #include FORMS_H_LOCATION
28 static char const * decoration_names[] = {
29 "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
30 "overline", "underbrace", "underline", "underleftarrow", "underrightarrow",
31 "underleftrightarrow", "overleftrightarrow",
32 "hat", "acute", "bar", "dot",
33 "check", "grave", "vec", "ddot",
38 static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
40 FormMathsDeco::FormMathsDeco(LyXView & lv, Dialogs & d,
41 FormMathsPanel const & p)
42 : FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
46 FL_FORM * FormMathsDeco::form() const
54 void FormMathsDeco::build()
56 dialog_.reset(build_maths_deco(this));
58 fl_set_bmtable_data(dialog_->bmtable_deco1, 3, 4,
59 deco1_width, deco1_height, deco1_bits);
60 fl_set_bmtable_maxitems(dialog_->bmtable_deco1, 12);
62 fl_set_bmtable_data(dialog_->bmtable_deco2, 4, 3,
63 deco2_width, deco2_height, deco2_bits);
64 fl_set_bmtable_maxitems(dialog_->bmtable_deco2, 10);
66 bc().setCancel(dialog_->button_close);
67 bc().addReadOnly(dialog_->bmtable_deco1);
68 bc().addReadOnly(dialog_->bmtable_deco2);
72 void FormMathsDeco::apply()
74 if (deco_ < nr_decoration_names)
75 parent_.insertSymbol(decoration_names[deco_]);
79 bool FormMathsDeco::input(FL_OBJECT * ob, long)
81 deco_ = fl_get_bmtable(ob);
84 //if (ob == dialog_->bmtable_deco1)
86 if (ob == dialog_->bmtable_deco2)