]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabularCreate.C
Introduce LFUN_PRINT.
[lyx.git] / src / frontends / xforms / FormTabularCreate.C
1 /**
2  * \file FormTabularCreate.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Jürgen Vigna
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "FormTabularCreate.h"
14 #include "ControlTabularCreate.h"
15 #include "forms/form_tabular_create.h"
16
17 #include "Tooltips.h"
18 #include "xformsBC.h"
19
20 #include "lyx_forms.h"
21
22 using std::make_pair;
23 using std::string;
24
25
26 typedef FormController<ControlTabularCreate, FormView<FD_tabular_create> > base_class;
27
28 FormTabularCreate::FormTabularCreate(Dialog & parent)
29         : base_class(parent, _("Insert Table"))
30 {}
31
32
33 void FormTabularCreate::build()
34 {
35         dialog_.reset(build_tabular_create(this));
36
37         // Manage the ok, apply and cancel/close buttons
38         bcview().setOK(dialog_->button_ok);
39         bcview().setApply(dialog_->button_apply);
40         bcview().setCancel(dialog_->button_close);
41
42         // set up the tooltips
43         string str = _("Number of columns in the tabular.");
44         tooltips().init(dialog_->slider_columns, str);
45         str = _("Number of rows in the tabular.");
46         tooltips().init(dialog_->slider_rows, str);
47 }
48
49
50 void FormTabularCreate::apply()
51 {
52         unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
53         unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
54
55         controller().params() = make_pair(xsize, ysize);
56 }