]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Qt2Base.C
Remove some xforms cruft from BufferView.h BufferView_pimpl.h.
[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
37 void Qt2Base::show()
38 {
39     if (!form()) {
40         build();
41     }
42
43     update();  // make sure its up-to-date
44
45     if (form()->isVisible()) {
46         form()->raise();
47     } else {
48         form()->setCaption( title_ );
49         form()->show();
50     }
51 }
52
53
54 void Qt2Base::hide()
55 {
56     if (form() && form()->isVisible() )
57         form()->hide();
58 }
59
60
61 // PENDING(kalle) Handle this with QValidator?
62 // void Qt2Base::InputCB(FL_OBJECT * ob, long data)
63 // {
64 //      bc().input(input(ob, data));
65 // }
66
67
68 ButtonPolicy::SMInput Qt2Base::input(QWidget*, long)
69 {
70     return ButtonPolicy::SMI_VALID;
71 }
72
73
74
75 void Qt2Base::slotWMHide()
76 {
77     CancelButton();
78 }
79
80
81
82 void Qt2Base::slotApply()
83 {
84     ApplyButton();
85 }
86
87
88 void Qt2Base::slotOK()
89 {
90     OKButton();
91 }
92
93
94 void Qt2Base::slotCancel()
95 {
96     CancelButton();
97 }
98
99
100 void Qt2Base::slotRestore()
101 {
102     RestoreButton();
103 }
104
105
106 // PENDING(kalle) How to handle this?
107 // extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d)
108 // {
109 //      GetForm(ob)->InputCB(ob, d);
110 // }