Moinsen zusammen
Ich hatte mal wieder etwas Zeit übrig bei der Arbeit. Neulich habe ich einige Projekte gesehen (ich will da mal keinen Namen nennen *husthust*) bei denen die GUI stark vernachlässigt wurde.
So habe ich mich in den letzten Tagen etwas damit befasst und entschieden, ein paar eigene "GUI-Designs" zu entwerfen, die man dann mit trotzdem möglichst viel Anpassungsmöglichkeiten für seine eigenen Programme verwenden kann (und das ganze natürlich mit möglichst wenig mühe).
Zum Einstieg werde ich immer die Funktion MsgBox in meinen Designs darstellen und eure Meinung zum Aussehen erfragen resp. DESIGNTECHNISCHE Verbesserungsvorschläge entgegennehmen.
Als erstes Ergebnis präsentiere ich euch in diesem Post:
iMsgBox Alpha
Info
Wie bereits gesagt ist diese Funktion ein abklatsch der AutoIt-MsgBox. In diesem Falle im bekannten MacOSx-Design.
Die Alpha-Version ist ein 3h-Skript in meiner üblich chaotischen WIP-Form. Ich werde den Code selbstverständlich noch kürzen wo ee geht.
Funktionieren tut sie praktisch wie die AutoIt-Version, allerdings habe ich die Flags aktuell noch auf Button und Icon-Einstellungen beschränkt.
Wenn das speziell gewünscht wird, werd ich die anderen Flags auch noch hinzufügen allerdings will ich damit nicht zuviel Zeit verlierden.
Feedback
Wie gesagt wünsch ich mir ein Feedback bloss über das Design. Codetechnisch (aufbau) werd ich auf jeden Fall noch einiges daran ändern aber ich will vorerst wissen, ob euch das Design gefällt oder ob es irgendwelche bugs gibt.
Bugs
- Icons sind teilweise transparent (liegt daran das alles mit 100% weiss transparent gemacht wird damit die abgerundeten "Ecken" richtig dargestellt werden). FIXED
So ich hoffe mal ich hab nichts vergessen. Ordner entpacken, ein Projekt im selben Ordner erstellen (ob man es mit den bildern etc. auch in den Include-Ordner kopieren darf weiss ich nicht) und eine MsgBox erstellen.
Der Aufruf ist praktisch derselbe lest aber zur Sicherheit die Beschreibung durch.
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
; #FUNCTION# ====================================================================================================================
; Name...........: _iMsgBox
; Description ...: Creates a MsgBox in iOS-Style
; Syntax.........: _iMsgBox( flag, "title", "text" [, timeout])
; Parameters ....: flag - The flag indicates the possible button combinations and the icon-related flags.
; title - The title of the message box.
; text - The text of the message box.
; timeout - [optional] Timeout in seconds. After the timeout has elapsed the message box will be automatically closed. The default is 0, which is no timeout.
; Return values .: Success: Returns the ID of the button pressed.
; Closed: Returns 0 if the user closed the window.
; Failure: Returns -1 if the message box timed out.
; Author ........: General Kaboom (http://www.autoit.de)
; Version........: Alpha
; Modified.......:
; Remarks .......: Button-related flag values
; |0 Ok (Returns 3)
; |1 Ok and Cancel (Returns 2 or 3)
; |2 Abort, Retry and Ignore (Returns 1, 2 or 3)
; |3 Yes, No and Cancel (Returns 1, 2 or 3)
; |4 Yes and No (Returns 2 or 3)
; |5 Retry and Cancel (Returns 2 or 3)
; |6 Cancel, Try Again and Continue (Returns 1, 2 or 3)
; Icon-related flag values
; |0 No icon
; |16 Stop-sign icon
; |32 Question-mark icon
; |48 Exclamation-point icon
; |64 Information-sign icon
; Related .......: iInputBox, iGUI
; Link ..........:
; Example .......: _iMsgBox(0, "Test", "Hello World! I will disappear in 10 seconds.")
; Credits........: Thanks to Grossvater for the _GUICtrlPic-Functions used below...you rock!!! Also thanks to Andy Gongea for the current icons. I'il later make the original ones on my own.
; ===============================================================================================================================
Func _iMsgBox($Flag, $Title, $Content, $Timeout = 0)
;Window creation
$MsgBox = GUICreate("iMsgBox", 440, 180, -1, -1, 0x80000000, 0x00080000)
$Background = GUICtrlCreatePic("", 0, 20, 440, 120)
_GUICtrlPic_GradientFill($Background, "f2f2f2", "f2f2f2")
$Pic00 = _GUICtrlPic_Create(@ScriptDir & "\data\Button_Idle.png", 140, 140, 100, 40)
$Pic01 = _GUICtrlPic_Create(@ScriptDir & "\data\Button_Idle.png", 240, 140, 100, 40)
$Pic02 = _GUICtrlPic_Create(@ScriptDir & "\data\Button_Idle.png", 340, 140, 100, 40)
$Pic1 = _GUICtrlPic_Create(@ScriptDir & "\data\Edge_LU.png", 0, 0, 20, 20)
$Pic2 = _GUICtrlPic_Create(@ScriptDir & "\data\Close_Idle.png", 20, 0, 20, 20)
$Pic3 = _GUICtrlPic_Create(@ScriptDir & "\data\WO_Deactivated.png", 40, 0, 20, 20)
$Pic4 = _GUICtrlPic_Create(@ScriptDir & "\data\WO_Deactivated.png", 60, 0, 20, 20)
$Pic5 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 80, 0, 20, 20)
$Pic6 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 100, 0, 20, 20)
$Pic7 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 120, 0, 20, 20)
$Pic8 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 140, 0, 20, 20)
$Pic9 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 160, 0, 20, 20)
$Pic10 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 180, 0, 20, 20)
$Pic11 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 200, 0, 20, 20)
$Pic12 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 220, 0, 20, 20)
$Pic13 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 240, 0, 20, 20)
$Pic14 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 260, 0, 20, 20)
$Pic15 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 280, 0, 20, 20)
$Pic16 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 300, 0, 20, 20)
$Pic17 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 320, 0, 20, 20)
$Pic18 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 340, 0, 20, 20)
$Pic19 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 360, 0, 20, 20)
$Pic20 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 380, 0, 20, 20)
$Pic21 = _GUICtrlPic_Create(@ScriptDir & "\data\Patch_10.png", 400, 0, 20, 20)
$Pic22 = _GUICtrlPic_Create(@ScriptDir & "\data\EDGE_RU.png", 420, 0, 20, 20)
$Button3 = GUICtrlCreateLabel("", 345, 153, 86, 30, $SS_CENTER)
$Button2 = GUICtrlCreateLabel("", 245, 153, 86, 30, $SS_CENTER)
$Button1 = GUICtrlCreateLabel("", 145, 153, 86, 30, $SS_CENTER)
GUICtrlSetState($Button1, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_HIDE)
;End of window creation. Start flag settings
If $Timeout > 0 Then
$Timer = TimerInit()
$Timeout = $Timeout * 1000
EndIf
If StringLen($Title) > 30 Then
$Title = StringLeft($Title, 30) & "..."
EndIf
$Label1 = GUICtrlCreateLabel($Title, 80, 3, 380, 15, $SS_CENTER)
GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Label1, 8, 800, 0, "MS Reference Sans Serif")
Switch $Flag
Case 0 To 6
Switch $Flag
Case 0
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 340, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Pic01, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "OK")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 1
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "OK")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 2
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Abort")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Ignore")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 3
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 4
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Yes")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "No")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 5
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 6
$Label2 = GUICtrlCreateLabel($Content, 5, 25, 430, 120, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
EndSwitch
Case 16 To 22
GUISetIcon(@ScriptDir & "\data\Error.ico", -1)
$Icon1 = GUICtrlCreateIcon("H:\Skripte\AutoIt\WIP\iMsgBox\data\Error.ico", -1, 204, 25, 32, 32)
$Fag = $Flag - 16
Switch $Fag
Case 0
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 340, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Pic01, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "OK")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 1
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "OK")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 2
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Abort")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Ignore")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 3
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 4
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Yes")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "No")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 5
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 6
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
EndSwitch
Case 32 To 38
GUISetIcon(@ScriptDir & "\data\Help.ico", -1)
$Icon1 = GUICtrlCreateIcon(@ScriptDir &"\data\Help.ico", -1, 204, 25, 32, 32)
$Fag = $Flag - 32
Switch $Fag
Case 0
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 340, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Pic01, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "OK")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 1
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "OK")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 2
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Abort")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Ignore")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 3
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 4
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Yes")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "No")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 5
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 6
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
EndSwitch
Case 48 To 54
GUISetIcon(@ScriptDir & "\data\Warning.ico", -1)
$Icon1 = GUICtrlCreateIcon(@ScriptDir &"\data\Warning.ico", -1, 204, 25, 32, 32)
$Fag = $Flag - 48
Switch $Fag
Case 0
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 340, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Pic01, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "OK")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 1
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "OK")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 2
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Abort")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Ignore")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 3
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 4
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Yes")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "No")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 5
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 6
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
EndSwitch
Case 64 To 70
GUISetIcon(@ScriptDir & "\data\Info-Light.ico", -1)
$Icon1 = GUICtrlCreateIcon(@ScriptDir &"\data\Info-Light.ico", -1, 204, 25, 32, 32)
$Fag = $Flag - 64
Switch $Fag
Case 0
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 340, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Pic01, $GUI_HIDE)
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "OK")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 1
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "OK")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 2
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Abort")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Ignore")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 3
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 4
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Yes")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "No")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 5
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 240, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Pic00, $GUI_HIDE)
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "Retry")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
Case 6
$Label2 = GUICtrlCreateLabel($Content, 5, 57, 430, 88, $SS_CENTER)
$Overlay = GUICtrlCreatePic("", 0, 140, 140, 40)
_GUICtrlPic_GradientFill($Overlay, "f2f2f2", "f2f2f2")
GUICtrlSetState($Button1, $GUI_SHOW)
GUICtrlSetData($Button1, "Yes")
GUICtrlSetBkColor($Button1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button1, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button2, $GUI_SHOW)
GUICtrlSetData($Button2, "No")
GUICtrlSetBkColor($Button2, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button2, 8, 800, 0, "MS Reference Sans Serif")
GUICtrlSetState($Button3, $GUI_SHOW)
GUICtrlSetData($Button3, "Cancel")
GUICtrlSetBkColor($Button3, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Button3, 8, 800, 0, "MS Reference Sans Serif")
EndSwitch
Case Else
MsgBox(16, "Error", "Error, you set a wrong flag for your iMsgBox")
Exit
EndSwitch
GUICtrlSetBkColor($Label2, 0xf2f2f2)
GUICtrlSetFont($Label2, 8, 400, 0, "MS Reference Sans Serif")
GUISetBkColor(0xFFFFFF, $MsgBox)
DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $MsgBox, "long", 0xFFFFFF, "byte", 255, "long", True)
GUISetState(@SW_SHOW)
Global $test = 0 ;Used later to prevent the hover from flickering
Global $test1 = 0 ;Used later to prevent the hover from flickering
Global $test2 = 0 ;Used later to prevent the hover from flickering
Global $test3 = 0 ;Used later to prevent the hover from flickering
Global $test4 = 0 ;Used later to prevent the hover from flickering
Global $test5 = 0 ;Used later to prevent the hover from flickering
Global $test6 = 0 ;Used later to prevent the hover from flickering
While 1
_mover($Pic2, @ScriptDir & "\data\Close_Idle.png", @ScriptDir & "\data\Close_Over.png", $Pic00, $Pic01, $Pic02, $Button1, $Button2, $Button3, @ScriptDir & "\data\Button_Idle.png", @ScriptDir & "\data\Button_Over.png") ;Creates a "hover"-effect on the button-picture
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Pic2
_GUICtrlPic_SetImage($Pic2, @ScriptDir & "\data\Close_Press.png")
Sleep(250)
Return 0
Exit
Case $Pic00
_GUICtrlPic_SetImage($Pic00, @ScriptDir & "\data\Button_Press.png")
Sleep(250)
Return 1
Exit
Case $Pic01
_GUICtrlPic_SetImage($Pic01, @ScriptDir & "\data\Button_Press.png")
Sleep(250)
Return 2
Exit
Case $Pic02
_GUICtrlPic_SetImage($Pic02, @ScriptDir & "\data\Button_Press.png")
Sleep(250)
Return 3
Exit
EndSwitch
If $Timeout > 0 And TimerDiff($Timer) > $Timeout Then
Return -1
Exit
EndIf
WEnd
EndFunc ;==>_iMsgBox
Func _mover($control1, $bild1, $bild2, $control2, $control3, $control4, $Overlabel1, $Overlabel2, $Overlabel3, $ButtonOver, $ButtonIdle) ;Function to create a "hover"-effect on the chosen picture
$mpos = GUIGetCursorInfo()
If (IsArray($mpos)) Then
If ($mpos[4] = $control1) Then
If $test = 0 Then
$test = 1
_GUICtrlPic_SetImage($control1, $bild2)
EndIf
Else
If $test = 1 Then
$test = 0
_GUICtrlPic_SetImage($control1, $bild1)
EndIf
EndIf
If ($mpos[4] = $control2) Then
If $test1 = 0 Then
$test1 = 1
_GUICtrlPic_SetImage($control2, $ButtonIdle)
EndIf
Else
If $test1 = 1 Then
$test1 = 0
_GUICtrlPic_SetImage($control2, $ButtonOver)
EndIf
EndIf
If ($mpos[4] = $control3) Then
If $test2 = 0 Then
$test2 = 1
_GUICtrlPic_SetImage($control3, $ButtonIdle)
EndIf
Else
If $test2 = 1 Then
$test2 = 0
_GUICtrlPic_SetImage($control3, $ButtonOver)
EndIf
EndIf
If ($mpos[4] = $control4) Then
If $test3 = 0 Then
$test3 = 1
_GUICtrlPic_SetImage($control4, $ButtonIdle)
EndIf
Else
If $test3 = 1 Then
$test3 = 0
_GUICtrlPic_SetImage($control4, $ButtonOver)
EndIf
EndIf
If ($mpos[4] = $Overlabel1) Then
If $test4 = 0 Then
$test4 = 1
_GUICtrlPic_SetImage($control2, $ButtonIdle)
EndIf
Else
If $test4 = 1 Then
$test4 = 0
_GUICtrlPic_SetImage($control2, $ButtonOver)
EndIf
EndIf
If ($mpos[4] = $Overlabel2) Then
If $test5 = 0 Then
$test5 = 1
_GUICtrlPic_SetImage($control3, $ButtonIdle)
EndIf
Else
If $test5 = 1 Then
$test5 = 0
_GUICtrlPic_SetImage($control3, $ButtonOver)
EndIf
EndIf
If ($mpos[4] = $Overlabel3) Then
If $test6 = 0 Then
$test6 = 1
_GUICtrlPic_SetImage($control4, $ButtonIdle)
EndIf
Else
If $test6 = 1 Then
$test6 = 0
_GUICtrlPic_SetImage($control4, $ButtonOver)
EndIf
EndIf
EndIf
EndFunc ;==>_mover
Func _GUICtrlPic_Create($sPicPath, $iLeft, $iTop, $iWidth = 0, $iHeight = 0, $uStyles = -1, $uExStyles = -1, $bKeepAspectRatio = False)
Local Const $IMAGE_BITMAP = 0x0000
Local Const $STM_SETIMAGE = 0x0172
Local $aResult, $hBitmap, $hImage, $Height, $Width, $CtrlID
Local $aBitmap = _GUICtrlPic_LoadImage($sPicPath)
If @error Then Return SetError(@error, @extended, False)
$hBitmap = $aBitmap[0]
$Width = $aBitmap[1]
$Height = $aBitmap[2]
If $iWidth = 0 And $iHeight = 0 Then
$iWidth = $Width
$iHeight = $Height
Else
$hBitmap = _GUICtrlPic_ScaleBitmap($hBitmap, $iWidth, $iHeight, $Width, $Height, $bKeepAspectRatio)
If @error Then Return SetError(@error, @extended, False)
EndIf
$CtrlID = GUICtrlCreatePic("", $iLeft, $iTop, $iWidth, $iHeight, $uStyles, $uExStyles)
GUICtrlSendMsg($CtrlID, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
DllCall("Gdi32.dll", "BOOL", "DeleteObject", "Handle", $hBitmap)
Return $CtrlID
EndFunc ;==>_GUICtrlPic_Create
Func _GUICtrlPic_SetImage($idPic, $sPicPath, $bKeepAspectRatio = False)
Local Const $IMAGE_BITMAP = 0x0000
Local Const $STM_SETIMAGE = 0x0172
Local Const $STM_GETIMAGE = 0x0173
Local $aSize, $hBM, $hBitmap, $Height, $Width
Local $aBitmap = _GUICtrlPic_LoadImage($sPicPath)
If @error Or $aBitmap[0] = 0 Then Return SetError(@error, @extended, False)
$hBitmap = $aBitmap[0]
$Width = $aBitmap[1]
$Height = $aBitmap[2]
$aSize = WinGetClientSize(GUICtrlGetHandle($idPic))
$hBitmap = _GUICtrlPic_ScaleBitmap($hBitmap, $aSize[0], $aSize[1], $Width, $Height, $bKeepAspectRatio)
$hBM = GUICtrlSendMsg($idPic, $STM_GETIMAGE, $IMAGE_BITMAP, 0)
If $hBM Then DllCall("Gdi32.dll", "BOOL", "DeleteObject", "Handle", $hBM)
GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
DllCall("Gdi32.dll", "BOOL", "DeleteObject", "Handle", $hBitmap)
GUICtrlSetState($idPic, $GUI_SHOW)
Return True
EndFunc ;==>_GUICtrlPic_SetImage
Func _GUICtrlPic_LoadImage($sPicPath)
Local $aResult, $hBitmap, $hImage, $Height, $Width
Local $aBitmap[3] = [0, 0, 0]
Local $hGDIPDll = DllOpen("GDIPlus.dll")
If $hGDIPDll = -1 Then Return SetError(1, 2, $aBitmap)
Local $tInput = DllStructCreate("UINT Version;ptr Callback;BOOL NoThread;BOOL NoCodecs")
Local $pInput = DllStructGetPtr($tInput)
Local $tToken = DllStructCreate("ULONG_PTR Data")
Local $pToken = DllStructGetPtr($tToken)
DllStructSetData($tInput, "Version", 1)
$aResult = DllCall($hGDIPDll, "INT", "GdiplusStartup", "Ptr", $pToken, "Ptr", $pInput, "Ptr", 0)
If @error Then Return SetError(@error, @extended, $aBitmap)
$aResult = DllCall($hGDIPDll, "INT", "GdipLoadImageFromFile", "WStr", $sPicPath, "Ptr*", 0)
If @error Or $aResult[2] = 0 Then
Local $Error = @error, $Extended = @extended
DllCall($hGDIPDll, "None", "GdiplusShutdown", "Ptr", DllStructGetData($tToken, "Data"))
DllClose($hGDIPDll)
Return SetError($Error, $Extended, $aBitmap)
EndIf
$hImage = $aResult[2]
$aResult = DllCall($hGDIPDll, "INT", "GdipGetImageWidth", "Handle", $hImage, "UINT*", 0)
$Width = $aResult[2]
$aResult = DllCall($hGDIPDll, "INT", "GdipGetImageHeight", "Handle", $hImage, "UINT*", 0)
$Height = $aResult[2]
$aResult = DllCall($hGDIPDll, "INT", "GdipCreateHBITMAPFromBitmap", "Handle", $hImage, "Ptr*", 0, "DWORD", 0xFF000000)
$hBitmap = $aResult[2]
DllCall($hGDIPDll, "INT", "GdipDisposeImage", "Handle", $hImage)
DllCall($hGDIPDll, "None", "GdiplusShutdown", "Ptr", DllStructGetData($tToken, "Data"))
DllClose($hGDIPDll)
$aBitmap[0] = $hBitmap
$aBitmap[1] = $Width
$aBitmap[2] = $Height
Return $aBitmap
EndFunc ;==>_GUICtrlPic_LoadImage
Func _GUICtrlPic_ScaleBitmap($hBitmap, $iNewW, $iNewH, $iBitmapW, $iBitmapH, $bKeepAspectRatio = False)
Local Const $IMAGE_BITMAP = 0x0000
If $bKeepAspectRatio Then
If $iBitmapW >= $iBitmapH Then
$iBitmapH *= $iNewW / $iBitmapW
$iBitmapW = $iNewW
If $iBitmapH > $iNewH Then
$iBitmapW *= $iNewH / $iBitmapH
$iBitmapH = $iNewH
EndIf
Else
$iBitmapW *= $iNewH / $iBitmapH
$iBitmapH = $iNewH
If $iBitmapW > $iNewW Then
$iBitmapH *= $iNewW / $iBitmapW
$iBitmapW = $iNewW
EndIf
EndIf
Else
$iBitmapW = $iNewW
$iBitmapH = $iNewH
EndIf
Local $aResult = DllCall("User32.dll", "Handle", "CopyImage", _
"Handle", $hBitmap, "UINT", $IMAGE_BITMAP, "INT", $iBitmapW, "INT", $iBitmapH, "UINT", 0x4 + 0x8)
If @error Then Return SetError(@error, @extended, False)
Return $aResult[0]
EndFunc ;==>_GUICtrlPic_ScaleBitmap
Func _GUICtrlPic_GradientFill($idCTRL, $C1, $C2, $D = 1, $3D = 3, $GC = 0, $BW = 0, $BH = 0)
Local Static $STM_SETIMAGE = 0x172
Local Static $IMAGE_BITMAP = 0x0
Local Static $BITSPIXEL = 0xC
Local $hWnd
If IsHWnd($idCTRL) Then
$hWnd = $idCTRL
Else
$hWnd = GUICtrlGetHandle($idCTRL)
EndIf
Local $aResult = DllCall("User32.dll", "Int", "GetClassName", "Hwnd", $hWnd, _
"Str", "", "Int", 256)
If $aResult[2] <> "Static" Then
Return False
EndIf
Local $GDIPDll = DllOpen("GDIPlus.dll")
If $GDIPDll = -1 Then
Return SetError(1, 0, False)
EndIf
Local $SI = DllStructCreate("UInt Version;Ptr Callback;Bool NoThread;Bool NoCodecs")
Local $Token = DllStructCreate("ulong_ptr Data")
DllStructSetData($SI, "Version", 1)
$aResult = DllCall($GDIPDll, "Int", "GdiplusStartup", _
"Ptr", DllStructGetPtr($Token), "Ptr", DllStructGetPtr($SI), "Ptr", 0)
If @error Then
DllClose($GDIPDll)
Return SetError(1, 0, False)
EndIf
Local $GDIPToken = DllStructGetData($Token, "Data")
Local $RECT = DllStructCreate("Long; Long; Long Right;Long Bottom")
DllCall("User32.dll", "Bool", "GetClientRect", "Hwnd", $hWnd, _
"Ptr", DllStructGetPtr($RECT))
Local $W = DllStructGetData($RECT, "Right")
Local $H = DllStructGetData($RECT, "Bottom")
Switch $D
Case 0, 1, 2, 3
Case Else
$D = 0
EndSwitch
Switch $3D
Case 1, 2, 3
Case Else
$3D = 1
EndSwitch
Switch $GC
Case 0, 1
Case Else
$GC = 0
EndSwitch
If $BW = 0 Then $BW = $W
If $BH = 0 Then $BH = $H
Local $pBITMAP = DllStructCreate("Ptr")
DllCall($GDIPDll, "Int", "GdipCreateBitmapFromScan0", _
"Int", $W, "Int", $H, "Int", 0, "Int", 0x26200A, "Ptr", 0, _
"Ptr", DllStructGetPtr($pBITMAP))
$pBITMAP = DllStructGetData($pBITMAP, 1)
Local $pGRAPHICS = DllStructCreate("Ptr")
DllCall($GDIPDll, "Int", "GdipGetImageGraphicsContext", _
"Ptr", $pBITMAP, "Ptr", DllStructGetPtr($pGRAPHICS))
$pGRAPHICS = DllStructGetData($pGRAPHICS, 1)
DllCall($GDIPDll, "Int", "GdipSetSmoothingMode", "Ptr", $pGRAPHICS, "Int", 0)
Local $RECTF = DllStructCreate("Float L;Float T;Float R;Float B")
DllStructSetData($RECTF, "R", $BW)
DllStructSetData($RECTF, "B", $BH)
Local $Color1 = "0xFF" & $C1
Local $Color2 = "0xFF" & $C2
Local $pBRUSH = DllStructCreate("Ptr")
DllCall($GDIPDll, "Int", "GdipCreateLineBrushFromRect", _
"Ptr", DllStructGetPtr($RECTF), "Int", $Color1, "Int", $Color2, _
"Int", $D, "Int", 0, "Ptr", DllStructGetPtr($pBRUSH))
$pBRUSH = DllStructGetData($pBRUSH, 1)
DllCall($GDIPDll, "Int", "GdipSetLineGammaCorrection", "Ptr", $pBRUSH, _
"Int", $GC)
Local $RELINT = DllStructCreate("Float[5]")
Switch $3D
Case 1
DllStructSetData($RELINT, 1, 0.00, 1)
DllStructSetData($RELINT, 1, 0.25, 2)
DllStructSetData($RELINT, 1, 0.50, 3)
DllStructSetData($RELINT, 1, 0.75, 4)
DllStructSetData($RELINT, 1, 1.00, 5)
Case 2
DllStructSetData($RELINT, 1, 0.0, 1)
DllStructSetData($RELINT, 1, 0.5, 2)
DllStructSetData($RELINT, 1, 1.0, 3)
DllStructSetData($RELINT, 1, 0.5, 4)
DllStructSetData($RELINT, 1, 0.0, 5)
Case Else
DllStructSetData($RELINT, 1, 0.0, 1)
DllStructSetData($RELINT, 1, 1.0, 2)
DllStructSetData($RELINT, 1, 1.0, 3)
DllStructSetData($RELINT, 1, 1.0, 4)
DllStructSetData($RELINT, 1, 0.0, 5)
EndSwitch
Local $RELPOS = DllStructCreate("Float[5]")
DllStructSetData($RELPOS, 1, 0.0, 1)
If $3D <> 3 Then
DllStructSetData($RELPOS, 1, 0.25, 2)
Else
DllStructSetData($RELPOS, 1, 0.15, 2)
EndIf
DllStructSetData($RELPOS, 1, 0.5, 3)
If $3D <> 3 Then
DllStructSetData($RELPOS, 1, 0.75, 4)
Else
DllStructSetData($RELPOS, 1, 0.85, 4)
EndIf
DllStructSetData($RELPOS, 1, 1.0, 5)
DllCall($GDIPDll, "Int", "GdipSetLineBlend", _
"Ptr", $pBRUSH, "Ptr", DllStructGetPtr($RELINT), _
"Ptr", DllStructGetPtr($RELPOS), "Int", 5)
DllCall($GDIPDll, "Int", "GdipFillRectangle", "Ptr", $pGRAPHICS, _
"Ptr", $pBRUSH, "Float", 0, "Float", 0, "Float", $W, "Float", $H)
Local $hBitmap = DllStructCreate("Ptr")
DllCall($GDIPDll, "Int", "GdipCreateHBITMAPFromBitmap", _
"Ptr", $pBITMAP, "Ptr", DllStructGetPtr($hBitmap), "Int", 0XFFFFFFFF)
$hBitmap = DllStructGetData($hBitmap, 1)
DllCall($GDIPDll, "Int", "GdipDeleteBrush", "Ptr", $pBRUSH)
DllCall($GDIPDll, "Int", "GdipDisposeImage", "Ptr", $pBITMAP)
DllCall($GDIPDll, "Int", "GdipDeleteGraphics", "Ptr", $pGRAPHICS)
DllCall($GDIPDll, "None", "GdiplusShutdown", "Ptr", $GDIPToken)
DllClose($GDIPDll)
GUICtrlSendMsg($idCTRL, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
Return $hBitmap
EndFunc ;==>_GUICtrlPic_GradientFill
Ich wünsch euch viel spass und bitte vergesst das Feedback nicht