Allow multiple cards to be selected in a card list,

Allow card actions to add/remove multiple cards.
not yet: actually use these multicard actions.

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@853 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2008-05-17 01:51:50 +00:00
parent 1b516e781f
commit c666e98645
14 changed files with 145 additions and 149 deletions
+8 -4
View File
@@ -57,10 +57,10 @@ void KeywordList::onChangeSet() {
}
void KeywordList::onAction(const Action& action, bool undone) {
TYPE_CASE(action, AddKeywordAction) {
/*TYPE_CASE(action, AddKeywordAction) {
if (action.adding != undone) {
// select the new keyword
selectItem(action.keyword, false /*list will be refreshed anyway*/, true);
selectItem(action.keyword, false /*list will be refreshed anyway* /, true);
refreshList();
} else {
long pos = selected_item_pos;
@@ -74,7 +74,7 @@ void KeywordList::onAction(const Action& action, bool undone) {
}
}
}
}
}*/ // TODO!!!
TYPE_CASE(action, ValueAction) {
if (!action.card) {
KeywordTextValue* value = dynamic_cast<KeywordTextValue*>(action.valueP.get());
@@ -117,7 +117,7 @@ bool KeywordList::doCut() {
// cut = copy + delete
if (!canCut()) return false;
if (!doCopy()) return false;
set->actions.add(new AddKeywordAction(REMOVE, *set, getKeyword()));
doDelete();
return true;
}
bool KeywordList::doPaste() {
@@ -137,6 +137,10 @@ bool KeywordList::doPaste() {
return false;
}
}
bool KeywordList::doDelete() {
set->actions.add(new AddKeywordAction(REMOVE, *set, getKeyword()));
return true;
}
// ----------------------------------------------------------------------------- : KeywordListBase : for ItemList