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>
28 GuiFloat::GuiFloat(GuiView & lv)
29 : GuiDialog(lv, "float")
32 setViewTitle(_("Float Settings"));
34 connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
35 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
36 connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
37 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
39 // enable span columns checkbox
41 // enable sideways checkbox
42 floatFP->useSideways();
44 connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
46 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
48 bc().setCancel(closePB);
49 bc().setApply(applyPB);
51 bc().setRestore(restorePB);
53 bc().addReadOnly(floatFP);
57 void GuiFloat::change_adaptor()
63 void GuiFloat::closeEvent(QCloseEvent * e)
70 void GuiFloat::updateContents()
72 floatFP->set(params_);
76 void GuiFloat::applyView()
78 params_.placement = floatFP->get(params_.wide, params_.sideways);
82 bool GuiFloat::initialiseParams(string const & data)
84 InsetFloatMailer::string2params(data, params_);
89 void GuiFloat::clearParams()
91 params_ = InsetFloatParams();
95 void GuiFloat::dispatchParams()
97 dispatch(FuncRequest(getLfun(), InsetFloatMailer::params2string(params_)));
101 Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
104 } // namespace frontend
107 #include "GuiFloat_moc.cpp"