Ver Mensaje Individual
  #9  
Antiguo 14-06-2007
Avatar de MaMu
MaMu MaMu is offline
Miembro
 
Registrado: abr 2006
Ubicación: Argentina
Posts: 863
Reputación: 19
MaMu Va por buen camino
Tengo un problema, yo creo los frames (TThumb) en run-time, y los libero cuando ya no los necesito, como para poder volver a cargarlos cuando yo quiera. Es que, hice dos formas de vista, una por filas en un ListView y el otro este Thumbnails. El procedimiento que uso es el siguiente:

Código Delphi [-]
procedure TMain.PageControl2Change(Sender: TObject);
var g,TheTop,Cant,h,j:integer;
    Thumb:TThumb;
begin
  if PageControl2.TabIndex=0
    then begin
     for j := Main.componentcount - 1 downto 0 do
        begin
       //solo la puse para ver si la clase TThumb aparecia, pero no aparece nunca    
       //   showmessage(Main.components[j].ClassName);      
         if Main.components[j] is TThumb
          then begin
          Main.components[j].Free;
          end;
        end;
    end;
  if PageControl2.TabIndex=1
    then begin
      TheTop:=0;
      h:=0; //horizontal
      Cant:=Lista.Count;
   try
      for g:=0 to Cant-1 do
        begin
          Thumb:=TThumb.Create(Main.JvThumbView1);
          Thumb.Name:='Thumb'+IntToStr(g);
          Thumb.Panel1.Caption:='# '+IntToStr(g+1);
          Thumb.dxCheckbox1.Checked:=False;
          Thumb.JvThumbnail1.FileName:=Lista.Strings[g];
          Thumb.JvThumbnail1.Title:=Resolucion(Lista.Strings[g]);
          Thumb.Left:=((h+1)-1) * Thumb.Width;
          if Thumb.Left=720
            then begin
                  TheTop:=TheTop+Thumb.Height;
                  Thumb.Left:=0;
                  h:=0;
                 end;
          Thumb.Top:=TheTop;
          Thumb.Parent:=Main.JvThumbView1;
          h:=h+1;
        end;
    finally
      Thumb.Free;
      Thumb:=nil;
      end;
    end;
end;

Mi unico problema, es que no se como liberar los Thumbs creados, ya que me salta "component Thumb0 already exists".
__________________
Código Delphi [-]
 
try 
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;
Responder Con Cita