]> git.lyx.org Git - features.git/blob - src/frontends/qt2/Qt2Base.C
29b0c4975bd05e950843d49db6123ae53ece0ee3
[features.git] / src / frontends / qt2 / Qt2Base.C
1 /* This file is part of
2  * ======================================================
3  *
4  *                 LyX, The Document Processor
5  *
6  *                 Copyright 2000 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \author Angus Leeming <a.leeming@ic.ac.uk>
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include <qdialog.h>
20
21 #include "QtLyXView.h" 
22 #include "Dialogs.h"
23 #include "Qt2Base.h"
24 #include "qt2BC.h"
25 #include "support/LAssert.h"
26
27 #include <stdio.h>
28
29
30 Qt2Base::Qt2Base(ControlButtons & c, QString const & t)
31         : ViewBC<qt2BC>(c), title_(t)
32 {}
33
34
35 void Qt2Base::show()
36 {
37         if (!form()) {
38                 build();
39         }
40
41         form()->setMinimumSize(form()->sizeHint());
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 void Qt2Base::changed()
62 {
63         bc().valid(); 
64 }
65
66
67 void Qt2Base::slotWMHide()
68 {
69         CancelButton();
70 }
71
72
73
74 void Qt2Base::slotApply()
75 {
76         ApplyButton();
77 }
78
79
80 void Qt2Base::slotOK()
81 {
82         OKButton();
83 }
84
85
86 void Qt2Base::slotCancel()
87 {
88         CancelButton();
89 }
90
91
92 void Qt2Base::slotRestore()
93 {
94         RestoreButton();
95 }
96
97
98 // PENDING(kalle) How to handle this?
99 // extern "C" void C_Qt2BaseInputCB(FL_OBJECT * ob, long d)
100 // {
101 //      GetForm(ob)->InputCB(ob, d);
102 // }