Added filter box for keywords

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1615 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2011-01-16 13:34:50 +00:00
parent e74f883345
commit d217349148
17 changed files with 908 additions and 880 deletions
+11 -2
View File
@@ -56,6 +56,11 @@ void KeywordList::onChangeSet() {
refreshList();
}
void KeywordList::setFilter(const KeywordListFilterP& filter) {
this->filter = filter;
refreshList();
}
void KeywordList::onAction(const Action& action, bool undone) {
TYPE_CASE(action, AddKeywordAction) {
if (action.action.adding != undone) {
@@ -151,11 +156,15 @@ String match_string(const Keyword& a) {
void KeywordList::getItems(vector<VoidP>& out) const {
FOR_EACH(k, set->keywords) {
k->fixed = false;
out.push_back(k);
if (!filter || filter->keep(*k)) {
out.push_back(k);
}
}
FOR_EACH(k, set->game->keywords) {
k->fixed = true;
out.push_back(k);
if (!filter || filter->keep(*k)) {
out.push_back(k);
}
}
}
void KeywordList::sendEvent() {