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"
25 static char const * decoration_names[] = {
26 "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
27 "overline", "underbrace", "underline"
30 static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
32 FormMathsDeco::FormMathsDeco(LyXView * lv, Dialogs * d,
33 FormMathsPanel const & p)
34 : FormMathsSub(lv, d, p, _("Maths Decorations"))
38 FL_FORM * FormMathsDeco::form() const
46 void FormMathsDeco::build()
48 dialog_.reset(build_maths_deco());
50 fl_set_bmtable_data(dialog_->bmtable, 3, 3,
51 deco_width, deco_height, deco_bits);
52 fl_set_bmtable_maxitems(dialog_->bmtable, 8);
54 bc().setCancel(dialog_->button_cancel);
55 bc().addReadOnly(dialog_->bmtable);
60 void FormMathsDeco::apply()
62 int const i = fl_get_bmtable(dialog_->bmtable);
64 if (i >= nr_decoration_names)
67 parent_.insertSymbol(decoration_names[i]);