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")
32 setViewTitle(_("Float Settings"));
35 connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
36 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
37 connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
38 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
40 // enable span columns checkbox
42 // enable sideways checkbox
43 floatFP->useSideways();
45 connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
47 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
49 bc().setCancel(closePB);
50 bc().setApply(applyPB);
52 bc().setRestore(restorePB);
54 bc().addReadOnly(floatFP);
58 void GuiFloat::change_adaptor()
64 void GuiFloat::closeEvent(QCloseEvent * e)
71 void GuiFloat::updateContents()
73 floatFP->set(params_);
77 void GuiFloat::applyView()
79 params_.placement = floatFP->get(params_.wide, params_.sideways);
83 bool GuiFloat::initialiseParams(string const & data)
85 InsetFloatMailer::string2params(data, params_);
90 void GuiFloat::clearParams()
92 params_ = InsetFloatParams();
96 void GuiFloat::dispatchParams()
98 dispatch(FuncRequest(getLfun(), InsetFloatMailer::params2string(params_)));
102 Dialog * createGuiFloat(LyXView & lv) { return new GuiFloat(lv); }
105 } // namespace frontend
108 #include "GuiFloat_moc.cpp"