2 * \file xforms/FormTabularCreate.C
3 * Copyright 2000-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Jürgen Vigna, jug@sad.it
13 #pragma implementation
17 #include "ControlTabularCreate.h"
18 #include "FormTabularCreate.h"
19 #include "forms/form_tabular_create.h"
20 #include "support/lstrings.h"
21 #include FORMS_H_LOCATION
27 typedef FormCB<ControlTabularCreate, FormDB<FD_tabular_create> > base_class;
29 FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
30 : base_class(c, _("Insert Tabular"))
34 void FormTabularCreate::build()
36 dialog_.reset(build_tabular_create(this));
38 fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
39 fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
40 fl_set_slider_value(dialog_->slider_rows, 5);
41 fl_set_slider_value(dialog_->slider_columns, 5);
42 fl_set_slider_precision(dialog_->slider_rows, 0);
43 fl_set_slider_precision(dialog_->slider_columns, 0);
45 // Manage the ok, apply and cancel/close buttons
46 bc().setOK(dialog_->button_ok);
47 bc().setApply(dialog_->button_apply);
48 bc().setCancel(dialog_->button_close);
52 void FormTabularCreate::apply()
54 unsigned int ysize = (unsigned int)(fl_get_slider_value(dialog_->slider_columns) + 0.5);
55 unsigned int xsize = (unsigned int)(fl_get_slider_value(dialog_->slider_rows) + 0.5);
57 controller().params() = make_pair(xsize, ysize);