2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * This file Copyright 2000
12 * ======================================================
14 * Author: Allan Rae <rae@lyx.org>
15 * Non-xforms-specific code stripped-out and placed in a base class by
16 * Angus Leeming <a.leeming@ic.ac.uk>
22 #include FORMS_H_LOCATION
29 #include "ButtonController.h"
31 /** General purpose button controller for up to four buttons.
32 Controls the activation of the OK, Apply and Cancel buttons.
33 Actually supports 4 buttons in all and it's up to the user to decide on
34 the activation policy and which buttons correspond to which output of the
37 class xformsBC : public ButtonControllerBase
41 xformsBC(string const &, string const &);
43 /* Initialise Button Functions */
44 /// Call refresh() when finished setting the buttons.
45 void setOK(FL_OBJECT * obj) {
49 void setApply(FL_OBJECT * obj) {
53 void setCancel(FL_OBJECT * obj) {
57 void setUndoAll(FL_OBJECT * obj) {
61 void addReadOnly(FL_OBJECT * obj) {
62 read_only_.push_front(obj);
65 void eraseReadOnly() {
66 read_only_.erase(read_only_.begin(), read_only_.end());
69 /* Action Functions */
70 /// force a refresh of the buttons
71 virtual void refresh();
81 FL_OBJECT * undo_all_;
82 /// List of items to be deactivated when in one of the read-only states
83 std::list<FL_OBJECT *> read_only_;