|
From: Alain A. <ala...@wa...> - 2015-03-27 16:47:58
|
Hi Alexander,
I have a small problem to refresh the display of the variables cparam2
to cparam6, when changing the activ element of the combobox.
I saw that onchange() works, as it displays that the record has been
found, but I don't know how to refresh the display.
code :
//
============================================================================
Function Commune(cwhy)
//
============================================================================
Local oDlg, oFont := HFont():Add( "Serif",0,-13 )
Local cTitle
Local cText01 := "Choisissez la commune"
Local cText02 := "Canton"
Local cText03 := "Code INSEE"
Local cText04 := "Code Postal"
Local cText05 := "Latitude"
Local cText06 := "Longitude"
Local aCommune:={}, aCanton:={}, aIndice:={}
if cWhy == "bms"
cTitle = "Télécharger un BMS"
oStatus:SetText(" Télécharger un BMS ...")
elseif cWhy == "dec"
cTitle = "Télécharger un registre décénal"
oStatus:SetText(" Télécharger un registre décénal ...")
else
cTitle = "Consulter les registres d'une commune"
oStatus:SetText(" Consulter les registres d'une commune ...")
endif
select 2
use communes index ccommune
go top
do while.not.eof()
aadd(aCommune,communes -> commune)
aadd(aCanton,communes -> canton)
aadd(aIndice,communes -> indice)
skip
enddo
go top
rCommune= communes -> commune
oStatus:SetText("Connexion aux Archives départemental AD24 ...")
if len(aCommune) > 0
INIT DIALOG oDlg CLIPPER NOEXIT TITLE cTitle AT
oMainWindow:nLeft+140,oMainWindow:nTop+130 SIZE 520,180 ;
FONT oFont
hwg_SetDlgKey( oDlg, 0, VK_F1, {|| Help("Commune") } )
@ 15,10 SAY cText01 SIZE 200, 22 COLOR hwg_VColor("FF0000")
@ 15,32 GET COMBOBOX oCommune VAR rCommune ITEMS aCommune STYLE
WS_TABSTOP SIZE 290, 25;
TOOLTIP "Choix de la commune";
ON CHANGE {||DisplayCommune(rCommune)};
TEXT
@ 400,10 SAY cText02 SIZE 200, 22 COLOR hwg_VColor("FF0000")
@ 365,32 SAY cparam2 COLOR hwg_VColor("FF0000")
@ 15,72 SAY cText03 SIZE 80, 22 COLOR hwg_VColor("FF0000")
@ 15,94 SAY cparam3 COLOR hwg_VColor("FF0000")
@ 120,72 SAY cText04 SIZE 80, 22 COLOR hwg_VColor("FF0000")
@ 120,94 SAY cparam4 COLOR hwg_VColor("FF0000")
@ 300,72 SAY cText05 SIZE 80, 22 COLOR hwg_VColor("FF0000")
@ 300,94 SAY cparam5 COLOR hwg_VColor("FF0000")
@ 400,72 SAY cText06 SIZE 80, 22 COLOR hwg_VColor("FF0000")
@ 400,94 SAY cparam6 COLOR hwg_VColor("FF0000")
@ 120,130 BUTTON "Ok" OF oDlg ID IDOK ;
SIZE 100, 32 COLOR hwg_VColor("FF0000") ;
ON CLICK {||oDlg:lResult:=.t.}
@ 260,130 BUTTON "Annuler" OF oDlg ID IDCANCEL ;
SIZE 100, 32
ACTIVATE DIALOG oDlg
oFont:Release()
if oDlg:lresult
qout("A voir")
endif
else
hwg_Msginfo("Fichier communes.dbf non trouvé ...","Ouverture d'une
archive AD24 en ligne")
endif
oStatus:SetText("")
Return Nil
//
============================================================================
Function DisplayCommune(rcommune)
//
============================================================================
select 2
go top
seek rcommune
cparam2=communes -> canton
cparam3=communes -> insee
cparam4=communes -> postal
cparam5=communes -> latitude
cparam6=communes -> longitude
if found()
qout("found ...")
else
qout("not found ...")
endif
Return Nil
//
============================================================================
Thanks
A+
--
------------------------------------------------------------------------
Alain Aupeix
http://jujuland.pagesperso-orange.fr/
http://pissobi-lacassagne.pagesperso-orange.fr/
------------------------------------------------------------------------
U.buntu 12.04 | G.ramps 3.4.8-1 | H.arbour 3.2.0dev (2015-02-23 16:47) |
HbIDE (Rev.316) | Five.Linux (r138) | Hw.Gui (2374)
------------------------------------------------------------------------
|