3 * Copyright 2000-2001 The LyX Team.
4 * See the file COPYING.
6 * \author Angus Leeming, a.leeming@ic.ac.uk
11 #include FORMS_H_LOCATION
14 #pragma implementation
18 #include "frontends/LyXView.h"
19 #include "FormInset.h"
21 #include "insets/insetcommand.h"
23 #include <boost/bind.hpp>
25 FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t)
26 : FormBaseBD(lv, d, t)
30 void FormInset::connect()
32 u_ = d_->updateBufferDependent.
33 connect(boost::bind(&FormInset::updateSlot, this, _1));
34 h_ = d_->hideBufferDependent.
35 connect(boost::bind(&FormInset::hide, this));
36 FormBaseDeprecated::connect();
40 void FormInset::disconnect()
43 FormBaseBD::disconnect();
47 void FormInset::updateSlot(bool switched)
56 FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
57 : FormInset(lv, d, t),
62 void FormCommand::disconnect()
65 params = InsetCommandParams(string());
66 FormInset::disconnect();
70 void FormCommand::showInset(InsetCommand * inset)
72 if (inset == 0) return; // maybe we should Assert this?
74 // If connected to another inset, disconnect from it.
79 params = inset->params();
80 ih_ = inset->hideDialog.connect(boost::bind(&FormCommand::hide, this));
85 void FormCommand::createInset(string const & arg)
92 params.setFromString(arg);
94 bc().valid(); // so that the user can press Ok