Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browse and buttons

Status
Not open for further replies.

dardapu

Programmer
Sep 10, 2002
67
In FPW26 I have a I modulate of billing in that I want to use a browse and a control button the one that Records or it Cancels the operation.
If the browse this hole the button when selecting to Cancel this work well.
If the browse has data, the button always returns me 1 although it is selected the to Cancel whose variable should return 2.

The sequence is:

do while .t.

acti wind botonera

m.op=0
@ 0.438,1.000 GET m.op ;
PICTURE "@*HT Grabar;Cancelar" ;
SIZE 1.769,10.500,0.667 ;
FONT "MS Sans Serif", 8 ;
STYLE "B"

ON KEY LABEL alt+f12 ACTIVATE WINDOW botonera,muestra &&activa wind browse and buttons
ON KEY LABEL ESC *

sele detalle
acti wind muestra

Browse Field cart :h='Código' :f :v=VBusca(cart),;
cant :h='Cantidad' :p='@Z 9,999,999.99' :f :v=VCant(cant),;
nart :h='Descripción' :f :w=EMPTY(nart),;
part :h='Precio Unit.' :p='@Z 999,999.999' ,;
importe = cant*part :p='@Z 9,999,999.999' :f :v=VSalta() ;
save NoClear in Window muestra

KEYBOARD '{rightarrow}{alt+f12}'
read cycle modal with detalle,botonera

DO CASE

CASE m.op=2
=beep(2)
wait wind nowai "It has Selected to Annul... " time 1
deac wind botonera
on key label escape
on key label f9
flag=1
clear read
RETURN

CASE m.op=1

sele detalle
count to contar for !empty(cart) and !empty(importe)
if contar=0
??chr(7)
=msgbox(" bills without data, verify","",48)
loop
endif

..........

Some idea as solving this problem?

Thank
 
Try adding a NOWAIT clause to your browse:
Code:
  Browse Field cart :h='Código'       :f :v=VBusca(cart),;
               cant :h='Cantidad'     :p='@Z 9,999,999.99' :f :v=VCant(cant),;
               nart :h='Descripción'  :f :w=EMPTY(nart),;
               part :h='Precio Unit.' :p='@Z 999,999.999' ,;
               importe = cant*part    :p='@Z 9,999,999.999' :f :v=VSalta() ;
               save NoClear
NOWAIT in Window muestra


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Try using two button objects, instead of one. Make the variables m.op1 and m.op2, both with initial values of 0. Then, in your case starement, you can trap for m.op1=1 or m.op2=1. Besure to reset the button value back to 0 in each case. This method also allows you to enable/disable each button with a when() validation in the browse window as you move through the records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top