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.
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
22 #include "ControlWrap.h"
23 #include "insets/insetwrap.h"
27 #include <libglademm.h>
34 GWrap::GWrap(Dialog & parent)
35 : GViewCB<ControlWrap, GViewGladeB>(parent, _("Text Wrap Settings"), false)
41 string const gladeName = findGladeFile("wrap");
42 xml_ = Gnome::Glade::Xml::create(gladeName);
44 Gtk::Button * cancelbutton;
45 xml_->get_widget("Close", cancelbutton);
46 setCancel(cancelbutton);
48 xml_->get_widget_derived ("Width", widthlengthentry_);
49 xml_->get_widget ("Placement", placementcombo_);
51 widthlengthentry_->signal_changed().connect(
52 sigc::mem_fun(*this, &GWrap::apply));
53 placementcombo_->signal_changed().connect(
54 sigc::mem_fun(*this, &GWrap::apply));
56 bcview().addReadOnly(widthlengthentry_);
57 bcview().addReadOnly(placementcombo_);
65 InsetWrapParams & params = controller().params();
67 widthlengthentry_->set_length (params.width);
70 if (params.placement == "l")
72 else if (params.placement == "r")
74 else if (params.placement == "p")
79 placementcombo_->set_active (item);
81 bc().refreshReadOnly();
92 InsetWrapParams & params = controller().params();
94 params.width = widthlengthentry_->get_length();
96 int const placementrow = placementcombo_->get_active_row_number();
97 BOOST_ASSERT (0 <= placementrow <= 3);
98 switch (placementrow) {
100 params.placement = 'l';
103 params.placement = 'r';
106 params.placement = 'p';
110 params.placement.erase();
114 controller().dispatchParams();
117 } // namespace frontend