Jump to content
Fivewin Brasil

Ajuda num Gerador de Tela


oribeiro

Recommended Posts

Olá PessoAll,

Estou criando um gerador de telas assim:


DEFINE DIALOG oDlg FROM 0,0 TO nCols*20+140,500 TITLE "Manutenção do arquivo: "+Alltrim(oLbx:cAlias) FONT oFontSay COLOR CLR_BLACK,RGB(245,244,220) Pixel

@ 000,010 SAY iif(cTipo="N","NOVO",iif(cTipo="M","MODIFICA","CONSULTA"))+" REGISTRO" SIZE 120,13 FONT oFontBig COLOR CLR_BLACK,RGB(245,244,220) Pixel

FOR i = 1 TO nCols

if cTipo="N"

DbGoBottom()

DbSkip()

endif

STOR "Campo"+StrZero(i,2) TO wCampo

STOR (oLbx:cAlias)->(FieldGet( i )) TO &wcampo

DbGoTo( nReg )

@ (i*10)+20,010 SAY (oLbx:cAlias)->(FieldName( i )) FONT oFontSay COLOR CLR_BLACK,RGB(245,244,220) Pixel

if i=1

@ (i*10)+20,070 GET Campo01 FONT oFontGet SIZE Len(Campo01)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=2

@ (i*10)+20,070 GET Campo02 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=3

@ (i*10)+20,070 GET Campo03 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=4

@ (i*10)+20,070 GET Campo04 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=5

@ (i*10)+20,070 GET Campo05 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=6

@ (i*10)+20,070 GET Campo06 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=7

@ (i*10)+20,070 GET Campo07 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=8

@ (i*10)+20,070 GET Campo08 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=9

@ (i*10)+20,070 GET Campo09 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=10

@ (i*10)+20,070 GET Campo10 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

endif

NEXT

@ (i*10)+30,010 SButton bOk[1] PROMPT "Gravar" RESOURCE "B_OK1","B_OK2","B_OK3" SIZE 49,17 ACTION (lOk:=.T., oDlg:End()) Pixel

@ (i*10)+30,070 SButton bOk[2] PROMPT "Sair" RESOURCE "B_CANCEL1","B_CANCEL2","B_CANCEL3" SIZE 49,17 ACTION oDlg:End() Pixel

bOk[1]:cTipTool="Grava o registro e fecha a janela."

bOk[2]:cTipTool="Fecha essa janela sem gravar."

if cTipo="C"

bOk[1]:Disable()

endif

ACTIVATE DIALOG oDlg CENTERED RESIZE16

id=code>id=code>

Acontece que eu não queria colocar uma linha para cada get no código. Não consegui usar macrosubstituição também.

Alguém tem uma idéia de como eu posso simplificar os gets?

Oscar Ribeiroid=size4>

OASyS Informáticaid=blue>id=size4>

Fwh2.7+xHb0.99.60+BCC551+WorkShopid=size1>

Link to comment
Share on other sites

Olá PessoAll,

Estou criando um gerador de telas assim:


DEFINE DIALOG oDlg FROM 0,0 TO nCols*20+140,500 TITLE "Manutenção do arquivo: "+Alltrim(oLbx:cAlias) FONT oFontSay COLOR CLR_BLACK,RGB(245,244,220) Pixel

@ 000,010 SAY iif(cTipo="N","NOVO",iif(cTipo="M","MODIFICA","CONSULTA"))+" REGISTRO" SIZE 120,13 FONT oFontBig COLOR CLR_BLACK,RGB(245,244,220) Pixel

FOR i = 1 TO nCols

if cTipo="N"

DbGoBottom()

DbSkip()

endif

STOR "Campo"+StrZero(i,2) TO wCampo

STOR (oLbx:cAlias)->(FieldGet( i )) TO &wcampo

DbGoTo( nReg )

@ (i*10)+20,010 SAY (oLbx:cAlias)->(FieldName( i )) FONT oFontSay COLOR CLR_BLACK,RGB(245,244,220) Pixel

if i=1

@ (i*10)+20,070 GET Campo01 FONT oFontGet SIZE Len(Campo01)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=2

@ (i*10)+20,070 GET Campo02 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=3

@ (i*10)+20,070 GET Campo03 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=4

@ (i*10)+20,070 GET Campo04 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=5

@ (i*10)+20,070 GET Campo05 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=6

@ (i*10)+20,070 GET Campo06 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=7

@ (i*10)+20,070 GET Campo07 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=8

@ (i*10)+20,070 GET Campo08 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=9

@ (i*10)+20,070 GET Campo09 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

elseif i=10

@ (i*10)+20,070 GET Campo10 FONT oFontGet SIZE Len(Campo02)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

endif

NEXT

@ (i*10)+30,010 SButton bOk[1] PROMPT "Gravar" RESOURCE "B_OK1","B_OK2","B_OK3" SIZE 49,17 ACTION (lOk:=.T., oDlg:End()) Pixel

@ (i*10)+30,070 SButton bOk[2] PROMPT "Sair" RESOURCE "B_CANCEL1","B_CANCEL2","B_CANCEL3" SIZE 49,17 ACTION oDlg:End() Pixel

bOk[1]:cTipTool="Grava o registro e fecha a janela."

bOk[2]:cTipTool="Fecha essa janela sem gravar."

if cTipo="C"

bOk[1]:Disable()

endif

ACTIVATE DIALOG oDlg CENTERED RESIZE16

id=code>id=code>

Acontece que eu não queria colocar uma linha para cada get no código. Não consegui usar macrosubstituição também.

Alguém tem uma idéia de como eu posso simplificar os gets?

Oscar Ribeiroid=size4>

OASyS Informáticaid=blue>id=size4>

Fwh2.7+xHb0.99.60+BCC551+WorkShopid=size1>

Link to comment
Share on other sites

ola Oscar.

se entendi direito seria assim.

@ (i*10)+20,070 GET (oLbx:cAlias)->(Field(i))id=red>

FONT oFontGet SIZE Len((oLbx:cAlias)->(Field(i))id=red>)*3.8,9 WHEN cTipo#"C" COLOR CLR_BLACK,RGB(245,244,220) Pixel

Alessandroid=blue>

FW20d+CL53b+Blinker7+@Say+CDX

MSN: ferracini_silva@hotmail.com

Ribeirão Preto/SP

V ENCONTRO DE PROGRAMADORES FIVEWIN - NOVEMBRO/2007 - EU VOUid=red>

Editado por - aferra on 04/07/2007 14:16:43

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.

Loading...
×
×
  • Create New...