Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 16-11-2020
Avatar de newtron
[newtron] newtron is offline
Membrillo Premium
 
Registrado: abr 2007
Ubicación: Motril, Granada
Posts: 4.214
Poder: 24
newtron Va camino a la fama
Claro, te lo paso aunque le he dado otra solución porque, como siempre, tengo el tiempo escaso y le estaba dando muchas vueltas a este tema.



Código Delphi [-]
procedure TFormPrincipal.MuestraArticulos(Grupo: String);
var
  Boton: TNTSB2;
  TextoEnIdioma: String;
  Posicion,Aumento: SmallInt;
  TopP,LeftP: SmallInt;
  ImagenBMP: TBitMap;
begin
  TopP:=3;
  LeftP:=3;
  if Debughook=0 then
    Aumento:=2
  else
    Aumento:=1;
  ScrollBox3:=TScrollBox.Create(nil);
  ScrollBox3.Left    := ScrollBox2.Left;
  ScrollBox3.Top     := ScrollBox2.Top;
  ScrollBox3.Height  := ScrollBox2.Height;
  ScrollBox3.Width   := ScrollBox2.Width;
  ScrollBox3.Parent  := FormPrincipal;
  FormMain.EDBQuery1.SQL.Clear;
  FormMain.EDBQuery1.SQL.Add('SELECT FAMILIA,CODIGO,DESCRIPCIO,IDIOMA1 FROM ARTICULOS A LEFT JOIN GRUPART B ON A.CODIGO=B.ARTICULO WHERE A.CODIGO='+QuotedStr(Grupo)+' ORDER BY B.POSICION');
  FormMain.EDBQuery1.ExecSQL;
  while not FormMain.EDBQuery1.Eof do begin
    if DlgPropiedades.Idioma=1 then begin
      TextoEnIdioma:=FormMain.EDBQuery1.FieldByName('DESCRIPCIO').AsString;
    end else if DlgPropiedades.Idioma=2 then begin
      TextoEnIdioma:=FormMain.EDBQuery1.FieldByName('IDIOMA1').AsString;
    end;
    // Creo botones artículos
    Boton:=TNTSB2.Create(nil);
    Boton.Name       := 'A'+FormMain.EdbQuery1.FieldByName('FAMILIA').AsString+FormMain.EdbQuery1.FieldByName('CODIGO').AsSt  ring;
    Boton.Tipo       := tTituloSimple;
    Boton.Caption    := TextoEnIdioma;
    Boton.Color      := clWhite;
    Boton.Parent     := ScrollBox3;
    Boton.Top        := TopP;
    Boton.Left       := LeftP;
    Boton.Width      := Trunc(134*Aumento);
    Boton.Height     := Trunc(162*Aumento);
    Boton.NTValor    := 'A*'+FormMain.EdbQuery1.FieldByName('FAMILIA').AsString+FormMain.EdbQuery1.FieldByName('CODIGO').AsS  tring;
    Boton.OnClick    := FormTomarLlevar.BotonPulsado;
    LeftP:= LeftP + Boton.Width  +3;
    if LeftP> (Boton.Width*2)+20 then begin
      TopP:= TopP + Boton.Height +3;
      LeftP:=3;
    end;
    Posicion:=DlgPropiedades.ListaArticulos.IndexOf(FormMain.EdbQuery1.FieldByName('FAMILIA').AsString+F  ormMain.EdbQuery1.FieldByName('CODIGO').AsString);
    DlgPropiedades.ImageListArticulos.GetBitmap(Posicion,Boton.Glyph);
    FormMain.EDBQuery1.Next;
  end;
  ScrollBox2.Visible := fALSE;
  ScrollBox3.BringToFront;
  PanelLadoD.BringToFront;
end;
__________________
Be water my friend.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Acceder a componentes creados en ejecución bulc Varios 5 01-03-2019 16:44:17
Error TStringList creados en tiempo de ejecución subzero Varios 14 26-01-2008 13:58:05
Destruir Qrlabels creados en tiempo de ejecucion Ade Impresión 6 08-10-2006 19:46:28
Eventos en componentes creados en tiempo de ejecucion joumont OOP 3 27-12-2005 14:48:23
Objetos creados en tiempo de ejecución Scocc OOP 4 13-06-2003 20:55:29


La franja horaria es GMT +2. Ahora son las 05:51:58.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi