#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
_SplashScreen
("Prelucrare grafica a testelor", "Prelucrare Teste", "v1.0", "Copyright 2010 © Mihai Iancu")
_Exit
()
While 1
Sleep(10)
Switch GUIGetMsg()
Case -3
_Exit
()
EndSwitch
WEnd
; #FUNCTION# ====================================================================================================
; Name...........: _SplashScreen
; Description....: Create SplashScreen
; Syntax.........: _SplashScreen($sText1="Text Description", $sText2="Text Application",$sText3="Text Version", $sTextCopyright = "Text © Copyright", $iTime=3, $iW=400,$iH=200,$Color = 0xABCDEF)
; Parameters.....: $sText1 - top-left text
; $sText2 - app title (center) text
; $sText3 - subtitle (center) text
; $sTextCopyright - bottom-right text
; $iTime - time (in seconds), [Optional]
; $iW - width of the splash, [Optional]
; $iH - height of the splash, [Optional]
; $Color - the color of the splash, [Optional]
;
; Return values..: one cup of coffee (big one!)
; Author.........: Mihai Iancu (taietel at yahoo dot com)
; ===============================================================================================================
Func _SplashScreen
($sText1="DEMO Description", $sText2="DEMO Application",$sText3="DEMO Version", $sTextCopyright = "DEMO © Copyright", $iTime=3, $iW=400,$iH=200,$Color = 0x00AA00)
If $iW = -1 Or $iW = Default Then $iW = 400
If $iH = -1 Or $iH = Default Then $iH = 200
If $iTime = -1 Or $iTime = Default Then $iTime = 3
If $Color = -1 Or $Color = Default Then $Color = 0xABCDEF
Local $hGui = GUICreate("Splash", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
_Gradient
(0x000001, $Color, $iW, $iH,0,0,1)
_RoundCorners
($hGui)
Local $lblSus = GUICtrlCreateLabel($sText1,20,10,$iW/2-40,20)
GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xDDDDDD)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
_3DText
($sText2, 10, 60, 380, 52, 34, "b", "n",-1,0x442200)
_3DText
($sText3, 10, 115, 380, 22, 16, "b", "n","Arial")
_Gradient
(0xFF0000, 0xFFFF00,($iW-40)/2, 2,20,$iH-40,0)
_Gradient
(0xFFFF00, 0xFF0000,($iW-40)/2, 2,20++($iW-40)/2,$iH-40,0)
GUICtrlCreateLabel($sTextCopyright,20,$iH-30,$iW-40,20,$SS_RIGHT)
GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xeeee00)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreatePic("", 2, 2, $iW-4, $iH-4)
WinSetTrans($hGui,"",0)
GUISetState(@SW_SHOW)
For $i=0 To 250 Step 10
Sleep(30)
WinSetTrans($hGui,"",$i)
Next
Sleep($iTime*1000)
For $i=250 To 0 Step -10
Sleep(30)
WinSetTrans($hGui,"",$i)
Next
GUIDelete($hGui)
EndFunc
Func _Exit
()
Exit
EndFunc
; #FUNCTION# ====================================================================================================
; Name...........: _RoundCorners
; Description....: Create GUI with rounded corners
; Syntax.........: _RoundCorners($hWnd,$iR)
; Parameters.....: $hWnd - window handle
; $iR - corner radius, [Optional]
;
; Return values..: Success: Nonzero
; Failure: 0
;
; Author.........: Mihai Iancu (taietel at yahoo dot com)
; ===============================================================================================================
Func _RoundCorners
($hWnd,$iR=10)
Local $x
Local $pos = WinGetPos($hWnd)
If $pos[2]>$pos[3] Then
$x = $pos[2]/$pos[3]
Else
$x = $pos[3]/$pos[2]
EndIf
Local $aResult = DllCall("gdi32.dll", "handle", "CreateRoundRectRgn", "int", 0, "int", 0, "int", $pos[2], "int", $pos[3], _
"int", $iR*$x, "int", $iR*$x)
Local $aRet = DllCall("user32.dll", "int", "SetWindowRgn", "hwnd", $hWnd, "handle", $aResult[0], "bool", False)
If @error Then Return SetError(@error, @extended, False)
Return $aRet[0]
EndFunc ;==>_RoundCorners
; #FUNCTION# ====================================================================================================
; Name...........: _Gradient
; Description....: Create gradient between two colors
; Syntax.........: _Gradient($lColor1, $lColor2, $iW=100, $iH=20, $iX=0, $iY=0, $iDirection=0)
; Parameters.....: $lColor1 - First color to begin with
; $lColor2 - Second color
; $iW - width of the area, [Optional]
; $iH - height of the area, [Optional]
; $iX - position from left, [Optional]
; $iY - position from top, [Optional]
; $iY - direction to fill the gradient, [Optional]
; 0 - vertical fill
; 1 - horizontal fill
;
; Return values..: none
;
; Author.........: Mihai Iancu (taietel at yahoo dot com)
; ===============================================================================================================
Func _Gradient
($lColor1, $lColor2, $iW=100, $iH=20, $iX=0, $iY=0, $iDirection=0)
Local $m, $Ri,$Rf,$Rs,$Gi,$Gf,$Gs,$Bi,$Bf,$Bs
Switch $iDirection
Case 0
$m = $iW
Case 1
$m = $iH
EndSwitch
$Ri = Mod($lColor1,256)
$Gi = BitAND($lColor1/256,255)
$Bi = BitAND($lColor1/65536,255)
$Rf = Mod($lColor2,256)
$Gf = BitAND($lColor2/256,255)
$Bf = BitAND($lColor2/65536,255)
$Rs = Abs($Ri - $Rf)/$m
$Gs = Abs($Gi - $Gf)/$m
$Bs = Abs($Bi - $Bf)/$m
If $Rf < $Ri Then $Rs = -$Rs
If $Gf < $Gi Then $Gs = -$Gs
If $Bf < $Bi Then $Bs = -$Bs
For $i = 0 To $m
$Rf = $Ri + $Rs * $i
$Gf = $Gi + $Gs * $i
$Bf = $Bi + $Bs * $i
GUICtrlCreateLabel(" ", $iX+$i-$i*$iDirection, $iY + $i*$iDirection, 2+$iDirection*$iW, 2+(1-$iDirection)*$iH)
GUICtrlSetBkColor(-1, "0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2))
GUICtrlSetState(-1,$GUI_DISABLE)
Next
EndFunc
; #FUNCTION# ====================================================================================================
; Name...........: _3DText
; Description....: Create 3D White Text
; Syntax.........: _3DText($sText,$iX, $iY, $iW=-1, $iH=-1, $iFontSize = 14, $sWeight="b", $sStyle = "n", $sFont="Times New Roman")
; Parameters.....: $sText - Text string
; $iX - position from left, [Optional]
; $iY - position from top, [Optional]
; $iW - width of the area, [Optional]
; $iH - height of the area, [Optional]
; $iFontSize - size of the font, [Optional]
; $sWeight - weight of the font, [Optional]
; |b - bold [Default]
; |n - normal
; $sStyle - style of the font, [Optional]
; |n - normal [Default]
; |i - italic
; |u - underline
; $sFont - font used [Optional]
; $lColor - color of text [Optional]
; Return values..: none
;
; Author.........: Mihai Iancu (taietel at yahoo dot com)
; ===============================================================================================================
Func _3DText
($sText,$iX, $iY, $iW=-1, $iH=-1, $iFontSize = 14, $sWeight="b", $sStyle = "n", $sFont="Times New Roman",$lColor=0xffffff)
If $iW = -1 Or $iW = Default Then $iW = Int(StringLen($sText)*$iFontSize/1.2)
If $iH = -1 Or $iH = Default Then $iH = Int(1.5*$iFontSize)
If $iFontSize = -1 Or $iFontSize = Default Then $iFontSize = 14
If $sWeight = -1 Or $sWeight = Default Then $sWeight = "b"
If $sStyle = -1 Or $sStyle = Default Then $sStyle = "n"
If $sFont = -1 Or $sFont = Default Then $sFont = "Garamond"
Switch $sWeight
Case "b"
$iWeight = 800
Case "n"
$iWeight = 400
EndSwitch
Switch $sStyle
Case "n"
$iStyle = 0
Case "i"
$iStyle = 2
Case "u"
$iStyle = 4
EndSwitch
Local $Ri,$Rf,$Gi,$Gf,$Bi,$Bf
$Ri = Mod($lColor,256)
$Gi = BitAND($lColor/256,255)
$Bi = BitAND($lColor/65536,255)
Local $iZ = Int($iFontSize/10)
For $i=0 To $iZ Step 0.5
$Rf = $Ri*$i
$Gf = $Gi*$i
$Bf = $Bi*$i
GUICtrlCreateLabel($sText, $iX-$i, $iY+$i, $iW, $iH, $SS_CENTER)
GUICtrlSetColor(-1,"0x"&Hex($Bf,2) & Hex($Gf,2) & Hex($Rf,2))
GUICtrlSetFont(-1, $iFontSize, $iWeight, $iStyle, $sFont)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
Next
EndFunc