Pular para conteúdo

5 - Frame com regiões

Frame com regiões

Deseja-se montar um frame com 2 regiões com a seguinte aparência:

 

Image

 

 

O exemplo utiliza um arquivo de imagem "pecaCobre.png" de tamanho 228x94

 

 

Arquivo de definição de frame:

\<?xml version="1.0" encoding="UTF-8"?> \<frame width="228" height="94" autoScaleY="true" autoScaleX="true">         \<borders left="6" top="7" bottom="6" right="39" />         \<draw>                          \<!-- fundo -->                 \<image left="0" top="0" right="228" bottom="94"                         overflowX="stretch" overflowY="stretch" zOrder="-1">                         \<anchors left="true" top="true" bottom="true" right="true"/>                         \<source url="pecaCobreBckBlack.png" left="0" right="228" top="0" bottom="94"/>                 \</image>                                                \</draw>                \<regions>                 \<region name="RegiaoSmallTitulo" left="15" top="30" right="45" bottom="64">                         \<anchors left="true" top="true" bottom="true" right="true"/>                                  \</region>                                \<region name="RegiaoValor" left="85" top="7" right="187" bottom="89">                         \<anchors left="true" top="true" bottom="true" right="true"/>                  \</region>               \</regions>      \</frame>

 

 

Uso no Lua Form:

\<?xml version="1.0" encoding="UTF-8"?> \<form name="frmFichaTeste">                  \<layout align="top" frameStyle="/frames/meuframe.xml"                  margins="{left=30, top=30, right=30, bottom=5}">                 \<label horzTextAlign="center" text="PO" frameRegion="RegiaoSmallTitulo"/>                               \<label horzTextAlign="center" text="500" frameRegion="RegiaoValor"/>                  \</layout>                \<layout align="top" frameStyle="/frames/meuframe.xml"                  margins="{left=30, top=5, right=30, bottom=5}">                 \<label horzTextAlign="center" text="PP" frameRegion="RegiaoSmallTitulo"/>                               \<label horzTextAlign="center" text="8" frameRegion="RegiaoValor"/>            \</layout>       \</form>

 

\ Image\ \ Os labels foram automaticamente alinhados às regiões definidas no frame.


Created with the Personal Edition of HelpNDoc: Elevate Your CHM Help Files with HelpNDoc's Advanced Customization Options