]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiTabularCreate.cpp
renaming of some methods that hurt the eyes + removal of:
[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 #include "EmptyTable.h"
15
16 #include <QCloseEvent>
17 #include <QSpinBox>
18 #include <QPushButton>
19
20 namespace lyx {
21 namespace frontend {
22
23 /////////////////////////////////////////////////////////////////////
24 //
25 // GuiTabularCreateDialog
26 //
27 /////////////////////////////////////////////////////////////////////
28
29 GuiTabularCreateDialog::GuiTabularCreateDialog(GuiTabularCreate * form)
30         : form_(form)
31 {
32         setupUi(this);
33
34         rowsSB->setValue(5);
35         columnsSB->setValue(5);
36
37         connect(okPB, SIGNAL(clicked()), form_, SLOT(slotOK()));
38         connect(closePB, SIGNAL(clicked()), form_, SLOT(slotClose()));
39
40         connect(rowsSB, SIGNAL(valueChanged(int)),
41                 this, SLOT(rowsChanged(int)));
42         connect(columnsSB, SIGNAL(valueChanged(int)),
43                 this, SLOT(columnsChanged(int)));
44 }
45
46
47 void GuiTabularCreateDialog::columnsChanged(int)
48 {
49         form_->changed();
50 }
51
52
53 void GuiTabularCreateDialog::rowsChanged(int)
54 {
55         form_->changed();
56 }
57
58
59 /////////////////////////////////////////////////////////////////////
60 //
61 // GuiTabularCreate
62 //
63 /////////////////////////////////////////////////////////////////////
64
65
66 GuiTabularCreate::GuiTabularCreate(GuiDialog & parent)
67         : GuiView<GuiTabularCreateDialog>(parent, _("Insert Table"))
68 {
69 }
70
71
72 void GuiTabularCreate::build_dialog()
73 {
74         dialog_.reset(new GuiTabularCreateDialog(this));
75
76         bc().setOK(dialog_->okPB);
77         bc().setCancel(dialog_->closePB);
78 }
79
80
81 void GuiTabularCreate::applyView()
82 {
83         controller().params().first = dialog_->rowsSB->value();
84         controller().params().second = dialog_->columnsSB->value();
85 }
86
87 } // namespace frontend
88 } // namespace lyx
89
90 #include "GuiTabularCreate_moc.cpp"