}
}
}
-
+
return sel;
}
<<"'"<<level
<<std::endl);
int _id=0;
+ int r=100;
+ int g=100;
+ int b=100;
//Adds columns
GetTreeHandler()->LoadChildren(*i,1);
tree::Node::ChildrenListType::reverse_iterator j;
data->node = *j;
item.SetId(_id);
- /*
- std::string a=(*j)->GetAttribute(mLevelList[l].key[mColumnSelected-1]);
- GimmickMessage(1,
- "State Check: Att VAL"
- <<a
- <<std::endl);
- */
+
data->id = _id;
item.SetData(data);
_id++;
-
- long id = GetCtrl(l)->InsertItem(item);
-
+ long id=GetCtrl(l)->InsertItem(item);
+
std::ostringstream oss;
int n= GetTreeHandler()->GetNumberOfChildren(*j);
item.SetText( crea::std2wx(s));
// item.SetTextColour(*wxRED);
- // item.SetBackgroundColour(*wxBLACK);
+
+ //Setting the color according to the parent
+ /*
+ if(l==0)
+ {
+ item.SetBackgroundColour(wxColour(r,g,b));
+ mColorMap.insert(NodeColorPair(*j,wxColour(r,g,b)));
+ }
+ else if(l!=mLevelList.size()-1)
+ {
+ item.SetBackgroundColour(mColorMap[*i]);
+ mColorMap.insert(NodeColorPair(*j,mColorMap[*i]));
+ }
+ else
+ {
+ item.SetBackgroundColour(mColorMap[*i]);
+ }
+ r+=20;
+ g+=20;
+ b+=20;*/
+
item.SetColumn(0);
- //Sets the last level as selecte....How to make it select only the first time?
+ //Sets the last level as selected....How to make it select only the first time?
//if (level==mLevelList.size()) item.SetState(wxLIST_STATE_SELECTED);
GetCtrl(l)->SetItem(item);
wxListItem info;
info.m_itemId = event.m_itemIndex;
mLastSelected=event.m_itemIndex;
-
+
// retrieve the level
wxObject* obj = event.GetEventObject();
unsigned int level = 0;
GimmickDebugMessage(1,
" Level "<<level+1
<<std::endl);
+
+
+ mSelected=GetSelected(level+2);
+
if (level<mLevelList.size()-1) UpdateLevel( level + 2 );
+
if (level==mLevelList.size()-1) ValidateSelectedImages ();
}
{
if ( GetCtrl(level) == ctrl ) break;
}
+
UpdateLevel(level+1);
+
wxBusyCursor busy;
int l = level - 1;
-
+
//Sets the data for the items to be sorted
std::string att;
unsigned int ty=0;
}
//Resets original data
-
+ std::vector<tree::Node*>::iterator selection;
+ std::vector<long> change;
long it = -1;
for ( ;; )
{
//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<long>::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);
}
}