Voici mon code:
Code : Tout sélectionner
;- Global Variables and Constants
Global BubbleTipStyle.l:BubbleTipStyle=0
;- Window Constants
Enumeration 1
#Window_Form1
EndEnumeration
#WindowIndex=#PB_Compiler_EnumerationValue
;- Gadget Constants
Enumeration 1
;Window_Form1
#Gadget_Form1_String2
#Gadget_Form1_String3
#Gadget_Form1_Image4
#Gadget_Form1_Button5
EndEnumeration
#GadgetIndex=#PB_Compiler_EnumerationValue
;- Image Constants
Enumeration 1
#Image_Form1_Image4
EndEnumeration
#ImageIndex=#PB_Compiler_EnumerationValue
;- Load Images
CatchImage(#Image_Form1_Image4,?_OPT_Form1_Image4)
DataSection
_OPT_Form1_Image4:IncludeBinary "Images\Carte.bmp"
EndDataSection
Procedure.l Window_Form1()
If OpenWindow(#Window_Form1,69,90,740,567,"Work Form1",#PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_MinimizeGadget)
StringGadget(#Gadget_Form1_String2,5,10,80,20,"")
StringGadget(#Gadget_Form1_String3,100,10,80,20,"")
ImageGadget(#Gadget_Form1_Image4,5,35,728,732,ImageID(#Image_Form1_Image4))
ButtonGadget(#Gadget_Form1_Button5,190,10,60,20,"Valider")
HideWindow(#Window_Form1,0)
ProcedureReturn WindowID(#Window_Form1)
EndIf
EndProcedure
;- Main Loop
If Window_Form1()
quitForm1=0
Repeat
EventID =WaitWindowEvent()
MenuID =EventMenu()
GadgetID =EventGadget()
WindowID =EventWindow()
Select EventID
Case #PB_Event_CloseWindow
If WindowID=#Window_Form1
quitForm1=1
EndIf
Case #PB_Event_Gadget
Select GadgetID
Case #Gadget_Form1_String2
Case #Gadget_Form1_String3
Case #Gadget_Form1_Image4
Select EventType()
Case #PB_EventType_LeftDoubleClick
Case #PB_EventType_RightDoubleClick
Case #PB_EventType_RightClick
Default
EndSelect
Case #Gadget_Form1_Button5
Long.s = GetGadgetText(#Gadget_Form1_String2)
Long1.f = ValF(Long.s)
Lat.s = GetGadgetText(#Gadget_Form1_String3)
Lat1.f = ValF(Lat.s)
If StartDrawing(ImageOutput(#Image_Form1_Image4))
Circle(Long1.f, Lat1.f, 5, RGB(249, 13, 6))
StopDrawing()
EndIf
EndSelect
EndSelect
Until quitForm1
CloseWindow(#Window_Form1)
EndIf
End