import.css=/download/attachments/6062824/tecnologia.css |
Insere um componente no layout.
addInLayout( < oControl >, [ nRow ], [ nColumn ], [ nRowSpan ], [ nColumnSpan ], [ nAlign ] ) |
Nome | Tipo | Descrição | Obrigatório | Referência |
---|---|---|---|---|
oControl | objeto | Indica o componente que será inserido no layout. | X |
|
nRow | numérico | Especifica em qual linha do grid o componente será inserido. |
|
|
nColumn | numérico | Especifica em qual coluna do grid o componente será inserido. |
|
|
nRowSpan | numérico | Especifica quantas linhas serão mescladas. |
|
|
nColumnSpan | numérico | Especifica quantas colunas serão mescladas. |
|
|
nAlign | numérico | Especifica o alinhamento horizontal e/ou vertical do componente dentro de seu espaço no Layout. Um valor horizontal pode ser combinado a um vertical, por exemplo: LAYOUT_ALIGN_HCENTER + LAYOUT_ALIGN_TOP. Consulte a área de observações para conhecer as opções disponíveis. |
|
|
Valor | Descrição |
---|---|
1 | Alinhamento horizontal à esquerda |
2 | Alinhamento horizontal à direita |
4 | Alinhamento horizontal ao centro |
32 | Alinhamento vertical ao topo |
64 | Alinhamento vertical ao centro |
128 | Alinhamento vertical à base |
#include "TOTVS.CH" #define LAYOUT_ALIGN_LEFT 1 #define LAYOUT_ALIGN_RIGHT 2 #define LAYOUT_ALIGN_HCENTER 4 #define LAYOUT_ALIGN_TOP 32 #define LAYOUT_ALIGN_BOTTOM 64 #define LAYOUT_ALIGN_VCENTER 128 function u_ExAddGLyt() oWnd:= TWindow():New(0, 0, 550, 700, "Exemplo AddInLayout", NIL, NIL, NIL, NIL, NIL, NIL, NIL,; CLR_BLACK, CLR_WHITE, NIL, NIL, NIL, NIL, NIL, NIL, .T. ) oLayout1:= tGridLayout():New(oWnd,CONTROL_ALIGN_ALLCLIENT,0,0) oLayout1:SetColor(,CLR_BLUE) oTButton1 := TButton():New( 0, 0, "Botão 01", oLayout1,{||alert("Botão 01")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton2 := TButton():New( 0, 0, "Botão 02", oLayout1,{||alert("Botão 02")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton3 := TButton():New( 0, 0, "Botão 03", oLayout1,{||alert("Botão 03")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oLayout1:addInLayout(oTButton1, 1, 1, , ,LAYOUT_ALIGN_TOP) oLayout1:addInLayout(oTButton2, 1, 2, , ,LAYOUT_ALIGN_VCENTER) oLayout1:addInLayout(oTButton3, 1, 3, , ,LAYOUT_ALIGN_BOTTOM) oTButton4 := TButton():New( 0, 0, "Botão 04", oLayout1,{||alert("Botão 04")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oLayout1:addInLayout(oTButton4, 2, 1, , 3) oTButton5 := TButton():New( 0, 0, "Botão 05", oLayout1,{||alert("Botão 05")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton6 := TButton():New( 0, 0, "Botão 06", oLayout1,{||alert("Botão 06")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oLayout1:addInLayout(oTButton5, 3, 1, ,2) oLayout1:addInLayout(oTButton6, 3, 3) oTButton7 := TButton():New( 0, 0, "Botão 07", oLayout1,{||alert("Botão 07")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton8 := TButton():New( 0, 0, "Botão 08", oLayout1,{||alert("Botão 08")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton9 := TButton():New( 0, 0, "Botão 09", oLayout1,{||alert("Botão 09")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oLayout1:addInLayout(oTButton7, 4, 1, , , LAYOUT_ALIGN_RIGHT) oLayout1:addInLayout(oTButton8, 4, 2, 2) oLayout1:addInLayout(oTButton9, 4, 3, , , LAYOUT_ALIGN_LEFT) oTButton10 := TButton():New( 0, 0, "Botão 10", oLayout1,{||alert("Botão 10")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oTButton11 := TButton():New( 0, 0, "Botão 11", oLayout1,{||alert("Botão 11")}, 40,10,,,.F.,.T.,.F.,,.F.,,,.F. ) oLayout1:addInLayout(oTButton10, 5, 1) oLayout1:addInLayout(oTButton11, 5, 3) oWnd:Activate() return |