|
From: Alain A. <ala...@wa...> - 2015-05-14 12:06:18
|
Le 14. 05. 15 12:44, Alexander S.Kresin a écrit :
> Alain Aupeix writes:
>> ...
>> As for another function where there is no window opened, I used this in
>> the button creation :
>>
>> ON CLICK {||oStatus:SetText(" Rafraichir la base des clients ..."),
>> Refresh(), oStatus:SetText("")}
>>
>> But it doesn't display the message.
>>
> How the message can be displayed, if you clean it after setting with
> oStatus:SetText("") ?
I have another function where on click is the same : set, fct, unset,
and which works.
The only difference is that there is no display in the one which doesn't
work
@ htab+(nbut*32), 3 OWNERBUTTON OF
oToolbar ;
ON CLICK {||oStatus:SetText(" A propos de Maintsys-client ..."),
info(), oStatus:SetText("")} ;
SIZE 28,24 FLAT ;
BITMAP cImageDir+"info.png" TRANSPARENT COLOR 12632256 COORDINATES
0,4,0,0 ;
TOOLTIP "A propos de Maintsys-client"
//
============================================================================
Function info()
//
============================================================================
hwg_Msginfo("Maintsys-client v"+progvers+" du "+progdate+ Chr(10) + ;
" 2015-"+left(progdate,4)+" (c) Alain
Aupeix" + Chr(10) + ;
"___________________________________________" + Chr(10) +
Chr(10) + ;
" "+Hwg_Version() + chr(10) + ;
" "+Harbour_Version ;
, "A propos de Maintsys-client")
return nil
------------------------------
@ htab+(nbut*32), 3 OWNERBUTTON OF oToolbar ;
ON CLICK {||oStatus:SetText(" Rafraichir la base des clients ..."),
Refresh("button"+chr(10)), oStatus:SetText("")} ;
SIZE 28,24 FLAT ;
BITMAP cImageDir+"refresh.png" TRANSPARENT COLOR 12632256 COORDINATES
0,4,0,0 ;
TOOLTIP "Rafraîchir la base"
//
============================================================================
Function Refresh(cmode)
//
============================================================================
local cmachines:="", aMachines:={}, nMachines, aNewMac:={}, nNewMac,
rgd, rgc, nTab:=0
local ctexte, cmail, cdate, cuser, ctux, cdeb, cpublic, clocal,
cislocal:="",islocal:=.f.
//oStatus:SetText(" Rafraîchir la base des clients ...")
//@ 210,10 say " Rafraîchir la base des clients ..."
qout(cmode)
hb_processRun("cat "+cmPath+"/Maintenance",,@cmachines)
rgd=mlcount(cmachines)
if rgd>0
cmail =""
nNewMac=0
for rgc=1 to rgd
ctexte=trim(memoline(cmachines,,rgc))
if left(ctexte,13)=="Return-Path: " .and. len(cmail)==0
cdeb=at("<",ctexte)+1
cmail=substr(ctexte,cdeb)
cmail=left(cmail,at(">",cmail)-1)
endif
if left(ctexte,4)=="## ;" .and. len(cmail)>0
cdeb=at(";",ctexte)+1
cuser=substr(ctexte,cdeb)
cuser=left(cuser,at("@",cuser)-1)
cdeb=at("@",ctexte)+1
ctux=substr(ctexte,cdeb)
ctux=left(ctux,at(";",ctux)-2)
cdeb=len(cuser+ctux)+8
cdate=substr(ctexte,cdeb)
cdate=left(cdate,at(";",cdate)-2)
cdeb+=len(cdate)+2
cpublic=substr(ctexte,cdeb)
if at(";",cpublic)>0
clocal=substr(cpublic,at(";",cpublic)+1)
cpublic=left(cpublic,at(";",cpublic)-2)
else
if len(cpublic)=0
cpublic="non fournie"
endif
clocal="non fournie"
endif
if left(cpublic,4)="192."
clocal=cpublic
cpublic="non fournie"
endif
aadd(aNewMac,{ctux,cuser,cmail,cdate,cpublic,clocal})
cmail=""
cislocal=""
islocal=""
nNewMac++
cmac=aNewMac[nNewMac,1]+"@"+aNewMac[nNewMac,2]
endif
next
cfmac=""
nMachines=0
for rgc=nNewMac to 1 step -1
cmac=aNewMac[rgc,1]+"@"+aNewMac[rgc,2]
if at(cmac,cfmac)=0
aadd(aMachines,{aNewMac[rgc,1],aNewMac[rgc,2],aNewMac[rgc,3],aNewMac[rgc,4],aNewMac[rgc,5],aNewMac[rgc,6]})
nMachines++
cfmac+="|"+cmac
else
endif
next
select 2
for rgc=1 to nMachines
cmac=padr(aMachines[rgc,1],15)+padr(aMachines[rgc,2],15)
go top
seek cmac
if found()
if aMachines[rgc,4] > machines->date
if aMachines[rgc,5] != "non fournie"
replace machines->public with aMachines[rgc,5]
endif
if aMachines[rgc,6] != "non fournie"
replace machines->local with aMachines[rgc,6]
endif
replace machines->date with aMachines[rgc,4]
endif
cmd="ping -c 1 "+trim(machines->machine)
hb_processRun(cmd,,@cislocal)
if at("64 bytes from "+trim(machines->machine),cislocal)>0
islocal=.t.
else
islocal=.f.
endif
replace machines->islocal with islocal
else
append blank
replace machines->machine with aMachines[rgc,1],
machines->user with aMachines[rgc,2], ;
machines->mail with aMachines[rgc,3], machines->date
with aMachines[rgc,4], ;
machines->public with aMachines[rgc,5],
machines->local with aMachines[rgc,6], ;
machines->islocal with islocal
endif
next
else
cMessage="Dossier Thunderbird non trouvé ..."
hwg_Msginfo(cMessage,"Rafraîchir la base")
endif
//oStatus:SetText("")
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-05-07 11:27) |
HbIDE (Rev.316) | Five.Linux (r143) | Hw.Gui (2400)
------------------------------------------------------------------------
|