]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/checkedwidgets.h
Rob's patch, part 1: the checked widget stuff.
[lyx.git] / src / frontends / xforms / checkedwidgets.h
1 // -*- C++ -*-
2 /**
3  * \file checkedwidgets.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef CHECKEDWIDGETS_H
13 #define CHECKEDWIDGETS_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "ButtonControllerBase.h"
20 #include "forms_fwd.h"
21
22 void addCheckedLyXLength(ButtonControllerBase & bc,
23                          FL_OBJECT * input, FL_OBJECT * label = 0);
24
25 void addCheckedGlueLength(ButtonControllerBase & bc,
26                           FL_OBJECT * input, FL_OBJECT * label = 0);
27
28 class CheckedLyXLength : public CheckedWidget {
29 public:
30         /** The label widget's label will be turned red if input
31          *  does not make a valid LyXLength.
32          *  If label == 0, then the label of input will be used.
33          */
34         CheckedLyXLength(FL_OBJECT * input, FL_OBJECT * label = 0);
35
36 private:
37         ///
38         virtual bool check() const;
39
40         ///
41         FL_OBJECT * input_;
42         FL_OBJECT * label_;
43 };
44
45
46 class CheckedGlueLength : public CheckedWidget {
47 public:
48         /** The label widget's label will be turned red if input
49          *  does not make a valid LyXGlueLength.
50          *  If label == 0, then the label of input will be used.
51          */
52         CheckedGlueLength(FL_OBJECT * input, FL_OBJECT * label = 0);
53
54 private:
55         ///
56         virtual bool check() const;
57
58         ///
59         FL_OBJECT * input_;
60         FL_OBJECT * label_;
61 };
62
63 #endif // CHECKEDWIDGETS_H