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>
31 #include "ButtonController.h"
33 /** General purpose button controller for up to four buttons.
34 Controls the activation of the OK, Apply and Cancel buttons.
35 Actually supports 4 buttons in all and it's up to the user to decide on
36 the activation policy and which buttons correspond to which output of the
39 class qt2BC : public ButtonControllerBase
43 qt2BC(string const &, string const &);
45 /* Initialise Button Functions */
46 /// Call refresh() when finished setting the buttons.
47 void setOK(QButton * obj) {
51 void setApply(QButton * obj) {
55 void setCancel(QButton * obj) {
59 void setUndoAll(QButton * obj) {
63 void addReadOnly(QWidget * obj) {
64 read_only_.push_front(obj);
67 void eraseReadOnly() {
68 read_only_.erase(read_only_.begin(), read_only_.end());
71 /* Action Functions */
72 /// force a refresh of the buttons
73 virtual void refresh();
84 /// List of items to be deactivated when in one of the read-only states
85 std::list<QWidget *> read_only_;