3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
15 #include "FloatPlacement.h"
16 #include "FuncRequest.h"
18 #include "insets/InsetFloat.h"
20 #include <QCloseEvent>
21 #include <QPushButton>
29 GuiFloat::GuiFloat(LyXView & lv)
30 : GuiDialog(lv, "float"), Controller(this)
32 setController(this, false);
33 setViewTitle(_("Float Settings"));
36 connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
37 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
38 connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
39 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
41 // enable span columns checkbox
43 // enable sideways checkbox
44 floatFP->useSideways();
46 connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
48 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
50 bc().setCancel(closePB);
51 bc().setApply(applyPB);
53 bc().setRestore(restorePB);
55 bc().addReadOnly(floatFP);
59 void GuiFloat::change_adaptor()
65 void GuiFloat::closeEvent(QCloseEvent * e)
72 void GuiFloat::updateContents()
74 floatFP->set(params_);
78 void GuiFloat::applyView()
80 params_.placement = floatFP->get(params_.wide, params_.sideways);
84 bool GuiFloat::initialiseParams(string const & data)
86 InsetFloatMailer::string2params(data, params_);
91 void GuiFloat::clearParams()
93 params_ = InsetFloatParams();
97 void GuiFloat::dispatchParams()
99 dispatch(FuncRequest(getLfun(), InsetFloatMailer::params2string(params_)));
103 Dialog * createGuiFloat(LyXView & lv) { return new GuiFloat(lv); }
106 } // namespace frontend
109 #include "GuiFloat_moc.cpp"