]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
Port the tabular dialog to the new scheme based on class Dialog.
[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
14 #include "ControlTabularCreate.h"
15 #include "ViewBase.h"
16 #include "ButtonControllerBase.h"
17 #include "lyxfunc.h"
18 #include "funcrequest.h"
19
20
21 #include "support/lstrings.h"
22
23
24 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
25         : ControlDialogBD(lv, d)
26 {}
27
28
29 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
30 {
31         return params_;
32 }
33
34
35 void ControlTabularCreate::setParams()
36 {
37         bc().valid(); // so that the user can press Ok
38 }
39
40
41 void ControlTabularCreate::apply()
42 {
43         if (!bufferIsAvailable())
44                 return;
45
46         view().apply();
47
48         string const val = tostr(params().first) + ' ' + tostr(params().second);
49         lyxfunc().dispatch(FuncRequest(LFUN_TABULAR_INSERT, val));
50 }