Tela de venda com BUTTON

Projeto HwGui - Biblioteca visual para Harbour/xHarbour

Moderador: Moderadores

marcos.gurupi
Usuário Nível 4
Usuário Nível 4
Mensagens: 939
Registrado em: 06 Jul 2004 11:53
Localização: Gurupi-TO

Tela de venda com BUTTON

Mensagem por marcos.gurupi »

Caros estou iniciado em meu PDV a tela de vendas e a seguencia dos codigos estah assim:

Código: Selecionar todos

INIT DIALOG oForm CLIPPER TITLE "Vendas";
        NOEXIT ;
        ON INIT {||oButton01:DISABLE(),oButton02:DISABLE(),oButton03:DISABLE(),;
                   oButton04:ENABLE(),oButton05:DISABLE(),oButton06:DISABLE(),SetFocus(oRef:Handle)};
        FONT HFont():Add( 'Courier New',0,-36,400,,,) ;
        AT 0, 0 ;
        SIZE GetDesktopWidth()-10, GetDesktopHeight() - 100 ;
             STYLE DS_CENTER + WS_VISIBLE + WS_POPUP + WS_VISIBLE + WS_CAPTION + WS_SYSMENU
   @   0,0  IMAGE oImage SHOW oVendas SIZE GetDesktopWidth()-10,GetDesktopHeight()-100


   @ 741,155  GET oQuant     VAR vQuant VALID {||LancItem(),SetFocus(oRef:Handle),oButton05:ENABLE(),oButton06:ENABLE(),.T.}    MAXLENGTH 08 PICTURE "99999.99"  Size 250,50 STYLE ES_AUTOHSCROLL
   @ 730,570  GET oRef       VAR vRef   VALID {||Iif(Empty(vRef),.F.,BuscPro(vRef)),SetFocus(oQuant:Handle),.T.} MAXLENGTH 13 PICTURE "@!"        Size 270,50 STYLE ES_AUTOHSCROLL
   @  30, 40  SAY oDescricao CAPTION Transform(vDescricao,"@!@S43") OF oForm Size 950,50 FONT HFont():Add( 'Courier New',0,-36,800,,,) BACKCOLOR RGB(186,227,247) 
   @ 741,270  SAY oPreco     CAPTION Transform(vPreco,"@E 9,999.99") OF oForm Size 250,50 BACKCOLOR RGB(186,227,247)
   @ 741,380  SAY oTotUnt    CAPTION Transform(vTotUnt,"@E 99,999.99") OF oForm Size 250,50 BACKCOLOR RGB(186,227,247) 
   @ 741,490  SAY oTotal     CAPTION Transform(vTotal,"@E 99,999.99") OF oForm Size 250,50 COLOR x_RED FONT HFont():Add( 'Courier New',0,-36,800,,,) BACKCOLOR RGB(186,227,247)

   @ 35,370 BROWSE oBrwItem DATABASE SIZE GetDesktopWidth()-390, 240 FONT HFont():Add( 'Courier New',0,-12,400,,,) STYLE WS_VSCROLL + WS_HSCROLL MULTISELECT
   oBrwItem:alias   := ARQUITMP
   oBrwItem:aColumns := {}
   ADD COLUMN FieldBlock(Fieldname(18)) TO oBrwItem HEADER 'Item'      TYPE 'N' LENGTH 3   PICTURE "999" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_CENTER
   ADD COLUMN FieldBlock(Fieldname(5) ) TO oBrwItem HEADER 'Descrição' TYPE 'C' LENGTH 35  PICTURE "@!@S35"    JUSTIFY HEAD DT_CENTER //        JUSTIFY LINE DT_RIGHT
   ADD COLUMN FieldBlock(Fieldname(6) ) TO oBrwItem HEADER 'Quant.'    TYPE 'N' LENGTH 10  DEC 2 PICTURE "9999.99" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT
   ADD COLUMN FieldBlock(Fieldname(7) ) TO oBrwItem HEADER 'Vlr.Unit.' TYPE 'N' LENGTH 12  DEC 2 PICTURE "@E 99,999.99" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT
   ADD COLUMN FieldBlock(Fieldname(8) ) TO oBrwItem HEADER 'Total'     TYPE 'N' LENGTH 12  DEC 2 PICTURE "@E 99,999.99" JUSTIFY HEAD DT_CENTER JUSTIFY LINE DT_RIGHT

   @  50,645 BUTTON oButton01 CAPTION "Finalizar Venda"             SIZE 150, 20 ON CLICK {||EndDialog(),SetFocus(oRef:Handle),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-12,800,,,)
   @ 200,645 BUTTON oButton02 CAPTION "Cancelar Item"               SIZE 150, 20 ON CLICK {||EndDialog(),SetFocus(oRef:Handle),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-12,800,,,)
   @ 350,645 BUTTON oButton03 CAPTION "Cancelar Cupom"              SIZE 150, 20 ON CLICK {||EndDialog(),SetFocus(oRef:Handle),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-12,800,,,)
   @ 500,645 BUTTON oButton04 CAPTION "Abrir Gaveta"                SIZE 150, 20 ON CLICK {||Autoriza(),iif(Trava=1,Msginfo("Usuario nao autorizado",ALIAS()),histusua(date(),time(),acesso->codigo,"Abriu Gaveta de Dinheiro")),verifusua(ACESSO->CODIGO,48),IIF(SASA#1.OR.TRAVA=1,MSGSTOP("Usuario nao autorizado",ALIAS()),AbreGaveta()),.T.} FONT HFont():Add( 'Courier New',0,-12,800,,,)
   @ 650,645 BUTTON oButton05 CAPTION "Pesquisar Cliente"           SIZE 150, 20 ON CLICK {||EndDialog(),SetFocus(oRef:Handle),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-12,800,,,) COLOR x_BLUE
   @ 800,645 BUTTON oButton06 CAPTION "Pesquisar Preco"             SIZE 150, 20 ON CLICK {||EndDialog(),SetFocus(oRef:Handle),.T.} STYLE WS_TABSTOP FONT HFont():Add( 'Courier New',0,-12,800,,,) COLOR x_BLUE

ReadExit( .T. )

ACTIVATE DIALOG oForm
Mas acontece q os BUTTONS (q estaum habilitados n saum acionados com o click do mouse, quando clico no button habilitado ele fica alternando entres os GETS. O estah errado?

Marcos Roberto
Responder