mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 14:05:59 +00:00
change ButtonController's trigger_change_ vector to dont_trigger_change.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1518 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6512edb15a
commit
50be761b25
@ -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<FL_OBJECT *>::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 {
|
||||
|
@ -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<FL_OBJECT *> read_only_;
|
||||
/// List of items that will trigger a change in activation status.
|
||||
std::vector<FL_OBJECT *> trigger_change_;
|
||||
/// container of items that do not trigger a change in activation status
|
||||
std::vector<FL_OBJECT *> dont_trigger_change_;
|
||||
///
|
||||
char const * cancel_label;
|
||||
///
|
||||
|
@ -1,3 +1,12 @@
|
||||
2001-02-15 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* 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 <larsbj@lyx.org>
|
||||
|
||||
* ButtonController.C: include algorithm
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user