#include <WindowsConstants.au3>
#include 'CalcFontSize.au3'

Global $sText1 = 'AutoIt v3'
Global $sText2 = 'is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting.' & @CRLF & 'It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!'

Global $iWndStyle = BitOR($WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)
Global $hGui = GUICreate('Test', 640, 340, 10, 10, $iWndStyle)

Global $idLabel1 = GUICtrlCreateLabel($sText1, 10, 10, 520, 50, $SS_CENTER)
GUICtrlSetFont(-1, 0, 800, 6, 'Times New Roman', 5) ; zum testen Fontsize auf 0 setzen
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlSetBkColor(-1, 0xFFAAAA)
_CalcFontSizeRegister(-1)

Global $idLabel2 = GUICtrlCreateLabel($sText2, 10, 70, 620, 100)
GUICtrlSetFont(-1, 0, 800, 2, 'Arial', 5) ; zum testen Fontsize auf 0 setzen
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlSetBkColor(-1, 0xAAFFAA)
_CalcFontSizeRegister(-1)

Global $idLabel3 = GUICtrlCreateLabel($sText2, 10, 180, 620, 100)
GUICtrlSetFont(-1, 0, 800, 2, 'Arial', 5)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
GUICtrlSetBkColor(-1, 0xAAFFAA)
;~ _CalcFontSizeRegister(-1) ; dieses Label ohne CalcFontSizeRegister (Befehl auskommentiert)
_CalcFontSize(-1) ; diese Funktion berechnet die Fontgroesse einmalig (ohne automatische Anpassung)

Global $idButton = GUICtrlCreateButton('Exit', 540, 10, 90, 30)
GUICtrlSetFont(-1, 0, 600, 0, 'Courier New', 5) ; zum testen Fontsize auf 0 setzen
GUICtrlSetResizing(-1, $GUI_DOCKAUTO)
_CalcFontSizeRegister(-1)

GUISetState(@SW_SHOW)
While 1
    Local $nMsg = GUIGetMsg()
    Switch $nMsg
		Case $GUI_EVENT_CLOSE, $idButton
            Exit
    EndSwitch
WEnd
