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