2 * \file FormMathsDeco.C
3 * Copyright 2001 The LyX Team.
4 * See the file COPYING.
6 * \author Alejandro Aguilar Sierra
7 * \author Pablo De Napoli, pdenapo@dm.uba.ar
8 * \author John Levon, moz@compsoc.man.ac.uk
9 * \author Angus Leeming, a.leeming@ic.ac.uk
15 #pragma implementation
18 #include "FormMathsDeco.h"
19 #include "form_maths_deco.h"
26 static char const * decoration_names[] = {
27 "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
28 "overline", "underbrace", "underline",
29 "hat", "acute", "bar", "dot",
30 "check", "grave", "vec", "ddot",
35 static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
37 FormMathsDeco::FormMathsDeco(LyXView * lv, Dialogs * d,
38 FormMathsPanel const & p)
39 : FormMathsSub(lv, d, p, _("Maths Decorations & Accents"), false)
43 FL_FORM * FormMathsDeco::form() const
51 void FormMathsDeco::build()
53 dialog_.reset(build_maths_deco());
55 fl_set_bmtable_data(dialog_->bmtable_deco1, 3, 3,
56 deco1_width, deco1_height, deco1_bits);
57 fl_set_bmtable_maxitems(dialog_->bmtable_deco1, 8);
59 fl_set_bmtable_data(dialog_->bmtable_deco2, 4, 3,
60 deco2_width, deco2_height, deco2_bits);
61 fl_set_bmtable_maxitems(dialog_->bmtable_deco2, 10);
63 bc().setCancel(dialog_->button_cancel);
64 bc().addReadOnly(dialog_->bmtable_deco1);
65 bc().addReadOnly(dialog_->bmtable_deco2);
69 void FormMathsDeco::apply()
71 //int const i = fl_get_bmtable(dialog_->bmtable_deco1);
73 if (deco_ >= nr_decoration_names)
76 parent_.insertSymbol(decoration_names[deco_]);
79 bool FormMathsDeco::input(FL_OBJECT * ob, long)
81 deco_ = fl_get_bmtable(ob);
82 if (deco_ < 0) return false;
83 //if (ob == dialog_->bmtable_deco1) deco_ += 0;
84 if (ob == dialog_->bmtable_deco2) deco_ += 8;