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