]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GTableCreate.C
Extracted from r14281
[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
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
16 #endif
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
19 #endif
20
21 #include "GTableCreate.h"
22 #include "ghelpers.h"
23
24 #include "support/lstrings.h"
25
26 #include <libglademm.h>
27
28 using std::string;
29
30 namespace lyx {
31 namespace frontend {
32
33 GTableCreate::GTableCreate(Dialog & parent)
34         : GViewCB<ControlTabularCreate, GViewGladeB>(parent, _("Insert Table"))
35 {
36 }
37
38
39 void GTableCreate::doBuild()
40 {
41         string const gladeName = findGladeFile("tableCreate");
42         xml_ = Gnome::Glade::Xml::create(gladeName);
43         Gtk::Button * ok;
44         Gtk::Button * apply;
45         Gtk::Button * cancel;
46         xml_->get_widget("Ok", ok);
47         xml_->get_widget("Apply", apply);
48         xml_->get_widget("Cancel", cancel);
49         xml_->get_widget("Rows", rows_);
50         xml_->get_widget("Columns", columns_);
51         setOK(ok);
52         setCancel(cancel);
53         setApply(apply);
54 }
55
56
57 void GTableCreate::apply()
58 {
59         size_t const rows = rows_->get_value_as_int();
60         size_t const columns = columns_->get_value_as_int();
61         controller().params() = std::make_pair(rows, columns);
62 }
63
64 } // namespace frontend
65 } // namespace lyx