]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/gnomeBC.h
Clean-up of the button controller.
[lyx.git] / src / frontends / gnome / gnomeBC.h
index 8f0524e4406938b314b671a67baffc44a56e6ad8..1b7f20073632dcd5f37196a3db7af978a7836afc 100644 (file)
 #ifndef GNOMEBC_H
 #define GNOMEBC_H
 
-#include "ButtonController.h"
-#include <list>
-
 #ifdef __GNUG__
 #pragma interface
 #endif
 
+#include "ButtonController.h"
+
 namespace Gtk {
 class Button;
 class Widget;
-}
+};
 
-class gnomeBC : public ButtonControllerBase
+class gnomeBC : public GuiBC<Gtk::Button, Gtk::Widget>
 {
 public:
        ///
        gnomeBC(string const & cancel, string const & close);
 
-       /* Initialise Button Functions */
-       /// Call refresh() when finished setting the buttons.
-       void setOK(Gtk::Button * obj) {
-               okay_ = obj;
-       }
-       ///
-       void setApply(Gtk::Button * obj) {
-               apply_ = obj;
-       }
-       ///
-       void setCancel(Gtk::Button * obj) {
-               cancel_ = obj;
-       }
-       ///
-       void setUndoAll(Gtk::Button * obj) {
-               undo_all_ = obj;
-       }
-       ///
-       void addReadOnly(Gtk::Widget * obj) {
-               read_only_.push_front(obj);
-       }
-       ///
-       void eraseReadOnly() {
-               read_only_.clear();
-       }
-
-       /* Action Functions */
-       /// force a refresh of the buttons
-       virtual void refresh();
-
 private:
        /// Updates the button sensitivity (enabled/disabled)
-       void setSensitive(Gtk::Button * btn, ButtonPolicy::Button id);
-       ///
-       Gtk::Button * okay_;
-       ///
-       Gtk::Button * apply_;
-       ///
-       Gtk::Button * cancel_;
-       ///
-       Gtk::Button * undo_all_;
-       /// List of items to be deactivated when in one of the read-only states
-       typedef std::list<Gtk::Widget *> WidgetList;
-       WidgetList read_only_;
+       void setButtonEnabled(Gtk::Button * btn, bool enabled);
+
+       /// Updates the widget sensitivity (enabled/disabled)
+       void setWidgetEnabled(Gtk::Widget * obj, bool enabled);
+
+       /// Set the label on the button
+       void setButtonLabel(Gtk::Button * btn, string const & label);
 };
 
 #endif // GNOMEBC_H