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
23 #include "FormInset.h"
25 FormInset::FormInset(LyXView * lv, Dialogs * d, string const & t,
27 char const * close, char const * cancel)
28 : FormBaseBD(lv, d, t, bp, close, cancel), 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));
42 void FormInset::disconnect()
45 FormBaseBD::disconnect();
49 void FormInset::updateSlot(bool switched)
58 FormCommand::FormCommand(LyXView * lv, Dialogs * d, string const & t,
60 char const * close, char const * cancel)
61 : FormInset(lv, d, t, bp, close, cancel),
66 void FormCommand::disconnect()
69 params = InsetCommandParams(string());
70 FormInset::disconnect();
74 void FormCommand::showInset(InsetCommand * inset)
76 if (inset == 0) return; // maybe we should Assert this?
78 // If connected to another inset, disconnect from it.
83 params = inset->params();
84 ih_ = inset->hide.connect(slot(this, &FormCommand::hide));
89 void FormCommand::createInset(string const & arg)
96 params.setFromString(arg);
98 bc_.valid(); // so that the user can press Ok