Jump to content

Criar Panel em tempo de execução


eduardosuruagy

Recommended Posts

I'm creating a Panels table at run time, this table is being created inside the UniContainerPanel component.
The UniContainerPanel is configured like this:
Layout: table
LayoutAttribs.Columns: 5

But at the time of creating the Panels they exceed the limit of the UniContainerPanel both on the right side and down and also they are of different sizes.
I also wanted that when I passed or mouse over one of them, it would have an effect similar to the uniButton effect.
To create the Panels I did:

      for I := 0 to 20 do
      begin
        with TUniPanel.Create(Self) do
        begin
          Parent             := UniContainerPanel1;
          Caption            := 'Sem Informação';
          Name               := 'UniPanelTable'+IntToStr(I);
          Height             := 70;
          LayoutConfig.Width := '100%';
          Tag                := 0;

          Title              := 'Sem Informação';
          TitleAlign         := taCenter;
          TitleVisible       := True;

          LayoutConfig.Margin := '10 10 0 10';  //Topo / Direita / Baixo / Esquerda
          //LayoutConfig.Flex   := 1;

          ClientEvents.ExtEvents.Add('OnMouseover=function OnMouseover(sender)' +
                                     '  { sender.setBodyStyle("background-color","#303030"); }');

          ClientEvents.ExtEvents.Add('OnMouseout=function OnMouseout(sender)' +
                                     '  { sender.setBodyStyle("background-color","#414141"); }');

          OnClick := MostrarDisciplinas;
          Cursor  := crHandPoint;
        end;
      end;
 

Link to comment
Share on other sites

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...