]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Qt2Base.C
Qt2 compilation + LColor cleanup from John
[lyx.git] / src / frontends / qt2 / Qt2Base.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *                 LyX, The Document Processor
6  *
7  *                 Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \author Angus Leeming <a.leeming@ic.ac.uk>
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include <qdialog.h>
21 #undef emit
22
23 #include "Dialogs.h"
24 #include "Qt2Base.h"
25 #include "qt2BC.h"
26 #include "support/LAssert.h"
27
28 #include <stdio.h>
29
30
31 Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
32         : ViewBC<qt2BC>(c), title_(t)
33 {}
34
35
36 void Qt2Base::show()
37 {
38         if (!form()) {
39                 build();
40         }
41
42         update();  // make sure its up-to-date
43
44         if (form()->isVisible()) {
45                 form()->raise();
46         } else {
47                 form()->setCaption( title_ );
48                 form()->show();
49         }
50 }
51
52
53 void Qt2Base::hide()
54 {
55         if (form() && form()->isVisible() )
56                 form()->hide();
57 }
58
59
60 // PENDING(kalle) Handle this with QValidator?
61 // void Qt2Base::InputCB(FL_OBJECT * ob, long data)
62 // {
63 //      bc().input(input(ob, data));
64 // }
65
66
67 ButtonPolicy::SMInput Qt2Base::input(QWidget*, long)
68 {
69         return ButtonPolicy::SMI_VALID;
70 }
71
72
73
74 void Qt2Base::slotWMHide()
75 {
76         CancelButton();
77 }
78
79
80
81 void Qt2Base::slotApply()
82 {
83         ApplyButton();
84 }
85
86
87 void Qt2Base::slotOK()
88 {
89         OKButton();
90 }
91
92
93 void Qt2Base::slotCancel()
94 {
95         CancelButton();
96 }
97
98
99 void Qt2Base::slotRestore()
100 {
101         RestoreButton();
102 }
103
104
105 // PENDING(kalle) How to handle this?
106 // extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d)
107 // {
108 //      GetForm(ob)->InputCB(ob, d);
109 // }