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 "ControlTabularCreate.h"
15 #include "forms/form_tabular_create.h"
20 #include "lyx_forms.h"
25 typedef FormController<ControlTabularCreate, FormView<FD_tabular_create> > base_class;
27 FormTabularCreate::FormTabularCreate(Dialog & parent)
28 : base_class(parent, _("Insert Table"))
32 void FormTabularCreate::build()
34 dialog_.reset(build_tabular_create(this));
36 // Manage the ok, apply and cancel/close buttons
37 bcview().setOK(dialog_->button_ok);
38 bcview().setApply(dialog_->button_apply);
39 bcview().setCancel(dialog_->button_close);
41 // set up the tooltips
42 string str = _("Number of columns in the tabular.");
43 tooltips().init(dialog_->slider_columns, str);
44 str = _("Number of rows in the tabular.");
45 tooltips().init(dialog_->slider_rows, str);
49 void FormTabularCreate::apply()
51 unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
52 unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
54 controller().params() = make_pair(xsize, ysize);