dans l'aide il y en a sinon voici deux ou trois exemple de programme l'utilisant
Copie et ip :
Code : Tout sélectionner
InitNetwork()
Enumeration
#Listview_0
#Button_0
#Frame3D_0
#Button_1
EndEnumeration
If OpenWindow(0, 217, 18, 190, 310, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Ip")
If CreateGadgetList(WindowID())
ListViewGadget(#Listview_0, 30, 50, 130, 160)
ButtonGadget(#Button_0, 10, 240, 70, 40, "Scan")
Frame3DGadget(#Frame3D_0, 20, 30, 150, 190, "Adresse ip")
ButtonGadget(#Button_1, 90, 240, 90, 40, " Copier dans le presse papier", #PB_Button_MultiLine)
EndIf
EndIf
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_EventGadget
Select EventGadgetID()
Case #Button_0
ip(#Listview_0,100)
Case #Button_1
copie(#Listview_0)
EndSelect
EndIf
Until EventID = #PB_Event_CloseWindow
End
ConvertAngle:
Code : Tout sélectionner
Enumeration
#Window_0
EndEnumeration
Enumeration
#CheckBox_0
#CheckBox_1
#CheckBox_2
#CheckBox_3
#CheckBox_4
#CheckBox_5
#String_0
#String_1
#Frame3D_0
#Frame3D_1
#Button_0
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 216, 0, 182, 358, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Convertisseur d'angles")
If CreateGadgetList(WindowID())
CheckBoxGadget(#CheckBox_0, 30, 30, 90, 20, "Degré")
CheckBoxGadget(#CheckBox_1, 30, 60, 100, 20, "Grade")
CheckBoxGadget(#CheckBox_2, 30, 90, 90, 20, "Radian")
CheckBoxGadget(#CheckBox_3, 30, 180, 90, 20, "Degré")
CheckBoxGadget(#CheckBox_4, 30, 210, 100, 20, "Grade")
CheckBoxGadget(#CheckBox_5, 30, 240, 100, 20, "Radian")
StringGadget(#String_0, 30, 120, 100, 20, "")
StringGadget(#String_1, 30, 270, 100, 20, "", #PB_String_ReadOnly)
Frame3DGadget(#Frame3D_0, 20, 10, 140, 140, "Angle à convertir")
Frame3DGadget(#Frame3D_1, 20, 160, 140, 150, "Angle converti")
ButtonGadget(#Button_0, 20, 320, 140, 30, "Convertir")
EndIf
EndIf
EndProcedure
Open_Window_0()
Repeat
EventID=WindowEvent()
If EventID=#PB_Event_Gadget
Select EventGadgetID()
Case #Button_0
If GetGadgetState(#CheckBox_0)=1
enter=1
ElseIf GetGadgetState(#CheckBox_1)=1
enter=2
ElseIf GetGadgetState(#CheckBox_2)=1
enter=3
EndIf
If GetGadgetState(#CheckBox_3)=1
sortie=1
ElseIf GetGadgetState(#CheckBox_4)=1
sortie=2
ElseIf GetGadgetState(#CheckBox_5)=1
sortie=3
EndIf
Angle.f=ValF(GetGadgetText(#String_0))
Angles.f=ConvertAngle(Angle,enter,sortie)
SetGadgetText(#String_1,StrF(Angles.f))
EndSelect
EndIf
Until EventID=#PB_Event_CloseWindow
et pour le color du button
premier exemple(type=0):
Code : Tout sélectionner
Enumeration
#Win0
#BP0
#Im0
EndEnumeration
res = CreateImage(#Im0,60,40)
If OpenWindow(#Win0, 292, 141, 100, 60, #PB_Window_SystemMenu| #PB_Window_TitleBar , "Couleur")
If CreateGadgetList(WindowID())
ButtonImageGadget(#BP0, 20, 10, 60, 40, ImageID())
EndIf
EndIf
Repeat
Event = WaitWindowEvent()
GadgetID = EventGadgetID()
If Event = #PB_EventGadget
If GadgetID = #BP0
Color.l = ColorRequester()
ColorButton(#BP0,0,0,60,40,0,Color,0,0,0)
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
End
deuxieme exemple(type=1):
Code : Tout sélectionner
Enumeration
#Win0
#BP0
#Im0
EndEnumeration
res = CreateImage(#Im0,60,40)
If OpenWindow(#Win0, 292, 141, 100, 60, #PB_Window_SystemMenu| #PB_Window_TitleBar , "Couleur")
If CreateGadgetList(WindowID())
ButtonImageGadget(#BP0, 20, 10, 60, 40, ImageID())
EndIf
EndIf
Repeat
Event = WaitWindowEvent()
GadgetID = EventGadgetID()
If Event = #PB_EventGadget
If GadgetID = #BP0
Color.l = ColorRequester()
red=Red(Color)
green=Green(Color)
blue=Blue(Color)
ColorButton(#BP0,0,0,60,40,,0,red,green,blue)
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
End