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 <boost/bind.hpp>
33 ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
34 : ControlInset<InsetFloat, FloatParams>(lv, d)
36 d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
38 // We could have an extra method updateInset that calls
39 // view().update() rather than view().show(), but I don't see why
40 // it is really needed.
41 //d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
45 void ControlFloat::applyParamsToInset()
47 inset()->placement(params().placement);
51 void ControlFloat::applyParamsNoInset()
55 FloatParams const ControlFloat::getParams(InsetFloat const & inset)
57 return FloatParams(inset);
61 FloatParams::FloatParams()
63 allow_here_definitely(true)
67 FloatParams::FloatParams(InsetFloat const & inset)
68 : placement(inset.placement()),
69 allow_here_definitely(!inset.wide())