1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2000-2001 The LyX Team.
8 * ======================================================
10 * \file FormTabularCreate.C
17 #pragma implementation
21 #include "ControlTabularCreate.h"
22 #include "FormTabularCreate.h"
23 #include "form_tabular_create.h"
24 #include "support/lstrings.h"
26 typedef FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > base_class;
28 FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
29 : base_class(c, _("Insert Tabular"))
33 void FormTabularCreate::build()
35 dialog_.reset(build_tabular_create());
37 fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
38 fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
39 fl_set_slider_value(dialog_->slider_rows, 5);
40 fl_set_slider_value(dialog_->slider_columns, 5);
41 fl_set_slider_precision(dialog_->slider_rows, 0);
42 fl_set_slider_precision(dialog_->slider_columns, 0);
44 // Manage the ok, apply and cancel/close buttons
45 bc().setOK(dialog_->button_ok);
46 bc().setApply(dialog_->button_apply);
47 bc().setCancel(dialog_->button_cancel);
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() = std::make_pair(xsize, ysize);