2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
* \file GuiFloat.cpp
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Edwin Leuven
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
#include "GuiFloat.h"
|
2007-09-05 20:33:29 +00:00
|
|
|
|
|
|
|
#include "ControlFloat.h"
|
2006-08-25 13:40:01 +00:00
|
|
|
#include "FloatPlacement.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-04-25 01:24:38 +00:00
|
|
|
#include "insets/InsetFloat.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
#include <QCloseEvent>
|
2006-08-25 13:40:01 +00:00
|
|
|
#include <QPushButton>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
GuiFloatDialog::GuiFloatDialog(LyXView & lv)
|
|
|
|
: GuiDialog(lv, "float")
|
2007-08-31 22:16:11 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
setController(new ControlFloat(*this));
|
|
|
|
setViewTitle(_("Float Settings"));
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
setupUi(this);
|
2007-09-05 20:33:29 +00:00
|
|
|
connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
|
|
|
|
connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
|
|
|
|
connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
|
|
|
|
connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
|
2007-08-31 22:16:11 +00:00
|
|
|
|
|
|
|
// enable span columns checkbox
|
|
|
|
floatFP->useWide();
|
|
|
|
// enable sideways checkbox
|
|
|
|
floatFP->useSideways();
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
|
2007-08-31 22:16:11 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
|
2007-08-31 22:16:11 +00:00
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
bc().setCancel(closePB);
|
|
|
|
bc().setApply(applyPB);
|
|
|
|
bc().setOK(okPB);
|
|
|
|
bc().setRestore(restorePB);
|
|
|
|
|
|
|
|
bc().addReadOnly(floatFP);
|
2007-08-31 22:16:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
ControlFloat & GuiFloatDialog::controller() const
|
2007-08-31 22:16:11 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
return static_cast<ControlFloat &>(Dialog::controller());
|
2007-08-31 22:16:11 +00:00
|
|
|
}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiFloatDialog::change_adaptor()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
changed();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiFloatDialog::closeEvent(QCloseEvent * e)
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
slotWMHide();
|
|
|
|
e->accept();
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiFloatDialog::update_contents()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
2007-09-05 20:33:29 +00:00
|
|
|
floatFP->set(controller().params());
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-05 20:33:29 +00:00
|
|
|
void GuiFloatDialog::applyView()
|
2006-03-05 17:24:44 +00:00
|
|
|
{
|
|
|
|
InsetFloatParams & params = controller().params();
|
2007-09-05 20:33:29 +00:00
|
|
|
params.placement = floatFP->get(params.wide, params.sideways);
|
2006-03-05 17:24:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
2007-08-31 22:16:11 +00:00
|
|
|
|
|
|
|
#include "GuiFloat_moc.cpp"
|