]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTabularCreate.C
Controller-view split of Graphics and Index popups.
[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
25 ControlTabularCreate::ControlTabularCreate(LyXView & lv, Dialogs & d)
26         : ControlDialog<ControlConnectBD>(lv, d)
27 {
28         d_.showTabularCreate.connect(SigC::slot(this,
29                                                 &ControlTabularCreate::show));
30 }
31
32
33 string & ControlTabularCreate::params() const
34 {
35         Assert(params_);
36         return *params_;
37 }
38
39
40 void ControlTabularCreate::setParams()
41 {
42         if (params_) delete params_;
43         params_ = new string;
44
45         bc().valid(); // so that the user can press Ok
46 }
47
48
49 void ControlTabularCreate::clearParams()
50 {
51         if (params_) {
52                 delete params_;
53                 params_ = 0;
54         }
55 }
56
57
58 void ControlTabularCreate::apply()
59 {
60         if (!lv_.view()->available())
61                 return;
62    
63         view().apply();
64
65         lv_.getLyXFunc()->Dispatch(LFUN_INSET_TABULAR, params());
66 }