]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsSpace.C
Really dull and boring header shit
[lyx.git] / src / frontends / xforms / FormMathsSpace.C
1 /**
2  * \file FormMathsSpace.C
3  * See the file COPYING.
4  *
5  * \author Alejandro Aguilar Sierra
6  * \author Pablo De Napoli
7  * \author John Levon
8  * \author Angus Leeming 
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include "FormMathsSpace.h"
20 #include "forms/form_maths_space.h"
21 #include FORMS_H_LOCATION
22
23 extern char * latex_mathspace[];
24
25 FormMathsSpace::FormMathsSpace(LyXView & lv, Dialogs & d,
26                                FormMathsPanel const & p)
27         : FormMathsSub(lv, d, p, _("Maths Spacing"), false),
28           space_(-1)
29 {}
30
31
32 FL_FORM * FormMathsSpace::form() const
33 {
34         if (dialog_.get())
35                 return dialog_->form;
36         return 0;
37 }
38
39
40 void FormMathsSpace::build()
41 {
42         dialog_.reset(build_maths_space(this));
43
44         space_ = -1;
45
46         bc().setCancel(dialog_->button_close);
47
48         bc().addReadOnly(dialog_->button_thin);
49         bc().addReadOnly(dialog_->button_medium);
50         bc().addReadOnly(dialog_->button_thick);
51         bc().addReadOnly(dialog_->button_negative);
52         bc().addReadOnly(dialog_->button_quadratin);
53         bc().addReadOnly(dialog_->button_twoquadratin);
54 }
55
56
57 void FormMathsSpace::apply()
58 {
59         if (space_ >= 0)
60                 parent_.insertSymbol(latex_mathspace[space_]);
61 }
62
63 bool FormMathsSpace::input(FL_OBJECT *, long data)
64 {
65         space_ = -1;
66
67         if (data >= 0 && data < 6) {
68                 space_ = short(data);
69                 apply();
70         }
71         return true;
72 }