]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
John's character.C patch (bug fix).
[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 "ViewBase.h"
20 #include "ButtonControllerBase.h"
21 #include "ControlTabularCreate.h"
22 #include "BufferView.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25 #include "lyxfunc.h"
26 #include "support/lstrings.h"
27
28 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
29         : ControlDialog<ControlConnectBD>(lv, d)
30 {
31         d_.showTabularCreate.connect(SigC::slot(this,
32                                                 &ControlTabularCreate::show));
33 }
34
35
36 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
37 {
38                 return params_;
39 }
40
41
42 void ControlTabularCreate::setParams()
43 {
44         bc().valid(); // so that the user can press Ok
45 }
46
47
48 void ControlTabularCreate::apply()
49 {
50         if (!lv_.view()->available())
51                 return;
52    
53         view().apply();
54
55         string const val(tostr(params().first) + " " + tostr(params().second)); 
56  
57         lv_.getLyXFunc()->dispatch(LFUN_INSET_TABULAR, val);
58 }