]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiTabularCreate.cpp
cosmetics
[lyx.git] / src / frontends / qt4 / GuiTabularCreate.cpp
1 /**
2  * \file GuiTabularCreate.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "GuiTabularCreate.h"
14
15 #include "ControlTabularCreate.h"
16 #include "EmptyTable.h"
17
18 #include <QCloseEvent>
19 #include <QSpinBox>
20 #include <QPushButton>
21
22
23 namespace lyx {
24 namespace frontend {
25
26 GuiTabularCreateDialog::GuiTabularCreateDialog(LyXView & lv)
27         : GuiDialog(lv, "tabularcreate")
28 {
29         setupUi(this);
30         setViewTitle(_("Insert Table"));
31         setController(new ControlTabularCreate(*this));
32
33         rowsSB->setValue(5);
34         columnsSB->setValue(5);
35
36         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
37         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
38
39         connect(rowsSB, SIGNAL(valueChanged(int)),
40                 this, SLOT(rowsChanged(int)));
41         connect(columnsSB, SIGNAL(valueChanged(int)),
42                 this, SLOT(columnsChanged(int)));
43
44         bc().setPolicy(ButtonPolicy::IgnorantPolicy);
45         bc().setOK(okPB);
46         bc().setCancel(closePB);
47 }
48
49
50 ControlTabularCreate & GuiTabularCreateDialog::controller()
51 {
52         return static_cast<ControlTabularCreate &>(GuiDialog::controller());
53 }
54
55
56 void GuiTabularCreateDialog::columnsChanged(int)
57 {
58         changed();
59 }
60
61
62 void GuiTabularCreateDialog::rowsChanged(int)
63 {
64         changed();
65 }
66
67
68 void GuiTabularCreateDialog::applyView()
69 {
70         controller().params().first = rowsSB->value();
71         controller().params().second = columnsSB->value();
72 }
73
74 } // namespace frontend
75 } // namespace lyx
76
77 #include "GuiTabularCreate_moc.cpp"