8 #include "gtk--/widget.h"
9 #include "gtk--/button.h"
11 gnomeBC::gnomeBC(string const & cancel, string const & close)
12 : ButtonControllerBase(cancel, close),
13 okay_(0), apply_(0), cancel_(0), undo_all_(0)
17 void gnomeBC::setSensitive(Gtk::Button * btn, ButtonPolicy::Button id)
20 bool const enabled = bp().buttonStatus(id);
21 btn->set_sensitive(enabled);
26 void gnomeBC::refresh()
28 setSensitive(okay_, ButtonPolicy::OKAY);
29 setSensitive(apply_, ButtonPolicy::APPLY);
30 setSensitive(undo_all_, ButtonPolicy::UNDO_ALL);
32 #warning Handle the cancel button correctly! (be 20010327)
35 bool const enabled = bp().buttonStatus(ButtonPolicy::CANCEL);
37 // Change label to cancel_label_
39 // Change label to close_label_
40 //Need to adapt it somehow since we use stock Gnome buttons.
44 if (!read_only_.empty()) {
46 if (bp().isReadOnly()) enable = false;
48 WidgetList::const_iterator end = read_only_.end();
49 for (WidgetList::const_iterator iter = read_only_.begin();
50 iter != end; ++iter) {
51 (*iter)->set_sensitive(enable);