$INCLUDE "rapidq.inc"
$INCLUDE "rollover.inc"
$ESCAPECHARS ON
$RESOURCE nview AS "nviewlib.dll"
$RESOURCE piccon AS "temps.bmp"
$RESOURCE ciblemeteo AS "ciblemeteod.bmp"
$RESOURCE cematinon AS "gfx\cematinon.bmp"
$RESOURCE cematinoff AS "gfx\cematinoff.bmp"
$RESOURCE demainmaton AS "gfx\demainmaton.bmp"
$RESOURCE demainmatoff AS "gfx\demainmatoff.bmp"
$RESOURCE demainapon AS "gfx\demainapon.bmp"
$RESOURCE demainapoff AS "gfx\demainapoff.bmp"
$RESOURCE cetamon AS "gfx\cetamon.bmp"
$RESOURCE cetamoff AS "gfx\cetamoff.bmp"
$IFNDEF boolean
$DEFINE boolean INTEGER
$ENDIF
DECLARE FUNCTION Load_JPG LIB "NViewLib.dll" ALIAS "Load_JPG" (BYVAL FileName AS STRING, BYVAL a AS INTEGER) AS LONG
DECLARE FUNCTION NViewLibLoad LIB "NViewLib.dll" ALIAS "NViewLibLoad" (BYVAL FileName AS STRING, BYVAL a AS INTEGER) AS LONG
DECLARE FUNCTION NViewLibSaveAsJPG LIB "NViewLib.dll" ALIAS "NViewLibSaveAsJPG" (BYVAL Quality AS INTEGER, BYVAL FileName AS STRING) AS INTEGER
DECLARE FUNCTION GetWidth LIB "NViewLib.dll" ALIAS "GetWidth" () AS INTEGER
DECLARE FUNCTION GetHeight LIB "NViewLib.dll" ALIAS "GetHeight" () AS INTEGER
DECLARE FUNCTION URLDownloadToFile LIB "urlmon" ALIAS "URLDownloadToFileA" (BYVAL pCaller AS LONG, BYVAL szURL AS STRING, BYVAL szFileName AS STRING, BYVAL dwReserved AS LONG, BYVAL lpfnCB AS LONG) AS LONG
FUNCTION DownloadFile(URL AS STRING, LocalFilename AS STRING) AS Boolean
DIM lngRetVal AS LONG
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
IF lngRetVal = 0 THEN DownloadFile = True
END FUNCTION
DECLARE SUB aboutcon
DECLARE SUB about
DECLARE SUB CLOSE
DECLARE SUB meteomat
DECLARE SUB meteoap
DECLARE SUB meteomatD
DECLARE SUB MeteoapD
DECLARE SUB tempsmat
DECLARE SUB tempsap
DECLARE SUB tempsmatD
DECLARE SUB tempsapD
$OPTION ICON "temps1.ico"
DIM font AS QFONT
CREATE imagebit AS QBITMAP
Width = 384
Height = 320
END CREATE
CREATE Form AS QFORM
CAPTION = "QMETEO v 1.0"
Width = 760
Height = 600
Center
DelBorderIcons = 2
COLOR=&hffffff
onclose=CLOSE
CREATE file1 AS QMAINMENU
CREATE file AS QMENUITEM
CAPTION = "&Fichier"
CREATE exitcon AS QMENUITEM
CAPTION = "&Quitter"
OnClick = CLOSE
END CREATE
END CREATE
CREATE meteo AS QMENUITEM
CAPTION = "&Previsions"
CREATE meteoAM AS QMENUITEM
CAPTION="T°C ce matin"
onclick=meteomat
END CREATE
CREATE meteoPM AS QMENUITEM
CAPTION="T°C cet apres-midi"
onclick=meteoap
END CREATE
CREATE meteoAMD AS QMENUITEM
CAPTION="T°C demain matin"
onclick=meteomatD
END CREATE
CREATE meteoPMD AS QMENUITEM
CAPTION="T°C demain apres-midi"
onclick=meteoapD
END CREATE
CREATE tempsAM AS QMENUITEM
CAPTION="Ciel ce matin"
onclick=tempsmat
END CREATE
CREATE tempsPM AS QMENUITEM
CAPTION="Ciel cet apres-midi"
onclick=tempsap
END CREATE
CREATE tempsAMD AS QMENUITEM
CAPTION="Ciel demain matin"
onclick=tempsmatD
END CREATE
CREATE tempsPMD AS QMENUITEM
CAPTION="Ciel demain apres-midi"
onclick=tempsapD
END CREATE
END CREATE
CREATE about1 AS QMENUITEM
CAPTION = "&A Propos"
END CREATE
END CREATE
CREATE groupboxtemp AS QGROUPBOX
left=10
top=100
width=150
height=225
font=font
font.size=8
font.bold=true
CAPTION="LES TEMPERATURES"
CREATE DBox1 AS rolover
onclick=meteomat
imageoff.bmphandle=cematinoff
imageon.bmphandle=cematinon
top=40
left=5
cursor=-21
END CREATE
CREATE DBox2 AS rolover
onclick=meteoap
imageon.bmphandle=cetamon
imageoff.bmphandle=cetamoff
top=80
left=5
cursor=-21
END CREATE
CREATE DBox3 AS rolover
onclick=meteomatD
imageon.bmphandle=demainmaton
imageoff.bmphandle=demainmatoff
top=120
left=5
cursor=-21
END CREATE
CREATE DBox4 AS rolover
onclick=meteoapD
imageon.bmphandle=demainapon
imageoff.bmphandle=demainapoff
top=160
left=5
cursor=-21
END CREATE
END CREATE
CREATE groupboxciel AS QGROUPBOX
left=590
top=100
height=225
width=150
CAPTION="LE CIEL"
font=font
font.size=8
font.bold=true
CREATE DBox5 AS rolover
onclick=tempsmat
imageoff.bmphandle=cematinoff
imageon.bmphandle=cematinon
top=40
left=5
cursor=-21
END CREATE
CREATE DBox6 AS rolover
onclick=tempsap
imageon.bmphandle=cetamon
imageoff.bmphandle=cetamoff
top=80
left=5
cursor=-21
END CREATE
CREATE DBox7 AS rolover
onclick=tempsmatD
imageon.bmphandle=demainmaton
imageoff.bmphandle=demainmatoff
top=120
left=5
cursor=-21
END CREATE
CREATE DBox8 AS rolover
onclick=tempsapD
imageon.bmphandle=demainapon
imageoff.bmphandle=demainapoff
top=160
left=5
cursor=-21
END CREATE
END CREATE
CREATE imagefond AS QIMAGE
BMPhandle=ciblemeteo
autosize=true
left=165
top=40
END CREATE
CREATE image AS QIMAGE
Width = 384
Height = 255
left=185
top=60
END CREATE
END CREATE
DBox1.PARENT=groupboxtemp
DBox1.COLOR=form.COLOR
DBox2.PARENT=groupboxtemp
DBox2.COLOR=form.COLOR
DBox3.PARENT=groupboxtemp
DBox3.COLOR=form.COLOR
DBox4.PARENT=groupboxtemp
DBox4.COLOR=form.COLOR
DBox5.PARENT=groupboxciel
DBox5.COLOR=form.COLOR
DBox6.PARENT=groupboxciel
DBox6.COLOR=form.COLOR
DBox7.PARENT=groupboxciel
DBox7.COLOR=form.COLOR
DBox8.PARENT=groupboxciel
DBox8.COLOR=form.COLOR
APPLICATION.Title = "QMeteo v 1.0"
IF FILEEXISTS("nviewlib.dll") = 0 THEN
EXTRACTRESOURCE Resource(0),"nviewlib.dll"
END IF
SUB meteomat
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franTmpP0AM.jpg", "meteo.jpg"
filename$ ="meteo.jpg"
ext$ = MID$(filename$, LEN(filename$)-2, LEN(filename$))
IF ext$ = "jpg" THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
SUB meteoap
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franTmpP0PM.jpg", "meteo.jpg"
filename$ ="meteo.jpg"
ext$ = MID$(filename$, LEN(filename$)-2, LEN(filename$))
IF ext$ = "jpg" THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
SUB meteomatD
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franTmpP1AM.jpg", "meteo.jpg"
filename$ ="meteo.jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
sub meteoapD
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franTmpP1PM."jpg, "meteo."jpg
filename$ ="meteo."jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
'######################################################
'## IDEM pour le temps ##
'######################################################
sub tempsmat
'j'utilise en 1er l'api OLELOADPICTUREPATH.....qui me permet de telecharger une image depuis une adresse URL
'je mets l'adresse de l'image puis le nom et le repertoir où je souhaie l'enregistrer(ici meteo.jpg--ce qui la place dans le repertoire courant du programme)
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franNebP0AM."jpg, "temps."jpg
'A present, je peux ouvrir cette image en utilisant NVIEW.DLL
filename$ ="temps."jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
sub tempsap
'j'utilise en 1er l'api OLELOADPICTUREPATH.....qui me permet de telecharger une image depuis une adresse URL
'je mets l'adresse de l'image puis le nom et le repertoir où je souhaie l'enregistrer(ici meteo.jpg--ce qui la place dans le repertoire courant du programme)
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franNebP0PM."jpg, "temps."jpg
'A present, je peux ouvrir cette image en utilisant NVIEW.DLL
filename$ ="temps."jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
sub tempsmatD
'j'utilise en 1er l'api OLELOADPICTUREPATH.....qui me permet de telecharger une image depuis une adresse URL
'je mets l'adresse de l'image puis le nom et le repertoir où je souhaie l'enregistrer(ici meteo.jpg--ce qui la place dans le repertoire courant du programme)
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franNebP1AM."jpg, "temps."jpg
'A present, je peux ouvrir cette image en utilisant NVIEW.DLL
filename$ ="temps."jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
sub tempsapD
'j'utilise en 1er l'api OLELOADPICTUREPATH.....qui me permet de telecharger une image depuis une adresse URL
'je mets l'adresse de l'image puis le nom et le repertoir où je souhaie l'enregistrer(ici meteo.jpg--ce qui la place dans le repertoire courant du programme)
DownloadFile "http://www.lachainemeteo.com/ImagesLCM/franNebP1PM."jpg, "temps."jpg
'A present, je peux ouvrir cette image en utilisant NVIEW.DLL
filename$ ="temps."jpg
ext$ = Mid$(filename$, Len(filename$)-2, Len(filename$))
IF ext$ = ""jpg THEN
image.Handle = Load_JPG(filename$,0)
image.Width = GetWidth
image.Height = GetHeight
imagebit.Width = GetWidth
imagebit.Height = GetHeight
END IF
END SUB
SUB close
end
END SUB
'Bin c fini.....j'espere que cette source vous servira à tous....
'Encore merci à LYP, qui m'a enseigner ses connaissances et sans qui ce logiciel n'aurais jamais pu voir le jour.
'Form.ShowModal
|
|