1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
15 #pragma implementation
18 #include "ControlFloat.h"
20 #include "ButtonControllerBase.h"
23 #include "BufferView.h"
25 #include "insets/insetfloat.h"
26 #include "frontends/LyXView.h"
28 #include "ControlInset.tmpl"
30 #include <boost/bind.hpp>
35 ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
36 : ControlInset<InsetFloat, FloatParams>(lv, d)
38 d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
40 // We could have an extra method updateInset that calls
41 // view().update() rather than view().show(), but I don't see why
42 // it is really needed.
43 //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
47 void ControlFloat::applyParamsToInset()
49 inset()->placement(params().placement);
53 void ControlFloat::applyParamsNoInset()
57 FloatParams const ControlFloat::getParams(InsetFloat const & inset)
59 return FloatParams(inset);
63 FloatParams::FloatParams()
65 allow_here_definitely(true)
69 FloatParams::FloatParams(InsetFloat const & inset)
70 : placement(inset.placement()),
71 allow_here_definitely(!inset.wide())