AutoIt Français

Nouveau forum : http://www.autoitscript.fr/
 
AccueilFAQRechercherS'enregistrerMembresGroupesConnexionhttp://www.autoitscript.fr

Partagez | 
 

 WinsetTrans (divers exemples-by autoit-fr)

Voir le sujet précédent Voir le sujet suivant Aller en bas 
AuteurMessage
ani
Modérateur
Modérateur


Nombre de messages : 563
Date d'inscription : 23/01/2007

MessageSujet: WinsetTrans (divers exemples-by autoit-fr)   2007-03-02, 23:28

[b]Exemple numero 1[/b]
Interface GUI utilisant l'expression suivante : [u]Description[/u]

[b]FOR[/b] <variable> = <start> [b]To[/b] <stop> [[b]Step[/b] <stepval>]
[i][b]WinSetTrans[/b]("","",<variable>)[/i]
[i][b]sleep[/b](valeur)[/i]
[b]NEXT[/b]


[color=red]#include[/color] <GUIConstants.au3>
[color=red]#NoTrayIcon[/color]

[b]Dim[/b] [color=mediumblue]$st1[/color] [color=green],[/color] [color=mediumblue]$st2[/color] [color=green],[/color] [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] [color=mediumblue]$titre[/color]
[color=mediumblue]$st1[/color] [color=green]=[/color] "1"
[color=mediumblue]$st2[/color] [color=green]=[/color] "255"
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] "2"
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] "10"
[color=mediumblue]$titre[/color] [color=green]=[/color] "Exemple by autoit Fr"
[color=mediumblue]$GUI[/color] [color=green]=[/color] [b]GUICreate[/b] ( [color=mediumblue]$titre[/color] [color=green],[/color] 281 [color=green],[/color] 80 [color=green],[/color] 221 [color=green],[/color] 271 )

[color=mediumblue]$Group1[/color] [color=green]=[/color] [b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] 4 [color=green],[/color] 0 [color=green],[/color] 273 [color=green],[/color] 73 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_START[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Start" [color=green],[/color] 20 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Staart[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st1[/color] [color=green],[/color] 12 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_START[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Staart[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_START[/color] [color=green],[/color] 255 [color=green],[/color] 0 )

[color=mediumblue]$LABEL_STOP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Stop" [color=green],[/color] 68 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Stoop[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st2[/color] [color=green],[/color] 60 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_STOP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Stoop[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STOP[/color] [color=green],[/color] 255 [color=green],[/color] 0 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_STEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Step" [color=green],[/color] 116 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Steep[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] 108 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_STEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Steep[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STEP[/color] [color=green],[/color] 3 [color=green],[/color] 1 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "[b]Sleep"[/b] [color=green],[/color] 160 [color=green],[/color] 16 [color=green],[/color] 31 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] 156 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 )
[color=mediumblue]$Updown_SLEEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$SLEEP[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_SLEEP[/color] [color=green],[/color] 50 [color=green],[/color] 0 )
[color=mediumblue][/color]
[color=mediumblue]$Button1[/color] [color=green]=[/color] [b]GUICtrlCreateButton[/b] ( "Test" [color=green],[/color] 216 [color=green],[/color] 34 [color=green],[/color] 51 [color=green],[/color] 21 [color=green],[/color] 0 )

[b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] - 99 [color=green],[/color] - 99 [color=green],[/color] 1 [color=green],[/color] 1 ) ; on ferme le group
[b]GUISetState[/b] ( [color=fuchsia]@SW_SHOW[/color] )
[color=green][/color]
[color=green]While[/color] 1
[color=mediumblue]$msg[/color] [color=green]=[/color] [b]GUIGetMsg[/b] ( )
[b]Select[/b]
Case [color=mediumblue]$msg[/color] [color=green]=[/color] [color=mediumblue]$Button1[/color]
_TestEffet ( )
Case [color=mediumblue]$msg[/color] [color=green]=[/color] [color=mediumblue]$GUI_EVENT_CLOSE[/color]
_EffetOut ( )
[b]EndSelect[/b]
[color=green]WEnd[/color]
[color=green][/color]
[color=green]Func[/color] _TestEffet ( )
[color=mediumblue]$st1[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Staart[/color] )
[color=mediumblue]$st2[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Stoop[/color] )
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Sleep[/color] )
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Steep[/color] )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st1[/color] [color=green]To[/color] [color=mediumblue]$st2[/color] Step [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >TestEffet

[color=green]Func[/color] _EffetOut ( )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st2[/color] [color=green]To[/color] [color=mediumblue]$st1[/color] Step - [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[b]Exit[/b]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >_EffetOut



l'exemple suivant est à l'identique du premier mais cette fois-ci en utilisant le [b]GuiOnEvent[/b]


[color=red]#include[/color] <GUIConstants.au3>
[color=red]#NoTrayIcon[/color]

Opt ( "GUIOnEventMode" [color=green],[/color] 1 )
[b]Dim[/b] [color=mediumblue]$st1[/color] [color=green],[/color] [color=mediumblue]$st2[/color] [color=green],[/color] [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] [color=mediumblue]$titre[/color]
[color=mediumblue]$st1[/color] [color=green]=[/color] "1"
[color=mediumblue]$st2[/color] [color=green]=[/color] "255"
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] "2"
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] "10"
[color=mediumblue]$titre[/color] [color=green]=[/color] "Exemple by autoit + Fr"
[color=mediumblue][/color]
[color=mediumblue]$GUI[/color] [color=green]=[/color] [b]GUICreate[/b] ( [color=mediumblue]$titre[/color] [color=green],[/color] 284 [color=green],[/color] 80 [color=green],[/color] 221 [color=green],[/color] 271 )
[b]GUISetOnEvent[/b] ( [color=mediumblue]$GUI_EVENT_CLOSE[/color] [color=green],[/color] "_quitter" )
[color=mediumblue]$Group1[/color] [color=green]=[/color] [b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] 4 [color=green],[/color] 0 [color=green],[/color] 273 [color=green],[/color] 73 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_START[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Start" [color=green],[/color] 20 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Staart[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st1[/color] [color=green],[/color] 12 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_START[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Staart[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_START[/color] [color=green],[/color] 255 [color=green],[/color] 0 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_STOP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Stop" [color=green],[/color] 68 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Stoop[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st2[/color] [color=green],[/color] 60 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_STOP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Stoop[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STOP[/color] [color=green],[/color] 255 [color=green],[/color] 0 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_STEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Step" [color=green],[/color] 116 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( -1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$Steep[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] 108 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Updown_STEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Steep[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STEP[/color] [color=green],[/color] 3 [color=green],[/color] 1 )
[color=mediumblue][/color]
[color=mediumblue]$LABEL_SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "[b]Sleep"[/b] [color=green],[/color] 160 [color=green],[/color] 16 [color=green],[/color] 31 [color=green],[/color] 17 )
[b]GUICtrlSetFont[/b] ( - 1 [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[color=mediumblue]$SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] 156 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 )
[color=mediumblue]$Updown_SLEEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$SLEEP[/color] )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_SLEEP[/color] [color=green],[/color] 50 [color=green],[/color] 0 )
[color=mediumblue][/color]
[color=mediumblue]$Button1[/color] [color=green]=[/color] [b]GUICtrlCreateButton[/b] ( "Test" [color=green],[/color] 216 [color=green],[/color] 34 [color=green],[/color] 51 [color=green],[/color] 21 [color=green],[/color] 0 )
[b]GUICtrlSetOnEvent[/b] ( [color=mediumblue]$Button1[/color] [color=green],[/color] "_TestEffet" )

[b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] - 99 [color=green],[/color] - 99 [color=green],[/color] 1 [color=green],[/color] 1 )

[b]GUISetState[/b] ( [color=fuchsia]@SW_SHOW[/color] )
[color=green][/color]
[color=green]While[/color] 1
[b]Sleep[/b] ( 100 )
[color=green]WEnd[/color]
[color=green][/color]
[color=green]Func[/color] _TestEffet ( )
[color=mediumblue]$st1[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Staart[/color] )
[color=mediumblue]$st2[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Stoop[/color] )
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Sleep[/color] )
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Steep[/color] )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st1[/color] [color=green]To[/color] [color=mediumblue]$st2[/color] Step [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >TestEffet
[color=green][/color]
[color=green]Func[/color] _Quitter ( )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st2[/color] [color=green]To[/color] [color=mediumblue]$st1[/color] Step - [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[b]Exit[/b]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >_EffetOut


Dernière édition par le 2007-03-04, 14:14, édité 5 fois
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
ani
Modérateur
Modérateur


Nombre de messages : 563
Date d'inscription : 23/01/2007

MessageSujet: Re: WinsetTrans (divers exemples-by autoit-fr)   2007-03-02, 23:29

toujours avec le GuiOnEvent mais en utilisant un classement pour s'y retrouver.

[color=red]#include[/color] <GUIConstants.au3>
[color=red]#NoTrayIcon[/color]

Opt ( "GUIOnEventMode" [color=green],[/color] 1 )
[b]Dim[/b] [color=mediumblue]$st1[/color] [color=green],[/color] [color=mediumblue]$st2[/color] [color=green],[/color] [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] [color=mediumblue]$titre[/color]
[color=mediumblue]$st1[/color] [color=green]=[/color] "1"
[color=mediumblue]$st2[/color] [color=green]=[/color] "255"
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] "2"
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] "10"
[color=mediumblue]$titre[/color] [color=green]=[/color] "Exemple by autoit Fr"
; Création de l'interface
[color=mediumblue]$GUI[/color] [color=green]=[/color] [b]GUICreate[/b] ( [color=mediumblue]$titre[/color] [color=green],[/color] 284 [color=green],[/color] 80 [color=green],[/color] 221 [color=green],[/color] 271 )
; Création des divers evenement
[b]GUISetOnEvent[/b] ( [color=mediumblue]$GUI_EVENT_CLOSE[/color] [color=green],[/color] "_quitter" )
; création du group
[color=mediumblue]$Group1[/color] [color=green]=[/color] [b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] 4 [color=green],[/color] 0 [color=green],[/color] 273 [color=green],[/color] 73 )
; Création des labels
[color=mediumblue]$LABEL_START[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Start" [color=green],[/color] 20 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[color=mediumblue]$LABEL_STOP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Stop" [color=green],[/color] 68 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[color=mediumblue]$LABEL_STEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Step" [color=green],[/color] 116 [color=green],[/color] 16 [color=green],[/color] 26 [color=green],[/color] 17 )
[color=mediumblue]$LABEL_SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "[b]Sleep"[/b] [color=green],[/color] 160 [color=green],[/color] 16 [color=green],[/color] 31 [color=green],[/color] 17 )
; On souligne les labels
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_START[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_STOP[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_STEP[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_SLEEP[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
; Création des cases
[color=mediumblue]$Staart[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st1[/color] [color=green],[/color] 12 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Stoop[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$st2[/color] [color=green],[/color] 60 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$Steep[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_STEP[/color] [color=green],[/color] 108 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
[color=mediumblue]$SLEEP[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] [color=green],[/color] 156 [color=green],[/color] 34 [color=green],[/color] 47 [color=green],[/color] 21 [color=green],[/color] [b]BitOR[/b] ( [color=mediumblue]$ES_AUTOHSCROLL[/color] [color=green],[/color] [color=mediumblue]$ES_NUMBER[/color] ) )
; création des updown
[color=mediumblue]$Updown_START[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Staart[/color] )
[color=mediumblue]$Updown_STOP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Stoop[/color] )
[color=mediumblue]$Updown_STEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$Steep[/color] )
[color=mediumblue]$Updown_SLEEP[/color] [color=green]=[/color] GUICtrlCreateUpdown ( [color=mediumblue]$SLEEP[/color] )
; création des limitations
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_START[/color] [color=green],[/color] 255 [color=green],[/color] 0 )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STOP[/color] [color=green],[/color] 255 [color=green],[/color] 0 )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_STEP[/color] [color=green],[/color] 3 [color=green],[/color] 1 )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$Updown_SLEEP[/color] [color=green],[/color] 50 [color=green],[/color] 0 )
; Création du bouton qui simulera l'animation désiré
[color=mediumblue]$Button1[/color] [color=green]=[/color] [b]GUICtrlCreateButton[/b] ( "Test" [color=green],[/color] 216 [color=green],[/color] 34 [color=green],[/color] 51 [color=green],[/color] 21 [color=green],[/color] 0 )
[b]GUICtrlSetState[/b] ( [color=mediumblue]$Button1[/color] [color=green],[/color] [color=mediumblue]$GUI_FOCUS[/color] )
[b]GUICtrlSetOnEvent[/b] ( [color=mediumblue]$Button1[/color] [color=green],[/color] "_TestEffet" )
; on ferme le premier group
[b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] - 99 [color=green],[/color] - 99 [color=green],[/color] 1 [color=green],[/color] 1 )
[b]GUISetState[/b] ( [color=fuchsia]@SW_SHOW[/color] )
[color=green]While[/color] 1
[b]Sleep[/b] ( 100 )
[color=green]WEnd[/color]
; Cette fonction va lire les valeur qui se trouve dans les input
[color=green]Func[/color] _TestEffet ( )
[color=mediumblue]$st1[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Staart[/color] )
[color=mediumblue]$st2[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Stoop[/color] )
[color=mediumblue]$VALEUR_SLEEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Sleep[/color] )
[color=mediumblue]$VALEUR_STEP[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$Steep[/color] )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st1[/color] [color=green]To[/color] [color=mediumblue]$st2[/color] Step [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >TestEffet
; Cette fonction peut remplacer l'effet Fade + in ( user32.dll / AW_FADE_OUT [color=green]=[/color] 0x00090000 )
; AW signifie Animate Windows
; Nous la simulont avec [color=green]For[/color] [color=green]=[/color] [color=green]To[/color] [Step ]
; elle servira ici pour la fermeture du programme.
[color=green]Func[/color] _Quitter ( )
[color=green]For[/color] [color=mediumblue]$VALEUR_X[/color] [color=green]=[/color] [color=mediumblue]$st2[/color] [color=green]To[/color] [color=mediumblue]$st1[/color] Step - [color=mediumblue]$VALEUR_STEP[/color]
[b]WinSetTrans[/b] ( "" [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$VALEUR_X[/color] )
[b]sleep[/b] ( [color=mediumblue]$VALEUR_SLEEP[/color] )
[color=green]Next[/color]
[b]Exit[/b]
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >_EffetOut
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
ani
Modérateur
Modérateur


Nombre de messages : 563
Date d'inscription : 23/01/2007

MessageSujet: Re: WinsetTrans (divers exemples-by autoit-fr)   2007-03-04, 13:51

[b]Exemple numero 2[/b]
Winsettrans par [u][b]slider[/b][/u]

[color=red]#include[/color] <GUIConstants.au3>
[color=red]#NoTrayIcon[/color]
[color=red][/color]
[color=mediumblue]$titre[/color] [color=green]=[/color] "Slider by autoit-Fr"

; Création de l'interface
[color=mediumblue]$GUI[/color] [color=green]=[/color] [b]GUICreate[/b] ( [color=mediumblue]$titre[/color] [color=green],[/color] 246 [color=green],[/color] 74 [color=green],[/color] - 1 [color=green],[/color] - 1 [color=green],[/color] [color=mediumblue]$WS_CAPTION[/color] )

; on ajoute la couleur de fond pour l'interface ( qui sera ici noir )
[b]GUISetBkColor[/b] ( 0x000000 )

; Création d'un groupe
[color=mediumblue]$Group1[/color] [color=green]=[/color] [b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] 4 [color=green],[/color] 0 [color=green],[/color] 237 [color=green],[/color] 68 )

; Création des Labels
[color=mediumblue]$LABEL_SLIDER[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Valeur du Slider:" [color=green],[/color] 10 [color=green],[/color] 21 [color=green],[/color] 78 [color=green],[/color] 17 )
[color=mediumblue]$LABEL_POURCENT[/color] [color=green]=[/color] [b]GUICtrlCreateLabel[/b] ( "Valeur en Pourcentage:" [color=green],[/color] 10 [color=green],[/color] 42 [color=green],[/color] 113 [color=green],[/color] 17 )

; Mise en [color=green]forme[/color] des labels
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_SLIDER[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
[b]GUICtrlSetFont[/b] ( [color=mediumblue]$LABEL_POURCENT[/color] [color=green],[/color] 8 [color=green],[/color] 400 [color=green],[/color] 4 [color=green],[/color] "MS Sans Serif" )
; On ajoute la couleur
[b]GUICtrlSetColor[/b] ( [color=mediumblue]$LABEL_SLIDER[/color] [color=green],[/color] 0xD4D0C8 )
[b]GUICtrlSetColor[/b] ( [color=mediumblue]$LABEL_POURCENT[/color] [color=green],[/color] 0xD4D0C8 )

; Création des Input
[color=mediumblue]$VALEUR_SLIDER[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( "" [color=green],[/color] 90 [color=green],[/color] 21 [color=green],[/color] 30 [color=green],[/color] 17 [color=green],[/color] [color=mediumblue]$ES_READONLY[/color] )
[color=mediumblue]$VALEUR_POURCENT[/color] [color=green]=[/color] [b]GUICtrlCreateInput[/b] ( "" [color=green],[/color] 125 [color=green],[/color] 42 [color=green],[/color] 110 [color=green],[/color] 17 [color=green],[/color] [color=mediumblue]$ES_READONLY[/color] )

; Création du slider
[color=mediumblue]$SLIDER_TRANSITION[/color] [color=green]=[/color] [b]GUICtrlCreateSlider[/b] ( 125 [color=green],[/color] 14 [color=green],[/color] 110 [color=green],[/color] 25 [color=green],[/color] [color=mediumblue]$TBS_AUTOTICKS[/color] + [color=mediumblue]$TBS_HORZ[/color] + [color=mediumblue]$TBS_TOP[/color] [color=green],[/color] [color=mediumblue]$WS_EX_CLIENTEDGE[/color] )
[b]GUICtrlSetState[/b] ( [color=mediumblue]$SLIDER_TRANSITION[/color] [color=green],[/color] [color=mediumblue]$GUI_FOCUS[/color] )
[color=mediumblue]$Slider[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$SLIDER_TRANSITION[/color] )

; On ajoute une limitation au divers élèment
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$VALEUR_SLIDER[/color] [color=green],[/color] 3 )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$VALEUR_POURCENT[/color] [color=green],[/color] 3 )
[b]GUICtrlSetLimit[/b] ( [color=mediumblue]$SLIDER_TRANSITION[/color] [color=green],[/color] 255 [color=green],[/color] 10 )

; On ajoute une valeur initial
[b]GUICtrlSetData[/b] ( [color=mediumblue]$VALEUR_SLIDER[/color] [color=green],[/color] 255 )
[b]GUICtrlSetData[/b] ( [color=mediumblue]$VALEUR_POURCENT[/color] [color=green],[/color] 100 )
[b]GUICtrlSetData[/b] ( [color=mediumblue]$SLIDER_TRANSITION[/color] [color=green],[/color] 255 )

;fermeture du group
[b]GUICtrlCreateGroup[/b] ( "" [color=green],[/color] - 99 [color=green],[/color] - 99 [color=green],[/color] 1 [color=green],[/color] 1 )
;
[b]GUISetState[/b] ( [color=fuchsia]@SW_SHOW[/color] )
[color=green][/color]
[color=green]While[/color] 1
[color=mediumblue]$msg[/color] [color=green]=[/color] [b]GUIGetMsg[/b] ( )
[b]Select[/b]
Case [color=mediumblue]$msg[/color] [color=green]=[/color] [color=mediumblue]$GUI_EVENT_CLOSE[/color]
[b]exit[/b]
Case [color=mediumblue]$SLIDER_TRANSITION[/color]
[color=mediumblue]$val_Majslider[/color] [color=green]=[/color] [b]GUICtrlRead[/b] ( [color=mediumblue]$SLIDER_TRANSITION[/color] )
[color=green]If[/color] [color=mediumblue]$Slider[/color] <> [color=mediumblue]$val_Majslider[/color] [color=green]Then[/color] Majslider ( )
EndSelect
[color=green]WEnd[/color]
[color=green][/color]
[color=green]Func[/color] Majslider ( )
[color=mediumblue]$Slider[/color] [color=green]=[/color] [color=mediumblue]$val_Majslider[/color]
[b]GUICtrlSetData[/b] ( [color=mediumblue]$VALEUR_POURCENT[/color] [color=green],[/color] [color=mediumblue]$Slider[/color] / 255 * 100 )
[b]GUICtrlSetData[/b] ( [color=mediumblue]$VALEUR_SLIDER[/color] [color=green],[/color] [color=mediumblue]$Slider[/color] )
[b]WinSetTrans[/b] ( $GUI [color=green],[/color] "" [color=green],[/color] [color=mediumblue]$Slider[/color] )
[color=green]EndFunc[/color] ; [color=green]=[/color] [color=green]=[/color] >Majslider
Revenir en haut Aller en bas
Voir le profil de l'utilisateur
Contenu sponsorisé




MessageSujet: Re: WinsetTrans (divers exemples-by autoit-fr)   Aujourd'hui à 10:42

Revenir en haut Aller en bas
 
WinsetTrans (divers exemples-by autoit-fr)
Voir le sujet précédent Voir le sujet suivant Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» [Exemple] Textes divers (lien mort)
» Divers renseignements
» Infos section: tutoriels et exemples
» Besoin d'un développeur autoit
» Banque d'exemples C++

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
AutoIt Français :: AutoIt v3 :: Scripts-
Sauter vers: