3 * \file FormMathsDeco.C
4 * Copyright 2001 The LyX Team.
5 * See the file COPYING.
7 * \author Alejandro Aguilar Sierra
8 * \author Pablo De Napoli, pdenapo@dm.uba.ar
9 * \author John Levon, moz@compsoc.man.ac.uk
10 * \author Angus Leeming, a.leeming@ic.ac.uk
16 #pragma implementation
19 #include "FormMathsDeco.h"
20 #include "form_maths_deco.h"
27 static char const * decoration_names[] = {
28 "widehat", "widetilde", "overbrace", "overleftarrow", "overrightarrow",
29 "overline", "underbrace", "underline"
33 static int const nr_decoration_names = sizeof(decoration_names) / sizeof(char const *);
35 FormMathsDeco::FormMathsDeco(LyXView * lv, Dialogs * d,
36 FormMathsPanel const & p)
37 : FormMathsSub(lv, d, p, _("Maths Decorations"))
41 FL_FORM * FormMathsDeco::form() const
49 void FormMathsDeco::build()
51 dialog_.reset(build_maths_deco());
53 fl_set_bmtable_data(dialog_->bmtable, 3, 3,
54 deco_width, deco_height, deco_bits);
55 fl_set_bmtable_maxitems(dialog_->bmtable, 8);
57 bc().setCancel(dialog_->button_cancel);
58 bc().addReadOnly(dialog_->bmtable);
62 void FormMathsDeco::apply()
64 int const i = fl_get_bmtable(dialog_->bmtable);
66 if (i >= nr_decoration_names)
69 parent_.insertSymbol(decoration_names[i]);