X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fxforms%2FxformsBC.h;h=085ca7174a378aeac3034b84374a4b7ede80761b;hb=37e82a546392d43f787826b85481a11f2a27af15;hp=d65ac7d714b9bf671cd5e9c88fde802202116a1f;hpb=9c36dd0f40f2e2e90fce8b2f33519a5d99d9be8b;p=lyx.git diff --git a/src/frontends/xforms/xformsBC.h b/src/frontends/xforms/xformsBC.h index d65ac7d714..085ca7174a 100644 --- a/src/frontends/xforms/xformsBC.h +++ b/src/frontends/xforms/xformsBC.h @@ -1,84 +1,45 @@ // -*- C++ -*- -/* This file is part of - * ====================================================== +/** + * \file xformsBC.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor + * \author Allan Rae + * \author Angus Leeming + * \author Baruch Even * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. - * - * This file Copyright 2000 - * Allan Rae - * ====================================================== - * - * Author: Allan Rae - * Non-xforms-specific code stripped-out and placed in a base class by - * Angus Leeming + * Full author contact details are available in file CREDITS. */ #ifndef XFORMSBC_H #define XFORMSBC_H -#include "ButtonController.h" -#include +#include "forms_fwd.h" -#ifdef __GNUG__ -#pragma interface -#endif +#include "BCView.h" +#include "gettext.h" -/** General purpose button controller for up to four buttons. - Controls the activation of the OK, Apply and Cancel buttons. - Actually supports 4 buttons in all and it's up to the user to decide on - the activation policy and which buttons correspond to which output of the - state machine. -*/ -class xformsBC : public ButtonControllerBase -{ +namespace lyx { +namespace frontend { + +class xformsBC : public GuiBC { public: /// - xformsBC(string const &, string const &); + xformsBC(ButtonController const &, + std::string const & = _("Cancel"), std::string const & = _("Close")); - /* Initialise Button Functions */ - /// Call refresh() when finished setting the buttons. - void setOK(FL_OBJECT * obj) { - okay_ = obj; - } - /// - void setApply(FL_OBJECT * obj) { - apply_ = obj; - } - /// - void setCancel(FL_OBJECT * obj) { - cancel_ = obj; - } - /// - void setUndoAll(FL_OBJECT * obj) { - undo_all_ = obj; - } - /// - void addReadOnly(FL_OBJECT * obj) { - read_only_.push_front(obj); - } - /// - void eraseReadOnly() { - read_only_.erase(read_only_.begin(), read_only_.end()); - } +private: + /// Updates the button sensitivity (enabled/disabled) + void setButtonEnabled(FL_OBJECT *, bool enabled) const; - /* Action Functions */ - /// force a refresh of the buttons - virtual void refresh(); + /// Updates the widget sensitivity (enabled/disabled) + void setWidgetEnabled(FL_OBJECT *, bool enabled) const; -private: - /// - FL_OBJECT * okay_; - /// - FL_OBJECT * apply_; - /// - FL_OBJECT * cancel_; - /// - FL_OBJECT * undo_all_; - /// List of items to be deactivated when in one of the read-only states - std::list read_only_; + /// Set the label on the button + void setButtonLabel(FL_OBJECT *, std::string const & label) const; }; +} // namespace frontend +} // namespace lyx + #endif // XFORMSBC_H