]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
This file is part of LyX, the document processor.
[lyx.git] / src / frontends / controllers / ControlTabularCreate.C
1 /**
2  * \file ControlTabularCreate.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "ControlTabularCreate.h"
18 #include "ViewBase.h"
19 #include "ButtonControllerBase.h"
20 #include "lyxfunc.h"
21 #include "funcrequest.h"
22
23
24 #include "support/lstrings.h"
25
26
27 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
28         : ControlDialogBD(lv, d)
29 {}
30
31
32 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
33 {
34         return params_;
35 }
36
37
38 void ControlTabularCreate::setParams()
39 {
40         bc().valid(); // so that the user can press Ok
41 }
42
43
44 void ControlTabularCreate::apply()
45 {
46         if (!bufferIsAvailable())
47                 return;
48
49         view().apply();
50
51         string const val = tostr(params().first) + " " + tostr(params().second);
52         lyxfunc().dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
53 }