]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormInset.C
Pass and store references to LyXView and Dialogs, not pointers in the
[lyx.git] / src / frontends / xforms / FormInset.C
1 /**
2  * \file FormInset.C
3  * Copyright 2000-2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Angus Leeming <leeming@lyx.org>
7  */
8
9 #include <config.h>
10
11 #include FORMS_H_LOCATION
12
13 #ifdef __GNUG__
14 #pragma implementation
15 #endif
16
17 #include "FormInset.h"
18
19 #include "frontends/Dialogs.h"
20
21 #include <boost/bind.hpp>
22
23 FormInset::FormInset(LyXView & lv, Dialogs & d, string const & t)
24         : FormBaseBD(lv, d, t)
25 {}
26
27
28 void FormInset::connect()
29 {
30         u_ = d_.updateBufferDependent.
31                 connect(boost::bind(&FormInset::updateSlot, this, _1));
32         h_ = d_.hideBufferDependent.
33                 connect(boost::bind(&FormInset::hide, this));
34         FormBaseDeprecated::connect();
35 }
36
37
38 void FormInset::disconnect()
39 {
40         ih_.disconnect();
41         FormBaseBD::disconnect();
42 }
43
44
45 void FormInset::updateSlot(bool switched)
46 {
47         if (switched)
48                 hide();
49         else
50                 update();
51 }