]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiTabularCreate.cpp
'using namespace std' instead of 'using std::xxx'
[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 "EmptyTable.h"
16 #include "FuncRequest.h"
17
18 #include "support/convert.h"
19
20 #include <QCloseEvent>
21 #include <QSpinBox>
22 #include <QPushButton>
23
24 using namespace std;
25
26 namespace lyx {
27 namespace frontend {
28
29 GuiTabularCreate::GuiTabularCreate(GuiView & lv)
30         : GuiDialog(lv, "tabularcreate")
31 {
32         setupUi(this);
33         setViewTitle(_("Insert Table"));
34
35         rowsSB->setValue(5);
36         columnsSB->setValue(5);
37
38         connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
39         connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
40
41         connect(rowsSB, SIGNAL(valueChanged(int)),
42                 this, SLOT(rowsChanged(int)));
43         connect(columnsSB, SIGNAL(valueChanged(int)),
44                 this, SLOT(columnsChanged(int)));
45
46         bc().setPolicy(ButtonPolicy::IgnorantPolicy);
47         bc().setOK(okPB);
48         bc().setCancel(closePB);
49 }
50
51
52 void GuiTabularCreate::columnsChanged(int)
53 {
54         changed();
55 }
56
57
58 void GuiTabularCreate::rowsChanged(int)
59 {
60         changed();
61 }
62
63
64 void GuiTabularCreate::applyView()
65 {
66         params_.first = rowsSB->value();
67         params_.second = columnsSB->value();
68 }
69
70
71 bool GuiTabularCreate::initialiseParams(string const &)
72 {
73         params_.first  = 5;
74         params_.second = 5;
75         return true;
76 }
77
78
79 void GuiTabularCreate::clearParams()
80 {
81         params_.first  = 0;
82         params_.second = 0;
83 }
84
85
86 void GuiTabularCreate::dispatchParams()
87 {
88         string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
89         dispatch(FuncRequest(getLfun(), data));
90 }
91
92
93 Dialog * createGuiTabularCreate(GuiView & lv)
94 {
95         return new GuiTabularCreate(lv);
96 }
97
98
99 } // namespace frontend
100 } // namespace lyx
101
102 #include "GuiTabularCreate_moc.cpp"