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
13 #include "ButtonControllerBase.h"
14 #include "support/LAssert.h"
18 CheckedWidget::~CheckedWidget()
22 ButtonControllerBase::ButtonControllerBase(string const & cancel,
24 : cancel_label_(cancel), close_label_(close)
28 void ButtonControllerBase::ok()
30 input(ButtonPolicy::SMI_OKAY);
34 void ButtonControllerBase::input(ButtonPolicy::SMInput in)
36 if (ButtonPolicy::SMI_NOOP == in)
43 void ButtonControllerBase::apply()
45 input(ButtonPolicy::SMI_APPLY);
49 void ButtonControllerBase::cancel()
51 input(ButtonPolicy::SMI_CANCEL);
55 void ButtonControllerBase::restore()
57 input(ButtonPolicy::SMI_RESTORE);
61 void ButtonControllerBase::hide()
63 input(ButtonPolicy::SMI_HIDE);
67 void ButtonControllerBase::valid(bool v)
70 input(ButtonPolicy::SMI_VALID);
72 input(ButtonPolicy::SMI_INVALID);
77 void ButtonControllerBase::invalid()
79 input(ButtonPolicy::SMI_INVALID);
83 bool ButtonControllerBase::readOnly(bool ro)
85 lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl;
88 bp().input(ButtonPolicy::SMI_READ_ONLY);
90 bp().input(ButtonPolicy::SMI_READ_WRITE);
98 void ButtonControllerBase::readWrite()
104 void ButtonControllerBase::addCheckedWidget(CheckedWidget * ptr)
107 checked_widgets.push_back(checked_widget_ptr(ptr));
111 bool ButtonControllerBase::checkWidgets()
115 checked_widget_list::const_iterator it = checked_widgets.begin();
116 checked_widget_list::const_iterator end = checked_widgets.end();
118 for (; it != end; ++it) {
119 valid &= (*it)->check();
122 // return valid status after checking ALL widgets