level.wxSplitter->Initialize(ctrl);
// Create the first column : number of children
-
+ if(i<handler->GetTree().GetNumberOfLevels()-1)
+ {
std::string title = "#";
if (i<handler->GetTree().GetNumberOfLevels()-1)
{
title += "s";
}
ctrl->InsertColumn(0,crea::std2wx(title),col_style);
-
+ }
// Create the columns : one for each attribute of the level
int col = 1;
int _id=1;
//Adds items (other than the first) and sets their attributes
- GetCtrl(l)->InsertItem(0, _T("hELLO"));
+ GetCtrl(l)->InsertItem(0, _T(""));
GetTreeHandler()->LoadChildren(*i,1);
tree::Node::ChildrenListType::reverse_iterator j;
for (j = (*i)->GetChildrenList().rbegin();
//GetCtrl(l)->SetItem(item);
//Setting other attributes
- for (int k=1; k<GetCtrl(l)->GetColumnCount(); k++)
+ if(level<mLevelList.size())
+ {
+ for (int k=1; k<GetCtrl(l)->GetColumnCount(); k++)
{
-
- std::string val = (*j)->GetAttribute(mLevelList[l].key[k-1]);
- if (val.size()==0) val = "?";
- item->SetText( crea::std2wx(val));
- item->SetColumn(k);
- GetCtrl(l)->SetItem(*item);
- GetCtrl(l)->RefreshItem(*item);
+ std::string val = (*j)->GetAttribute(mLevelList[l].key[k-1]);
+ if (val.size()==0) val = "?";
+ item->SetText( crea::std2wx(val));
+ item->SetColumn(k);
+ GetCtrl(l)->SetItem(*item);
+ GetCtrl(l)->RefreshItem(*item);
+ }
+ }
+ else
+ {
+ for (int k=0; k<GetCtrl(l)->GetColumnCount(); k++)
+ {
+ std::string val = (*j)->GetAttribute(mLevelList[l].key[k]);
+ if (val.size()==0) val = "?";
+ item->SetText( crea::std2wx(val));
+ item->SetColumn(k);
+ GetCtrl(l)->SetItem(*item);
+ GetCtrl(l)->RefreshItem(*item);
}
+ }
}
GetCtrl(l)->DeleteItem(0);
if ( GetCtrl(level) == senderCtrl ) break;
}
clientpt.x+=(mColumnSelected)*(GetCtrl(0)->GetColumnWidth(mColumnSelected));
- clientpt.x+=level*105;
- clientpt.y+=level*2;
- wxPoint screenpt = ClientToScreen(clientpt);
- if(mColumnSelected!=0)
+ for(int i=0;i<level;i++)
{
- PopupMenu(menu, clientpt);
+ clientpt.x+=GetSplitter(i)->GetSashPosition();
+ }
+ clientpt.y+=level*2;
+ if(level==mLevelList.size()-1)
+ {
+ mColumnSelected+=1;
+ PopupMenu(menu, clientpt);
+ }
+ else if(mColumnSelected!=0)
+ {
+ PopupMenu(menu, clientpt);
}
}
long it = -1;
UpdateLevel(level+1);
+ std::vector<long> items;
+ bool in=false;
+ int del=0;
for ( ;; )
{
- bool contains=false;
it = GetCtrl(level)->GetNextItem(it,
wxLIST_NEXT_ALL);
if ( it == -1 )
tree::Node* nod = ((ItemData*)adr)->node;
att=(*nod).GetAttribute(mLevelList[level].key[mColumnSelected-1]);
+
if(att.find(filter)>900)
{
- GetCtrl(level)->DeleteItem(it);
+
+ if(!in)
+ {
+ in=true;
+ }
+ else
+ {
+ del+=1;
+ }
+
+ items.push_back(it-del);
}
}
+ std::vector<long>::iterator iter;
+ for(iter=items.begin();iter!=items.end();++iter)
+ {
+ GetCtrl(level)->DeleteItem(*iter);
+ }
GetGimmickView()->ClearSelection();
}
//================================================================
{
//Obtain the column name and the level that needs to be organized
- if(mColumnSelected!=0)
+ if(level==mLevelList.size()-1||mColumnSelected!=0)
{
int l = level - 1;
//GetCtrl(level)->DeleteItem(0);