]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsSpace.C
Bugfixes: checkboxes to radiobuttons (from J�rgen S) and remove a little
[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         fl_set_button(dialog_->radio_thin, 1);
43         space_ = 1;
44
45         bc().setOK(dialog_->button_ok);
46         bc().setApply(dialog_->button_apply);
47         bc().setCancel(dialog_->button_cancel);
48
49         bc().addReadOnly(dialog_->radio_thin);
50         bc().addReadOnly(dialog_->radio_medium);
51         bc().addReadOnly(dialog_->radio_thick);
52         bc().addReadOnly(dialog_->radio_negative);
53         bc().addReadOnly(dialog_->radio_quadratin);
54         bc().addReadOnly(dialog_->radio_twoquadratin);
55 }
56
57
58 void FormMathsSpace::apply()
59 {
60         if (space_ >= 0)
61                 parent_.insertSymbol(latex_mathspace[space_]);
62 }
63
64 bool FormMathsSpace::input(FL_OBJECT *, long data)
65 {
66         space_ = -1;
67  
68         if (data >= 0 && data < 6) {
69                 space_ = short(data);
70         }
71         return true;
72 }