Added a "quick search" box for filtering the card list

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1483 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2010-08-04 21:52:26 +00:00
parent 4532fade77
commit be922940a2
17 changed files with 239 additions and 15 deletions
+7
View File
@@ -55,6 +55,13 @@ String Card::identification() const {
}
}
bool Card::contains(String const& query) const {
FOR_EACH_CONST(v, data) {
if (v->toString().find(query) != String::npos) return true;
}
return false;
}
IndexMap<FieldP, ValueP>& Card::extraDataFor(const StyleSheet& stylesheet) {
return extra_data.get(stylesheet.name(), stylesheet.extra_card_fields);
}
+2
View File
@@ -61,6 +61,8 @@ class Card : public IntrusivePtrVirtualBase {
/// Get the identification of this card, an identification is something like a name, title, etc.
/** May return "" */
String identification() const;
/// Does any field contains the given query string?
bool contains(String const& query) const;
/// Find a value in the data by name and type
template <typename T> T& value(const String& name) {