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