2 * \file ButtonControllerBase.C
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
12 #pragma implementation
16 #include "ButtonControllerBase.h"
17 #include "support/LAssert.h"
21 CheckedWidget::~CheckedWidget()
25 ButtonControllerBase::ButtonControllerBase(string const & cancel,
27 : cancel_label_(cancel), close_label_(close)
31 void ButtonControllerBase::ok()
33 input(ButtonPolicy::SMI_OKAY);
37 void ButtonControllerBase::input(ButtonPolicy::SMInput in)
39 if (ButtonPolicy::SMI_NOOP == in)
46 void ButtonControllerBase::apply()
48 input(ButtonPolicy::SMI_APPLY);
52 void ButtonControllerBase::cancel()
54 input(ButtonPolicy::SMI_CANCEL);
58 void ButtonControllerBase::restore()
60 input(ButtonPolicy::SMI_RESTORE);
64 void ButtonControllerBase::hide()
66 input(ButtonPolicy::SMI_HIDE);
70 void ButtonControllerBase::valid(bool v)
73 input(ButtonPolicy::SMI_VALID);
75 input(ButtonPolicy::SMI_INVALID);
80 void ButtonControllerBase::invalid()
82 input(ButtonPolicy::SMI_INVALID);
86 bool ButtonControllerBase::readOnly(bool ro)
88 lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl;
91 bp().input(ButtonPolicy::SMI_READ_ONLY);
93 bp().input(ButtonPolicy::SMI_READ_WRITE);
101 void ButtonControllerBase::readWrite()
107 void ButtonControllerBase::addCheckedWidget(CheckedWidget * ptr)
110 checked_widgets.push_back(checked_widget_ptr(ptr));
114 bool ButtonControllerBase::checkWidgets()
118 checked_widget_list::const_iterator it = checked_widgets.begin();
119 checked_widget_list::const_iterator end = checked_widgets.end();
121 for (; it != end; ++it) {
122 valid &= (*it)->check();
125 // return valid status after checking ALL widgets