]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GTableCreate.C
trivial compile fix: remove obsolete mentions of vclog from gtk's Dialogs.C and Makef...
[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 "support/filetools.h"
19 #include "support/lstrings.h"
20
21 using std::string;
22
23 GTableCreate::GTableCreate(Dialog & parent)
24         : GViewCB<ControlTabularCreate, GViewGladeB>(parent, _("Insert Table"))
25 {
26 }
27
28 void GTableCreate::doBuild()
29 {
30         string const gladeName =
31                 lyx::support::LibFileSearch("glade", "tableCreate", "glade");
32         xml_ = Gnome::Glade::Xml::create(gladeName);
33         Gtk::Button * ok;
34         Gtk::Button * apply;
35         Gtk::Button * cancel;
36         xml_->get_widget("Ok", ok);
37         xml_->get_widget("Apply", apply);
38         xml_->get_widget("Cancel", cancel);
39         xml_->get_widget("Rows", rows_);
40         xml_->get_widget("Columns", columns_);
41         bcview().setOK(ok);
42         bcview().setCancel(cancel);
43         bcview().setApply(apply);
44         ok->signal_clicked().connect(
45                 SigC::slot(*this, &GViewBase::onOK));
46         apply->signal_clicked().connect(
47                 SigC::slot(*this, &GViewBase::onApply));
48         cancel->signal_clicked().connect(
49                 SigC::slot(*this, &GViewBase::onCancel));
50 }
51
52 void GTableCreate::apply()
53 {
54         int rows = rows_->get_value_as_int();
55         int columns = columns_->get_value_as_int();
56         controller().params() = std::make_pair(columns, rows);
57 }