2 * \file FormTabularCreate.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
16 #include "ControlTabularCreate.h"
17 #include "FormTabularCreate.h"
18 #include "forms/form_tabular_create.h"
20 #include "support/lstrings.h"
21 #include "lyx_forms.h"
27 typedef FormController<ControlTabularCreate, FormView<FD_tabular_create> > base_class;
29 FormTabularCreate::FormTabularCreate(Dialog & parent)
30 : base_class(parent, _("Insert Table"))
34 void FormTabularCreate::build()
36 dialog_.reset(build_tabular_create(this));
38 // Manage the ok, apply and cancel/close buttons
39 bcview().setOK(dialog_->button_ok);
40 bcview().setApply(dialog_->button_apply);
41 bcview().setCancel(dialog_->button_close);
43 // set up the tooltips
44 string str = _("Number of columns in the tabular.");
45 tooltips().init(dialog_->slider_columns, str);
46 str = _("Number of rows in the tabular.");
47 tooltips().init(dialog_->slider_rows, str);
51 void FormTabularCreate::apply()
53 unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
54 unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
56 controller().params() = make_pair(xsize, ysize);