Jump to content

Recommended Posts

Posted
 
hi, how can i clear a UnimFieldSet and write again?
this is my code.

 

procedure TPrincipal.Listagem;
var
FrameSoma : TFFrameProduto;
item      : TUnimFieldContainer;
i,EOF     : Integer;
begin


  eof := MainModule.UniMainModule.DataSourceProd.DataSet.RecordCount;
         MainModule.UniMainModule.DataSourceProd.DataSet.First;
    try
       UnimFieldSet1.BeginUpdate;

       for I := 1 to eof do
       begin
          FrameSoma        := TFFrameProduto.Create(self);
          item             := TUnimFieldContainer.Create(self);
          FrameSoma.Name   := 'frame'+ I.ToString;
          FrameSoma.Parent := item;
         // item.Height      := 50;
          //item.Width       := FPrincipal.Width;

          FrameSoma.UnimLabel1.Caption := (MainModule.UniMainModule.FDQProd.FieldByName('produto').AsString);
          FrameSoma.UnimImage1.Picture.LoadFromFile(MainModule.UniMainModule.FDQProd.FieldByName('imagem').AsString);
          FrameSoma.UnimLabel2.Caption := 'Valor '+(MainModule.UniMainModule.FDQProd.FieldByName('Valor').AsString);
          FrameSoma.UnimLabel3.Caption := (MainModule.UniMainModule.FDQProd.FieldByName('Descricao').AsString);
          item.Parent := UnimFieldSet1;

          begin
           MainModule.UniMainModule.DataSourceProd.DataSet.Next;
           UnimFieldSet1.EndUpdate;

          end;

       end;

      Except

      end

end;

  • Sherzod changed the title to Problems when using UnimFieldSet
Posted

 

 

 
hi Sherzod, I'm using unigui 1.90.0.1530. I am trying to solve the problem with this code.

procedure TPrincipal.ApagarLista;
var
i,EOF     : Integer;
Campo: TComponent;
begin

  eof := MainModule.UniMainModule.DataSourceProd.DataSet.RecordCount;
         MainModule.UniMainModule.DataSourceProd.DataSet.First;
    try
       for I := 0 to eof do
       begin
       Campo := FindComponent('frame'+ I.ToString);
        if not (Campo = nil) then
         begin
         Campo.Free;
         end;
        end;
        MainModule.UniMainModule.DataSourceProd.DataSet.Next;
    finally
       begin
       UnimFieldSet1.Container.RemoveAll;
       end;

    end;
end;

Posted
 
no, I was having trouble cleaning up the creation of a component (parent), I believe it worked!
thank you very much Sherzod. it's 2:15am here, I'm already very tired

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...