]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormTabularCreate.C
implement getLabelList
[lyx.git] / src / frontends / xforms / FormTabularCreate.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2000-2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file FormTabularCreate.C
11  */
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma implementation
17 #endif
18
19 #include "xformsBC.h"
20 #include "ControlTabularCreate.h"
21 #include "FormTabularCreate.h"
22 #include "form_tabular_create.h"
23 #include "support/lstrings.h"
24
25 typedef FormCB<ControlTabularCreate, FormDB<FD_form_tabular_create> > base_class;
26
27 FormTabularCreate::FormTabularCreate(ControlTabularCreate & c)
28         : base_class(c, _("Insert Tabular"))
29 {}
30
31
32 void FormTabularCreate::build()
33 {
34         dialog_.reset(build_tabular_create());
35
36         fl_set_slider_bounds(dialog_->slider_rows, 1, 50);
37         fl_set_slider_bounds(dialog_->slider_columns, 1, 50);
38         fl_set_slider_value(dialog_->slider_rows, 5);
39         fl_set_slider_value(dialog_->slider_columns, 5);
40         fl_set_slider_precision(dialog_->slider_rows, 0);
41         fl_set_slider_precision(dialog_->slider_columns, 0);
42
43         // Manage the ok, apply and cancel/close buttons
44         bc().setOK(dialog_->button_ok);
45         bc().setApply(dialog_->button_apply);
46         bc().setCancel(dialog_->button_cancel);
47 }
48
49
50 void FormTabularCreate::apply()
51 {
52         int ysize = int(fl_get_slider_value(dialog_->slider_columns) + 0.5);
53         int xsize = int(fl_get_slider_value(dialog_->slider_rows) + 0.5);
54
55         controller().params() = tostr(xsize) + " " + tostr(ysize);
56 }