- //Gets current item data
- long adr = GetCtrl(level)->GetItemData(i);
- //Extracts the node and the type of attribute
- tree::Node* nod = ((ItemData*)adr)->node;
- if(i==0)
- {
- (*nod).GetAttributeDescriptor(mLevelList[level].key[mColumnSelected-1]).DecodeType(ty);
- }
- //Obtains the organizing attribute
- att=(*nod).GetAttribute(mLevelList[level].key[mColumnSelected-1]);
-
- char* d= new char [att.size()+1];
- strcpy (d, att.c_str());
-
- //Creates array
- long* lp= new long[2];
- lp[0]=adr;
- lp[1]=(long)d;
-
- //Sets it as the data
- GetCtrl(level)->SetItemData(i,(long)lp);
- }
-
- //int ty=GetAttributeDescriptor(mLevelList[level].key[mColumnSelected-1]).GetType();
- if(mDirection)
- {
- if(ty==1)
- {
- GetCtrl(level)->SortItems(CompareFunctionInts, 0);
- }
- else
- {
- GetCtrl(level)->SortItems(CompareFunctionStrings, 0);
- }
-
- mDirection=false;
- }
- else
- {
- if(ty==1)
- {
- GetCtrl(level)->SortItems(CompareFunctionInts, 1);
- }
- else
- {
- GetCtrl(level)->SortItems(CompareFunctionStrings, 1);
- }
- mDirection=true;
- }
+ if(mDirection)
+ {
+ if(ty==1)
+ {
+ GetCtrl(level)->SortItems(CompareFunctionInts, 0);
+ }
+ else
+ {
+ GetCtrl(level)->SortItems(CompareFunctionStrings, 0);
+ }
+
+ mDirection=false;
+ }
+ else
+ {
+ if(ty==1)
+ {
+ GetCtrl(level)->SortItems(CompareFunctionInts, 1);
+ }
+ else
+ {
+ GetCtrl(level)->SortItems(CompareFunctionStrings, 1);
+ }
+ mDirection=true;
+ }