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.
13 #include "FormTabularCreate.h"
14 #include "controllers/ControlTabularCreate.h"
15 #include "forms/form_tabular_create.h"
20 #include "lyx_forms.h"
28 typedef FormController<ControlTabularCreate, FormView<FD_tabular_create> > base_class;
30 FormTabularCreate::FormTabularCreate(Dialog & parent)
31 : base_class(parent, _("Insert Table"))
35 void FormTabularCreate::build()
37 dialog_.reset(build_tabular_create(this));
39 // Manage the ok, apply and cancel/close buttons
40 bcview().setOK(dialog_->button_ok);
41 bcview().setApply(dialog_->button_apply);
42 bcview().setCancel(dialog_->button_close);
44 // set up the tooltips
45 string str = _("Number of columns in the tabular.");
46 tooltips().init(dialog_->slider_columns, str);
47 str = _("Number of rows in the tabular.");
48 tooltips().init(dialog_->slider_rows, str);
52 void FormTabularCreate::apply()
54 size_t ysize = static_cast<size_t>(
55 fl_get_slider_value(dialog_->slider_columns) + 0.5);
56 size_t xsize = static_cast<size_t>(
57 fl_get_slider_value(dialog_->slider_rows) + 0.5);
59 controller().params() = make_pair(xsize, ysize);
62 } // namespace frontend