2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2000 The LyX Team.
9 * ======================================================
14 #include FORMS_H_LOCATION
17 #pragma implementation
22 #include "FormInset.h"
27 FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t)
28 : FormBaseBD(lv, d, t), ih_(0)
32 void FormInset::connect()
34 u_ = d_->updateBufferDependent.
35 connect(slot(this, &FormInset::updateSlot));
36 h_ = d_->hideBufferDependent.
37 connect(slot(this, &FormInset::hide));
38 FormBaseDeprecated::connect();
42 void FormInset::disconnect()
45 FormBaseBD::disconnect();
49 void FormInset::updateSlot(bool switched)
58 FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t)
59 : FormInset(lv, d, t),
64 void FormCommand::disconnect()
67 params = InsetCommandParams(string());
68 FormInset::disconnect();
72 void FormCommand::showInset(InsetCommand * inset)
74 if (inset == 0) return; // maybe we should Assert this?
76 // If connected to another inset, disconnect from it.
81 params = inset->params();
82 ih_ = inset->hideDialog.connect(slot(this, &FormCommand::hide));
87 void FormCommand::createInset(string const & arg)
94 params.setFromString(arg);
96 bc().valid(); // so that the user can press Ok