when I insert a number in the first tget it would become the third update because it is a clause of the bchange and it performs a calculation
but if I delete the number in the first get it does not execute the bchange for the second time,
is normal or there is something wrong because in my opinion when I update a get automatically the third should be updated
I had never noticed this problem, today trying the program I realized that there was something unusual
if I activate the bchange I cannot enter any number in the get
here the sample test
- Code: Select all Expand view RUN
#include "fivewin.ch"
#include "report.ch"
#include "constant.ch"
Function test()
Local oDlgMod,oFont,oBold
Local nBottom := 19.7
Local nRight := 65.4
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
local aGet[10]
local nCosto,nSconto,nTotale
nCosto := 5.00
nSconto := 0
nTotale := 5.00
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-14 BOLD
DEFINE DIALOG oDlgMod SIZE nWidth, nHeight PIXEL ;
TITLE "Modifica una tariffa base " FONT oFont ;
COLOR CLR_BLACK,CLR_WHITE TRANSPARENT
oDlgMod:lHelpIcon := .F.
oDlgMod:nStyle := nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, 4 )
@ 96, 10 Say "Costo :" SIZE 90,10 PIXEL OF oDlgMod
@ 94, 75 GET aGet[7] VAR nCosto OF oDlgMod SIZE 60, 12 ;
PIXEL PICTURE '@ €99,999.99' RIGHT FONT oFont UPDATE ;
ON CHANGE Calcolo_tariffa(nCosto,nSconto,@nTotale,aGet,oDlgMod)
@ 96, 145 Say "Sconto :" SIZE 90,10 PIXEL OF oDlgMod
@ 94, 175 GET aGet[8] VAR nsconto OF oDlgMod SIZE 60, 12 ;
PIXEL PICTURE '@ €99,999.99' RIGHT FONT oFont UPDATE ;
ON CHANGE Calcolo_tariffa(nCosto,nSconto,@nTotale,aGet,oDlgMod)
* ON CHANGE ((aGet[8]:assign(),ntotale:= ncosto-nsconto),aGet[9]:assign(),aGet[9]:refresh())
@ 116, 10 Say "Totale :" SIZE 90,10 PIXEL OF oDlgMod
@ 114, 75 GET aGet[9] VAR ntotale OF oDlgMod SIZE 60, 12 ;
PIXEL PICTURE '@ €99,999.99' RIGHT FONT oFont UPDATE
@ 128,160 BUTTONBMP oBtnSave;
PROMPT " Salva" ;
SIZE 45,15 PIXEL ;
OF oDlgMod ;
RESOURCE ".\bitmaps\SAVE.png" ;
TEXTRIGHT FONT oBold ;
ACTION ( oDlgMod:end( IDOK ) )
@ 128,210 BUTTONBMP oBtnSave;
PROMPT " Annulla" ;
SIZE 45,15 PIXEL ;
OF oDlgMod ;
RESOURCE "bitmaps\NO.png" ;
TEXTRIGHT FONT oBold ;
ACTION ( oDlgMod:end( IDCANCEL ) )
ACTIVATE DIALOG oDlgMod center
* ON INIT (DlgCenter( oDlgMod, oGrid ), aGet[5]:aItems[2]:disable())
If oDlgMod:nresult == IDOK
if msgYesNo( i18n("¿ E' sicuro di voler modificare questa tariffa ?") )
endif
Endif
RETURN NIL
Function Calcolo_tariffa(nCosto,nSconto,nTotale,aGet, oDlgMod)
ntotale:= ncosto-nsconto
aGet[9]:cText(ntotale)
oDlgMod:Update()
return nil