From: caballero Date: Tue, 10 Mar 2009 11:16:43 +0000 (+0000) Subject: Added selection reminder on sort functionality X-Git-Tag: EED.02Oct2009~149 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9342910b827ba2e5bf9dd39aaff8798ace7e9b7e;p=creaImageIO.git Added selection reminder on sort functionality --- diff --git a/src2/creaImageIOWxTreeView.cpp b/src2/creaImageIOWxTreeView.cpp index e80697a..b2998c7 100644 --- a/src2/creaImageIOWxTreeView.cpp +++ b/src2/creaImageIOWxTreeView.cpp @@ -210,7 +210,7 @@ namespace creaImageIO } } } - + return sel; } @@ -390,7 +390,7 @@ namespace creaImageIO wxListItem info; info.m_itemId = event.m_itemIndex; mLastSelected=event.m_itemIndex; - + // retrieve the level wxObject* obj = event.GetEventObject(); unsigned int level = 0; @@ -401,7 +401,12 @@ namespace creaImageIO GimmickDebugMessage(1, " Level "<::iterator selection; + std::vector change; long it = -1; for ( ;; ) { @@ -497,6 +505,21 @@ namespace creaImageIO //Gets current item data, extracts the node and resets it long item = GetCtrl(level)->GetItemData(it); GetCtrl(level)->SetItemData(it,((long*)item)[0]); + tree::Node* n= ((ItemData*)((long*)item)[0])->node; + for(selection=mSelected.begin();selection!=mSelected.end();++selection) + { + if((*selection)->GetAttribute("ID").compare(n->GetAttribute("ID"))==0) + { + change.push_back(it); + } + } + + } + std::vector::iterator selectedIts; + for(selectedIts=change.begin();selectedIts!=change.end();++selectedIts) + { + GetCtrl(level)->SetItemState(*selectedIts,wxLIST_STATE_SELECTED, wxLIST_MASK_STATE + | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT); } } diff --git a/src2/creaImageIOWxTreeView.h b/src2/creaImageIOWxTreeView.h index e71540a..60956fb 100644 --- a/src2/creaImageIOWxTreeView.h +++ b/src2/creaImageIOWxTreeView.h @@ -82,6 +82,8 @@ namespace creaImageIO bool mDirection; ///The last selected item on the list long mLastSelected; + + std::vector mSelected;