Ouvertures des dialogs

Contenu du snippet

Permet d'ouvrir des dialogs avec plus de fantasie !

Source / Exemple :


; 4 ouvertures fantaisistes
; Codées par Nazario
; Utilisation: /dial.style Style Dialog size1 size2
;*********************
; 4 exemples des 4 styles:
; /dial.style 1 hu 400 200 
; /dial.style 2 hu 200 200
; /dial.style 3 hu 200 300
; /dial.style 4 hu 300 200

alias dial.style { 
if $1 = 1 && $3 {
;  /dial.style 1 hu 400 200 
if $dialog($2) { dialog -x $2 }
var %m = 1 , %mm = 1 | dialog -m $2 $2
goto style1
:style1
if $gettok(%m,2,32) != stop { inc %m }
if $gettok(%mm,2,32) != stop { inc %mm }
if (%m = $calc($3 + 1)) { var %m = %m stop }
if (%mm = $calc($4 +1)) { var %mm = %mm stop }
if $gettok(%m,2,32) = stop && $gettok(%mm,2,32) = stop { goto fin }
dialog -s $2 $dialog($2).w $dialog($2).h $gettok(%m,1,32) $gettok(%mm,1,32) 
goto style1
}

if $1 = 2 && $3 {
; /dial.style 2 hu 200 200
if $dialog($2) { dialog -x $2 }
var %m = 1 , %mm = 2 | dialog -m $2 $2
goto style2
:style2
if $gettok(%m,2,32) != stop { inc %m }
if $gettok(%mm,2,32) != stop { inc %mm }
if %m = $calc($3 + 1) { var %m = %m stop }
if %mm = $calc($4 +1) { var %mm = %mm stop }
if $gettok(%m,2,32) = stop && $gettok(%mm,2,32) = stop { goto fin }
if $window(-1).h <= 600 { dialog -s $2 $iif($3 < 200,$calc($3 *3),$3) $iif($3 < 200,$calc($3 *3),50) $gettok(%m,1,32) $gettok(%mm,1,32)  }
if $window(-1).h > 600 { dialog -s $2 $iif($3 <= 200,$calc($3 *2.4),200) $iif($3 < 200,$calc($3 *1.5),200) $gettok(%m,1,32) $gettok(%mm,1,32) }
goto style2
}

if $1 = 3 && $3 {
; /dial.style 3 hu 200 300
if $dialog($2) { dialog -x $2 }
var %m = 1 , %mm = 2 | dialog -m $2 $2
goto style3
:style3
if $gettok(%m,2,32) != stop { inc %m }
if $gettok(%m,2,32) = stop { inc %mm }
if %m = $calc($3 + 1) { var %m = %m stop }
if %mm = $calc($4 +1) { var %mm = %mm stop }
if $gettok(%m,2,32) = stop && $gettok(%mm,2,32) = stop { goto fin }
dialog -s $2 $calc($window(-1).w / 2.5) $calc($window(-1).h / $iif($window(-1).w <= 600,2.5,4))  $gettok(%m,1,32) $gettok(%mm,1,32) 
goto style3
}

if $1 = 4 && $3 {
; /dial.style 4 hu 300 200
if $dialog($2) { dialog -x $2 }
var %m = 1, %mm = 2 | dialog -m $2 $2
goto style4
:style4
if $gettok(%m,2,32) != stop { inc %m }
if $gettok(%m,2,32) = stop { inc %mm }
if %m = $calc($3 + 1) { var %m = %m stop }
if %mm = $calc($4 +1) { var %mm = %mm stop }
if $gettok(%m,2,32) = stop && $gettok(%mm,2,32) = stop { goto fin }
dialog -s $2  $gettok(%m,1,32) $gettok(%m,1,32) $gettok(%mm,1,32) $gettok(%mm,1,32)
goto style4
}

else { echo -a Erreur de syntaxe ! }
:fin
} 
dialog hu {
size 0 0 0 0
}

Conclusion :


4 ouvertures fantaisistes
Utilisation: /dial.style Style Dialog size1 size2

4 exemples des 4 styles:
/dial.style 1 hu 400 200
/dial.style 2 hu 200 200
/dial.style 3 hu 200 300
/dial.style 4 hu 300 200

A voir également

Vous n'êtes pas encore membre ?

inscrivez-vous, c'est gratuit et ça prend moins d'une minute !

Les membres obtiennent plus de réponses que les utilisateurs anonymes.

Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.

Le fait d'être membre vous permet d'avoir des options supplémentaires.