Jump to content
Fivewin Brasil

listbbox


syspel

Recommended Posts

Function serv53
Local tobp
Sele Codstmdo
set order to 2
go top

vsdescri=space(40)

Define Dialog fd1 from 1.5,15 to 20.5,77 title "Codigo de Serviço " style 0


 @ 0.4,0.8 LISTBOX tobp FIELDS Codstmdo->s_codigo,Codstmdo->s_descric ;
 ALIAS"Codstmdo"HEADERS'Código','Descrição' size 230,90 ;
 OF fd1 On DblClick (Beep(),pufaf53(saget),fd1:end()) font ofont3

    tobp:lMChange       := .F.         // Desabilita Mousemove
    tobp:SetFocus()                  // Refocus on The Browse
    tobp:Refresh()                     // Estabiliza o browse/listbox
    tobp:Default()                     // Para SetFilter() // Acho... Sei lá...
    tobp:nRowPos := 1                 // ?? Ver com Vagner Wirts... Sei lá... Uso WorkShop.Exe

    tobp:bkeydown={| nkey | pufeca53(nkey) }

    tobp:bMMoved = { | nRow, nCol, nFlags | aadesc53() }

    sysrefresh()


 @ 6.9,3   say "Nome:"  of fd1 size 18,10 font ofont3
 @ 7.9,5   get oas var vsdescri pict "@!"  of fd1 size 150,10 font ofont3 valid busacca53()


Activate dialog fd1 centered
set order to 1
saget[1]:refresh()
saget[1]:setfocus()
Return .T.

Static Function pufaf53(iget)
saget[1]:VarPut(Codstmdo->s_codigo)  ; saget[1]:Refresh()
Return(Nil)


Static Function pufeca53(nkey)
if nkey=13
  saget[1]:VarPut(Codstmdo->s_codigo)
  saget[1]:Refresh()
  saget[1]:setfocus()
  fd1:end()
endif
Return(Nil)


Function busacca53
if ! empty(vsdescri)
  select codstmdo
  set order to 2
  seek alltrim(vsdescri)
 if ! found()
   msgstop("Codigo nao existe","Aviso")
   select codstmdo
   set order to 2
   go top
   return .f.
 endif
endif
aa=recno()
go aa
oas:refresh()
return .t.

Link to comment
Share on other sites

Function serv53
PRIVATE tobp
Sele Codstmdo
set order to 2
go top

vsdescri=space(40)

Define Dialog fd1 from 1.5,15 to 20.5,77 title "Codigo de Serviço " style 0


 @ 0.4,0.8 LISTBOX tobp FIELDS Codstmdo->s_codigo,Codstmdo->s_descric ;
 ALIAS"Codstmdo"HEADERS'Código','Descrição' size 230,90 ;
 OF fd1 On DblClick (Beep(),pufaf53(saget),fd1:end()) font ofont3

    tobp:lMChange       := .F.         // Desabilita Mousemove
    tobp:SetFocus()                  // Refocus on The Browse
    tobp:Refresh()                     // Estabiliza o browse/listbox
    tobp:Default()                     // Para SetFilter() // Acho... Sei lá...
    tobp:nRowPos := 1                 // ?? Ver com Vagner Wirts... Sei lá... Uso WorkShop.Exe

    tobp:bkeydown={| nkey | pufeca53(nkey) }

    tobp:bMMoved = { | nRow, nCol, nFlags | aadesc53() }

    sysrefresh()


 @ 6.9,3   say "Nome:"  of fd1 size 18,10 font ofont3
 @ 7.9,5   get oas var vsdescri pict "@!"  of fd1 size 150,10 font ofont3 valid busacca53()


Activate dialog fd1 centered
set order to 1
saget[1]:refresh()
saget[1]:setfocus()
Return .T.

Static Function pufaf53(iget)
saget[1]:VarPut(Codstmdo->s_codigo)  ; saget[1]:Refresh()
Return(Nil)


Static Function pufeca53(nkey)
if nkey=13
  saget[1]:VarPut(Codstmdo->s_codigo)
  saget[1]:Refresh()
  saget[1]:setfocus()
  fd1:end()
endif
Return(Nil)

Function busacca53
LOCAL lReturn := .F.

if  !empty(vsdescri)
 if  !DbSeek( AllTrim(vsDescri) )
     msgstop("Codigo nao existe","Aviso")
     lReturn := .F.
 endif
endif
 tobp:Refresh()
return .t.

Link to comment
Share on other sites

MEMVAR tobp
	Function serv53
	   PRIVATE tobp
	   Sele Codstmdo
   set order to 2
   go top
	   vsdescri=space(40)
	   Define Dialog fd1 from 1.5,15 to 20.5,77 title "Codigo de Serviço " style 0
	   fd1:lHelpIcon := .F.
	
   @ 0.4,0.8 LISTBOX tobp FIELDS Codstmdo->s_codigo,Codstmdo->s_descric ;
             ALIAS"Codstmdo"HEADERS'Código','Descrição' size 230,90 ;
             OF fd1 On DblClick (Beep(),pufaf53(saget),fd1:end()) font ofont3
	   tobp:lMChange       := .F.         // Desabilita Mousemove
   tobp:SetFocus()                  // Refocus on The Browse
   tobp:Refresh()                     // Estabiliza o browse/listbox
   tobp:Default()                     // Para SetFilter() // Acho... Sei lá...
   tobp:nRowPos := 1                 // ?? Ver com Vagner Wirts... Sei lá... Uso WorkShop.Exe
	   tobp:bkeydown={| nkey | pufeca53(nkey) }
	   tobp:bMMoved = { | nRow, nCol, nFlags | aadesc53() }
	   //  sysrefresh() PARA REFRESCAR LOOPINS WHILE... ENDDO por exemplo
	   @ 6.9,3   say "Nome:"  of fd1 size 18,10 font ofont3
   @ 7.9,5   get oas var vsdescri pict "@!"  of fd1 size 150,10 font ofont3 valid busacca53()
	
   Activate dialog fd1 centered
	   set order to 1
   saget[1]:refresh()
   saget[1]:setfocus()
	Return .T.
	Static Function pufaf53(iget)
	   saget[1]:VarPut(Codstmdo->s_codigo)  ; saget[1]:Refresh()
	Return(Nil)
	
Static Function pufeca53(nkey)
	   if nkey=13
      saget[1]:VarPut(Codstmdo->s_codigo)
      saget[1]:Refresh()
      saget[1]:setfocus()
      fd1:end()
   endif
	Return(Nil)
	Function busacca53
	   LOCAL lReturn := .F.
	   if  !empty(vsdescri)
	      if  !DbSeek( AllTrim(vsDescri) )
         msgstop("Codigo nao existe","Aviso")
	         lReturn := .F.
	      endif
	   endif
	   tobp:Refresh()
	return .t.


 

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