2001-07-30 11:56:00 +00:00
|
|
|
/* This file is part of
|
2002-03-21 21:21:28 +00:00
|
|
|
* ======================================================
|
2001-07-30 11:56:00 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 2001 The LyX Team.
|
|
|
|
*
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
2002-05-29 16:21:03 +00:00
|
|
|
#include "ControlFloat.h"
|
2001-07-30 11:56:00 +00:00
|
|
|
#include "ViewBase.h"
|
|
|
|
#include "ButtonControllerBase.h"
|
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "buffer.h"
|
|
|
|
#include "BufferView.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
|
2001-07-30 11:56:00 +00:00
|
|
|
#include "insets/insetfloat.h"
|
2002-05-29 16:21:03 +00:00
|
|
|
#include "frontends/LyXView.h"
|
|
|
|
|
|
|
|
#include <boost/bind.hpp>
|
2001-07-30 11:56:00 +00:00
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
|
|
|
|
|
|
|
|
ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
|
|
|
|
: ControlInset<InsetFloat, FloatParams>(lv, d)
|
|
|
|
{
|
2002-05-29 16:21:03 +00:00
|
|
|
d_.showFloat = boost::bind(&ControlFloat::showInset, this, _1);
|
2001-07-30 11:56:00 +00:00
|
|
|
|
|
|
|
// We could have an extra method updateInset that calls
|
|
|
|
// view().update() rather than view().show(), but I don't see why
|
|
|
|
// it is really needed.
|
|
|
|
//d_.updateFloat.connect(slot(this, &ControlFloat::showInset));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ControlFloat::applyParamsToInset()
|
|
|
|
{
|
|
|
|
inset()->placement(params().placement);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ControlFloat::applyParamsNoInset()
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
FloatParams const ControlFloat::getParams(InsetFloat const & inset)
|
|
|
|
{
|
|
|
|
return FloatParams(inset);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
FloatParams::FloatParams()
|
2002-01-03 13:31:12 +00:00
|
|
|
: placement("htbp"),
|
|
|
|
allow_here_definitely(true)
|
2001-07-30 11:56:00 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
FloatParams::FloatParams(InsetFloat const & inset)
|
2002-03-21 21:21:28 +00:00
|
|
|
: placement(inset.placement()),
|
2002-01-03 13:31:12 +00:00
|
|
|
allow_here_definitely(!inset.wide())
|
2001-07-30 11:56:00 +00:00
|
|
|
{}
|