]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/BCView.cpp
fix scrolling bug: 3320 and 3652, maybe not perfect
[lyx.git] / src / frontends / controllers / BCView.cpp
1 /**
2  * \file BCView.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "BCView.h"
14 #include "ButtonController.h"
15
16 namespace lyx {
17 namespace frontend {
18
19 BCView::BCView(ButtonController const & p)
20         : parent(p)
21 {}
22
23
24 ButtonPolicy & BCView::bp() const
25 {
26         return parent.bp();
27 }
28
29
30 void BCView::addCheckedWidget(CheckedWidget * ptr)
31 {
32         if (ptr)
33                 checked_widgets.push_back(checked_widget_ptr(ptr));
34 }
35
36
37 bool BCView::checkWidgets() const
38 {
39         bool valid = true;
40
41         checked_widget_list::const_iterator it  = checked_widgets.begin();
42         checked_widget_list::const_iterator end = checked_widgets.end();
43
44         for (; it != end; ++it) {
45                 valid &= (*it)->check();
46         }
47
48         // return valid status after checking ALL widgets
49         return valid;
50 }
51
52 } // namespace frontend
53 } // namespace lyx