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 "ButtonController.h"
29 /** General purpose button controller for up to four buttons.
30 Controls the activation of the OK, Apply and Cancel buttons.
31 Actually supports 4 buttons in all and it's up to the user to decide on
32 the activation policy and which buttons correspond to which output of the
35 class xformsBC : public ButtonControllerBase
39 xformsBC(string const &, string const &);
41 /* Initialise Button Functions */
42 /// Call refresh() when finished setting the buttons.
43 void setOK(FL_OBJECT * obj) {
47 void setApply(FL_OBJECT * obj) {
51 void setCancel(FL_OBJECT * obj) {
55 void setUndoAll(FL_OBJECT * obj) {
59 void addReadOnly(FL_OBJECT * obj) {
60 read_only_.push_front(obj);
63 void eraseReadOnly() {
64 read_only_.erase(read_only_.begin(), read_only_.end());
67 /* Action Functions */
68 /// force a refresh of the buttons
69 virtual void refresh();
79 FL_OBJECT * undo_all_;
80 /// List of items to be deactivated when in one of the read-only states
81 std::list<FL_OBJECT *> read_only_;