]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
Switch from SigC signals to boost::signals
[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 "Dialogs.h"
24 #include "lyxfunc.h"
25
26 #include "frontends/LyXView.h"
27
28 #include "support/lstrings.h"
29
30 #include <boost/bind.hpp>
31
32 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
33         : ControlDialogBD(lv, d)
34 {
35         d_.showTabularCreate = boost::bind(&ControlTabularCreate::show, this);
36 }
37
38
39 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
40 {
41                 return params_;
42 }
43
44
45 void ControlTabularCreate::setParams()
46 {
47         bc().valid(); // so that the user can press Ok
48 }
49
50
51 void ControlTabularCreate::apply()
52 {
53         if (!lv_.view()->available())
54                 return;
55
56         view().apply();
57
58         string const val(tostr(params().first) + " " + tostr(params().second));
59
60         lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
61 }