]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
Added // -*- C++ -*- to the top of all files in controllers/ and xforms/
[lyx.git] / src / frontends / controllers / ControlTabularCreate.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2001 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \file ControlTabularCreate.C
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ViewBase.h"
21 #include "ButtonControllerBase.h"
22 #include "ControlTabularCreate.h"
23 #include "BufferView.h"
24 #include "Dialogs.h"
25 #include "LyXView.h"
26 #include "lyxfunc.h"
27 #include "support/lstrings.h"
28
29 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
30         : ControlDialog<ControlConnectBD>(lv, d)
31 {
32         d_.showTabularCreate.connect(SigC::slot(this,
33                                                 &ControlTabularCreate::show));
34 }
35
36
37 ControlTabularCreate::rowsCols & ControlTabularCreate::params()
38 {
39                 return params_;
40 }
41
42
43 void ControlTabularCreate::setParams()
44 {
45         bc().valid(); // so that the user can press Ok
46 }
47
48
49 void ControlTabularCreate::apply()
50 {
51         if (!lv_.view()->available())
52                 return;
53    
54         view().apply();
55
56         string const val(tostr(params().first) + " " + tostr(params().second)); 
57  
58         lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, val);
59 }