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
|
|
|
|
|
|
|
|
#include "ViewBase.h"
|
|
|
|
#include "ButtonControllerBase.h"
|
|
|
|
#include "ControlFloat.h"
|
2002-01-16 14:47:58 +00:00
|
|
|
#include "ControlInset.tmpl"
|
2001-07-30 11:56:00 +00:00
|
|
|
#include "Dialogs.h"
|
|
|
|
#include "LyXView.h"
|
|
|
|
#include "buffer.h"
|
|
|
|
#include "BufferView.h"
|
|
|
|
#include "insets/insetfloat.h"
|
|
|
|
|
|
|
|
using std::vector;
|
|
|
|
using SigC::slot;
|
|
|
|
|
|
|
|
|
|
|
|
ControlFloat::ControlFloat(LyXView & lv, Dialogs & d)
|
|
|
|
: ControlInset<InsetFloat, FloatParams>(lv, d)
|
|
|
|
{
|
|
|
|
d_.showFloat.connect(slot(this, &ControlFloat::showInset));
|
|
|
|
|
|
|
|
// 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
|
|
|
{}
|