]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
John's TabularCreate patch. I think I'm now up to date. Have a great Easter!
[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 "BufferView.h"
21 #include "Dialogs.h"
22 #include "LyXView.h"
23 #include "lyxfunc.h"
24 #include "support/lstrings.h"
25
26 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
27         : ControlDialog<ControlConnectBD>(lv, d)
28 {
29         d_.showTabularCreate.connect(SigC::slot(this,
30                                                 &ControlTabularCreate::show));
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 (!lv_.view()->available())
49                 return;
50    
51         view().apply();
52
53         string const val(tostr(params().first) + " " + tostr(params().second)); 
54  
55         lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, val);
56 }