Ver Mensaje Individual
  #4  
Antiguo 30-10-2014
Avatar de aguml
aguml aguml is offline
Miembro
 
Registrado: may 2013
Posts: 885
Reputación: 14
aguml Va por buen camino
No me entendisteis, yo tengo esto:
Código PHP:
void __fastcall TForm1::ButRefrescarProcClick(TObject *Sender)
{
    
ListItemsProcesos->Clear();
    
llenarLista();
   if(
LastShortedColumn != -1)
   { 
//Aqui la funcion que ordene todo por la columna deseada
      
   
}
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ListViewProcesosColumnClick(TObject *Sender,
      
TListColumn *Column)
{
   
LastShortedColumn Column->Index;
    
ColumnToSort Column->Index;
    ((
TCustomListView *)Sender)->AlphaSort();
}
//---------------------------------------------------------------------------

void __fastcall TForm1::ListViewProcesosCompare(TObject *Sender,
      
TListItem *Item1TListItem *Item2int Dataint &Compare)
{
    if (
ColumnToSort == 0)
        
Compare CompareText(Item1->Caption,Item2->Caption);
    else if(
ColumnToSort == 1)
    {
        
Compare Item1->SubItems->Strings[0].ToInt() - Item2->SubItems->Strings[0].ToInt();
    }
    else if(
ColumnToSort == 2)
    {
        
Compare CompareText(Item1->SubItems->Strings[1], Item2->SubItems->Strings[1]);
    }
    else if(
ColumnToSort == || ColumnToSort == 4)
    {
        
Compare Item1->SubItems->Strings[2].ToInt() - Item2->SubItems->Strings[2].ToInt();
    }
}
//--------------------------------------------------------------------------- 
Lo que quiero es que cuando haga clic en el boton ButRefrescarProc me limpie la lista, la rellene, y la ordene, sin tener que hacer clic en ninguna columna.
Responder Con Cita