3 * Copyright 2001 the LyX Team
4 * Read the file COPYING
6 * \author Allan Rae <rae@lyx.org>
7 * \author Angus Leeming <a.leeming@ic.ac.uk>
13 #pragma implementation
17 #include "xforms_helpers.h"
20 xformsBC::xformsBC(string const & cancel, string const & close)
21 : ButtonControllerBase(cancel, close),
22 okay_(0), apply_(0), cancel_(0), undo_all_(0), read_only_()
26 void xformsBC::refresh()
29 if (bp().buttonStatus(ButtonPolicy::OKAY)) {
30 setEnabled(okay_, true);
32 setEnabled(okay_, false);
36 if (bp().buttonStatus(ButtonPolicy::APPLY)) {
37 setEnabled(apply_, true);
39 setEnabled(apply_, false);
43 if (bp().buttonStatus(ButtonPolicy::UNDO_ALL)) {
44 setEnabled(undo_all_, true);
46 setEnabled(undo_all_, false);
50 if (bp().buttonStatus(ButtonPolicy::CANCEL)) {
51 fl_set_object_label(cancel_, cancel_label.c_str());
53 fl_set_object_label(cancel_, close_label.c_str());
56 if (!read_only_.empty()) {
58 if (bp().isReadOnly()) enable = false;
60 for (std::list<FL_OBJECT *>::iterator iter = read_only_.begin();
61 iter != read_only_.end(); ++iter) {
62 setEnabled(*iter, enable);