// the selection of upper level
std::vector<tree::Node*>& sel(mLevelList[level-1].Selected);
sel.clear();
-
- if (level == 1)
+ if (level == 1)
{
sel.push_back(GetTreeHandler()->GetTree().GetTree());
}
else if (level < 5)
{
- int n = GetCtrl(l-1)->GetItemCount();
- for (int i = 0; i < n; i++)
+ long item = -1;
+ for ( ;; )
+ {
+ item = GetCtrl(l-1)->GetNextItem(item,
+ wxLIST_NEXT_ALL,
+ wxLIST_STATE_SELECTED);
+ if ( item == -1 )
+ break;
+ long adr = GetCtrl(l-1)->GetItemData(item);
+ tree::Node* n = ((ItemData*)adr)->node;
+ if(mLastSelected==item)
+ {
+ std::vector<tree::Node*>::iterator it;
+ it = sel.begin();
+ it = sel.insert ( it , n );
+ }
+ else
+ {
+
+ sel.push_back(n);
+ }
+
+ }
+ /*int n = GetCtrl(l-1)->GetItemCount();
+ for (int i = 0; i<n; i++)
{
+ std::cout<<GetCtrl(l-1)->GetItemState(i,wxLIST_STATE_SELECTED)<<std::endl;
if ( GetCtrl(l-1)->GetItemState(i,wxLIST_STATE_SELECTED))
{
long adr = GetCtrl(l-1)->GetItemData(i);
}
else
{
+
sel.push_back(n);
}
}
- }
+ }*/
}
else
{
// NOTHING
- }
-
-
+ }
// return mLevelList[level-1].Selected;
return sel;
//================================================================
void WxTreeView::OnItemSelected(wxListEvent& event)
{
+
GimmickDebugMessage(1,
GetTreeHandler()->GetTree().GetLabel()
<<" WxTreeView::OnItemSelected"<<std::endl);
{
if(event.GetEventType()==wxEVT_COMMAND_LIST_ITEM_SELECTED)
{
- ValidateSelectedImages (true);
+ ValidateSelectedImages (true);
}
else
{
- ValidateSelectedImages (false);
+ ValidateSelectedImages (false);
}
}
GimmickDebugMessage(7,
"WxTreeView::OnEndLabelEdit"
<<std::endl);
- wxObject* ctrl = event.GetEventObject();
unsigned int level = 0;
for (level = 0; level<mLevelList.size(); ++level)
{