GuiPrintNomencl.{cpp,h}:
[lyx.git] / src / frontends / qt4 / GuiFloat.cpp
blob773a7f0ba88dacb917789f8c568614f59adf8b4d
1 /**
2 * \file GuiFloat.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Edwin Leuven
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "GuiFloat.h"
15 #include "FloatPlacement.h"
16 #include "FuncRequest.h"
18 #include "insets/InsetFloat.h"
20 #include <QPushButton>
22 using namespace std;
24 namespace lyx {
25 namespace frontend {
27 GuiFloat::GuiFloat(GuiView & lv)
28 : GuiDialog(lv, "float", qt_("Float Settings"))
30 setupUi(this);
32 connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
33 connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
34 connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
35 connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose()));
37 // enable span columns checkbox
38 floatFP->useWide();
39 // enable sideways checkbox
40 floatFP->useSideways();
42 connect(floatFP, SIGNAL(changed()), this, SLOT(change_adaptor()));
44 bc().setPolicy(ButtonPolicy::NoRepeatedApplyReadOnlyPolicy);
46 bc().setCancel(closePB);
47 bc().setApply(applyPB);
48 bc().setOK(okPB);
49 bc().setRestore(restorePB);
51 bc().addReadOnly(floatFP);
55 void GuiFloat::change_adaptor()
57 changed();
61 void GuiFloat::updateContents()
63 floatFP->set(params_);
67 void GuiFloat::applyView()
69 params_.placement = floatFP->get(params_.wide, params_.sideways);
73 bool GuiFloat::initialiseParams(string const & data)
75 InsetFloat::string2params(data, params_);
76 return true;
80 void GuiFloat::clearParams()
82 params_ = InsetFloatParams();
86 void GuiFloat::dispatchParams()
88 dispatch(FuncRequest(getLfun(), InsetFloat::params2string(params_)));
92 Dialog * createGuiFloat(GuiView & lv) { return new GuiFloat(lv); }
95 } // namespace frontend
96 } // namespace lyx
98 #include "moc_GuiFloat.cpp"