diff --git a/src/frontends/xforms/ButtonController.C b/src/frontends/xforms/ButtonController.C index d7eac9012e..9e497995c6 100644 --- a/src/frontends/xforms/ButtonController.C +++ b/src/frontends/xforms/ButtonController.C @@ -19,7 +19,7 @@ using std::vector; ButtonController::ButtonController(ButtonPolicy * bp, char const * cancel, char const * close) : bp_(bp), okay_(0), apply_(0), cancel_(0), undo_all_(0), - read_only_(), trigger_change_(), + read_only_(), dont_trigger_change_(), cancel_label(cancel), close_label(close) { Assert(bp); @@ -150,13 +150,14 @@ void ButtonController::readWrite() bool ButtonController::valid(bool v, FL_OBJECT * obj) { - if (obj && !trigger_change_.empty()) { + if (obj && !dont_trigger_change_.empty()) { vector::const_iterator cit = - find(trigger_change_.begin(), trigger_change_.end(), + find(dont_trigger_change_.begin(), + dont_trigger_change_.end(), obj); - // Only trigger a change if the obj is in the list - if (cit != trigger_change_.end()) { + // Only trigger a change if the obj is not in the list + if (cit == dont_trigger_change_.end()) { if (v) { input(ButtonPolicy::SMI_VALID); } else { diff --git a/src/frontends/xforms/ButtonController.h b/src/frontends/xforms/ButtonController.h index 3f3e661b92..3b22b692cc 100644 --- a/src/frontends/xforms/ButtonController.h +++ b/src/frontends/xforms/ButtonController.h @@ -90,12 +90,12 @@ public: } /// - void addTriggerChange(FL_OBJECT * obj) { - trigger_change_.push_back(obj); + void addDontTriggerChange(FL_OBJECT * obj) { + dont_trigger_change_.push_back(obj); } /// - void eraseTriggerChange() { - trigger_change_.clear(); + void eraseDontTriggerChange() { + dont_trigger_change_.clear(); } /* Action Functions */ @@ -135,8 +135,8 @@ private: FL_OBJECT * undo_all_; /// List of items to be deactivated when in one of the read-only states std::list read_only_; - /// List of items that will trigger a change in activation status. - std::vector trigger_change_; + /// container of items that do not trigger a change in activation status + std::vector dont_trigger_change_; /// char const * cancel_label; /// diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 6555f1ec19..feb2762780 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2001-02-15 Angus Leeming + + * ButtonController.[Ch]: changed trigger_change_ vector and associated + methods to dont_trigger_change_ because FL_OBJECTs that trigger a + callback to InputCB() but don't trigger a change in the state of the + Ok, Apply buttons are much rarer than those that do. + + * FormCitation.C (build): associated change. + 2001-02-14 Lars Gullik Bjønnes * ButtonController.C: include algorithm diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index d9fee9a18e..6fec1353cb 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -97,12 +97,8 @@ void FormCitation::build() bc_.addReadOnly(dialog_->textBefore); bc_.addReadOnly(dialog_->textAftr); - bc_.addTriggerChange(dialog_->addBtn); - bc_.addTriggerChange(dialog_->delBtn); - bc_.addTriggerChange(dialog_->upBtn); - bc_.addTriggerChange(dialog_->downBtn); - bc_.addTriggerChange(dialog_->textBefore); - bc_.addTriggerChange(dialog_->textAftr); + bc_.addDontTriggerChange(dialog_->citeBrsr); + bc_.addDontTriggerChange(dialog_->bibBrsr); }