Spoiler anzeigen
#include
[/autoit] [autoit][/autoit] [autoit]#Region ### START Koda GUI section ### Form=Forms\musikfreundeplaner.kxf\Forms\musikfreundeplaner.kxf
$Form1_1 = GUICreate("Form1", 751, 501, 293, 269)
$Punkte = GUICtrlCreateCombo("Punkte", 8, 24, 225, 25)
GUICtrlSetData(-1, "1 Punkte|2 Punkte|3 Punkte|4 Punkte|5 Punkte")
$Fortschrittprogress = GUICtrlCreateProgress(0, 432, 745, 25)
$Terminelabel = GUICtrlCreateLabel("Nächste ausstehende Termine:", 8, 176, 413, 43)
GUICtrlSetFont(-1, 25, 400, 0, "Old English Text MT")
$Termineliste = GUICtrlCreateList("", 8, 224, 417, 150)
GUICtrlSetFont(-1, 12, 400, 0, "MT Extra")
$Absagetag = GUICtrlCreateInput("", 184, 56, 49, 21)
$Taglabel = GUICtrlCreateLabel("Absagetage vor Konzert:", 8, 56, 179, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Krankheitchkbox = GUICtrlCreateCheckbox("Krankheitchkbox", 216, 80, 17, 17)
$Krankheitlabel = GUICtrlCreateLabel("Wegen Krankheit?", 7, 78, 135, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Konzertelabel = GUICtrlCreateLabel("Konzerte geschafft:", 8, 384, 168, 39)
GUICtrlSetFont(-1, 20, 400, 0, "Pristina")
$Prozentelabel = GUICtrlCreateLabel("%", 24, 464, 12, 17)
$Stuecklabel = GUICtrlCreateLabel("Stück", 112, 464, 32, 17)
$AusstehendeKonzert = GUICtrlCreateLabel("AusstehendeKonzert", 224, 464, 102, 17)
$Punktebutton = GUICtrlCreateButton("Punkte", 560, 240, 177, 33, 0)
$Listebutton = GUICtrlCreateButton("Besetzungsliste", 560, 288, 177, 33, 0)
$Button1 = GUICtrlCreateButton("Termine ändern", 560, 336, 177, 33, 0)
$Button2 = GUICtrlCreateButton("Button2", 560, 384, 177, 33, 0)
$1 = GUICtrlCreateLabel(" 1", 456, 16, 17, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$2 = GUICtrlCreateLabel("2", 488, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$3 = GUICtrlCreateLabel("3", 520, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$4 = GUICtrlCreateLabel("4", 552, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$5 = GUICtrlCreateLabel("5", 584, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$6 = GUICtrlCreateLabel("6", 616, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$7 = GUICtrlCreateLabel("7", 648, 16, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$8 = GUICtrlCreateLabel("8", 456, 48, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$9 = GUICtrlCreateLabel("9", 488, 48, 13, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$10 = GUICtrlCreateLabel("10", 512, 48, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$11 = GUICtrlCreateLabel("11", 544, 48, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$12 = GUICtrlCreateLabel("12", 576, 48, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$13 = GUICtrlCreateLabel("13", 608, 48, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$14 = GUICtrlCreateLabel("14", 640, 48, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$15 = GUICtrlCreateLabel("15", 448, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$16 = GUICtrlCreateLabel("16", 480, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$17 = GUICtrlCreateLabel("17", 512, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$18 = GUICtrlCreateLabel("18", 544, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$19 = GUICtrlCreateLabel("19", 576, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$20 = GUICtrlCreateLabel("20", 608, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$21 = GUICtrlCreateLabel("21", 640, 80, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$22 = GUICtrlCreateLabel("22", 448, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$23 = GUICtrlCreateLabel("23", 480, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$24 = GUICtrlCreateLabel("24", 512, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$25 = GUICtrlCreateLabel("25", 544, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$26 = GUICtrlCreateLabel("26", 576, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$27 = GUICtrlCreateLabel("27", 608, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$28 = GUICtrlCreateLabel("28", 640, 112, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$nextmon = GUICtrlCreateButton(">", 672, 16, 33, 25, 0)
$prevmon = GUICtrlCreateButton("<", 408, 16, 33, 25, 0)
$29 = GUICtrlCreateLabel("29", 448, 144, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$30 = GUICtrlCreateLabel("30", 480, 144, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$31 = GUICtrlCreateLabel("31", 512, 144, 22, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$mon = @MON
$Monat = 0
$Jahr = @YEAR
call("Monat")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $nextmon
$mon = $mon+1
If $mon >12 Then
$mon = 1
$Jahr = $Jahr+1
EndIf
Call("Monat")
Case $prevmon
$mon = $mon-1
If $mon <1 Then
$mon = 12
$Jahr = $Jahr-1
EndIf
Call("Monat")
Case $Punkte
EndSwitch
WEnd
Func Monat()
If $mon = 1 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Januar "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
GUICtrlSetState($31, $GUI_show)
$Tage = 31
EndIf
If $mon = 2 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Februar "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
$schaltjahr = $Jahr / 4
If $schaltjahr-Round($schaltjahr,0) = 0 Then
GUICtrlSetState($31, $GUI_Hide)
GUICtrlSetState($30, $GUI_Hide)
$Tage = 29
Else
GUICtrlSetState($31, $GUI_Hide)
GUICtrlSetState($30, $GUI_Hide)
GUICtrlSetState($29, $GUI_Hide)
$Tage = 28
EndIf
EndIf
If $mon = 3 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("März "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 31
EndIf
If $mon = 4 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("April "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_Hide)
$Tage = 30
EndIf
If $mon = 5 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Mai "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 31
EndIf
If $mon = 6 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Juni "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_Hide)
$Tage = 30
EndIf
If $mon = 7 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Juli "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 31
EndIf
If $mon = 8 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("August "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 30
EndIf
If $mon = 9 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("September "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_Hide)
$Tage = 30
EndIf
If $mon = 10 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Oktober "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 31
EndIf
If $mon = 11 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("November "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_Hide)
$Tage = 30
EndIf
If $mon = 12 Then
GUICtrlSetState($Monat, $GUI_Hide)
$Monat = GUICtrlCreateLabel("Dezember "&$Jahr, 255, 50)
GUIctrlSetState($Monat, $GUI_show)
GUICtrlSetState($31, $GUI_show)
GUICtrlSetState($30, $GUI_show)
GUICtrlSetState($29, $GUI_show)
$Tage = 31
;~ MsgBox(0, "Jahr", $Jahr)
;~ MsgBox(0, "Monat", $mon)
For $a = 1 To $Tage Step +1
;~ MsgBox(0, "Tage", $a)
If IniRead(@ScriptDir&"/MonthCal.ini", $Jahr&"|"&$mon, $Tage, "") <> "" Then
If $a = 4 Then
GUICtrlSetColor($4, 0xff0000)
EndIf
If $a = 5 Then
GUICtrlSetColor($5, 0xff0000)
EndIf
If $a = 6 Then
GUICtrlSetColor($6, 0xff0000)
EndIf
EndIf
Next
EndIf
EndFunc
Hier der Code. Der Haken ist ganz unten, an der Stelle, wo das Label gefärbt werden soll.
EDIT: Hab den Fehler schon gefunden, war eine Variable falsch... Aber trotzdem danke
EDIT2: Mit number() lässt sich auch nichts machen oder? Wenn ich jetzt Number($a) ausgebe = z.B. 5 und dann das irgendwie hinter das $ setzte = $5?^^