]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlFloat.C
table selection fix from John; Here & wide figures fix from Michael K.
[lyx.git] / src / frontends / controllers / ControlFloat.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  */
11
12 #include <config.h>
13
14 #ifdef __GNUG__
15 #pragma implementation
16 #endif
17
18 #include "ViewBase.h"
19 #include "ButtonControllerBase.h"
20 #include "ControlFloat.h"
21 #include "Dialogs.h"
22 #include "LyXView.h"
23 #include "buffer.h"
24 #include "BufferView.h"
25 #include "insets/insetfloat.h"
26
27 using std::vector;
28 using SigC::slot;
29
30
31 ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
32         : ControlInset<InsetFloat, FloatParams>(lv, d)
33 {
34         d_.showFloat.connect(slot(this, &ControlFloat::showInset));
35
36         // We could have an extra method updateInset that calls
37         // view().update() rather than view().show(), but I don't see why
38         // it is really needed.
39         //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
40 }
41
42
43 void ControlFloat::applyParamsToInset()
44 {
45         inset()->placement(params().placement);
46 }
47
48
49 void ControlFloat::applyParamsNoInset()
50 {}
51
52
53 FloatParams const ControlFloat::getParams(InsetFloat const & inset)
54 {
55         return FloatParams(inset);
56 }
57
58
59 FloatParams::FloatParams()
60         : placement("htbp"),
61           allow_here_definitely(true)
62 {}
63
64
65 FloatParams::FloatParams(InsetFloat const & inset)
66         : placement(inset.placement()), 
67           allow_here_definitely(!inset.wide())
68 {}