]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GTableCreate.C
WS changes
[lyx.git] / src / frontends / gtk / GTableCreate.C
1 /**
2  * \file GTableCreate.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Huang Ying
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12 #include <gtkmm.h>
13
14 #include <libglademm.h>
15
16 #include "ControlTabularCreate.h"
17 #include "GTableCreate.h"
18 #include "ghelpers.h"
19 #include "support/lstrings.h"
20
21 using std::string;
22
23 namespace lyx {
24 namespace frontend {
25
26 GTableCreate::GTableCreate(Dialog & parent)
27         : GViewCB<ControlTabularCreate, GViewGladeB>(parent, _("Insert Table"))
28 {
29 }
30
31
32 void GTableCreate::doBuild()
33 {
34         string const gladeName = findGladeFile("tableCreate");
35         xml_ = Gnome::Glade::Xml::create(gladeName);
36         Gtk::Button * ok;
37         Gtk::Button * apply;
38         Gtk::Button * cancel;
39         xml_->get_widget("Ok", ok);
40         xml_->get_widget("Apply", apply);
41         xml_->get_widget("Cancel", cancel);
42         xml_->get_widget("Rows", rows_);
43         xml_->get_widget("Columns", columns_);
44         setOK(ok);
45         setCancel(cancel);
46         setApply(apply);
47 }
48
49
50 void GTableCreate::apply()
51 {
52         int rows = rows_->get_value_as_int();
53         int columns = columns_->get_value_as_int();
54         controller().params() = std::make_pair(columns, rows);
55 }
56
57 } // namespace frontend
58 } // namespace lyx