]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsSpace.C
change some __GNUG_ to __GNUG__
[lyx.git] / src / frontends / xforms / FormMathsSpace.C
1 /**
2  * \file FormMathsSpace.C
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
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
10  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "FormMathsSpace.h"
19 #include "form_maths_space.h"
20
21 extern char * latex_mathspace[];
22
23 FormMathsSpace::FormMathsSpace(LyXView * lv, Dialogs * d,
24                                FormMathsPanel const & p)
25         : FormMathsSub(lv, d, p, _("Maths Spacing"), false),
26           space_(-1)
27 {}
28
29
30 FL_FORM * FormMathsSpace::form() const
31 {
32         if (dialog_.get())
33                 return dialog_->form;
34         return 0;
35 }
36
37
38 void FormMathsSpace::build()
39 {
40         dialog_.reset(build_maths_space());
41
42         space_ = -1;
43
44         bc().setCancel(dialog_->button_close);
45
46         bc().addReadOnly(dialog_->button_thin);
47         bc().addReadOnly(dialog_->button_medium);
48         bc().addReadOnly(dialog_->button_thick);
49         bc().addReadOnly(dialog_->button_negative);
50         bc().addReadOnly(dialog_->button_quadratin);
51         bc().addReadOnly(dialog_->button_twoquadratin);
52 }
53
54
55 void FormMathsSpace::apply()
56 {
57         if (space_ >= 0)
58                 parent_.insertSymbol(latex_mathspace[space_]);
59 }
60
61 bool FormMathsSpace::input(FL_OBJECT *, long data)
62 {
63         space_ = -1;
64
65         if (data >= 0 && data < 6) {
66                 space_ = short(data);
67                 apply();
68         }
69         return true;
70 }