]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
Create a grfx::Loader class and so move large chunks of code out of
[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 "BufferView.h"
23 #include "lyxfunc.h"
24
25 #include "frontends/LyXView.h"
26
27 #include "support/lstrings.h"
28
29
30 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
31         : ControlDialogBD(lv, d)
32 {}
33
34
35 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
36 {
37                 return params_;
38 }
39
40
41 void ControlTabularCreate::setParams()
42 {
43         bc().valid(); // so that the user can press Ok
44 }
45
46
47 void ControlTabularCreate::apply()
48 {
49         if (!lv_.view()->available())
50                 return;
51
52         view().apply();
53
54         string const val(tostr(params().first) + " " + tostr(params().second));
55
56         lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
57 }