Tach zusammen
Ein neuer Tag, ein neues Problem
Falls ihr mir mal wieder Euer Auge leihen mögt, das hier wird ein wenig konfuser. *g Alsoooooo...
Ich bastel ja gerade - mit Eurer Hilfe - an einem Skript, welches mir meinen Tätigkeitsnachweis für die Firma etwas vereinfachen soll. (Also Programme auf, Programme zu, Datenblätter automatisch erstellen usw.) Jetzt hat sich unsere, stets unter Überlastung stehende, Buchhaltung etwas Neues ausgedacht. Ich mußte bisher einen Zettel am Monatsende abgeben, der alle Fahrten von mir aufführte. Dieser Zettel sah mal so aus:
[Blockierte Grafik: http://s8.directupload.net/images/081001/7q52tmlp.jpg]
Alle Fahrten lassen sich in vier Gruppen einteilen, jede Gruppe hat maximal fünf verschiedene Start- und Zielpositionen und jede Gruppe wird buchhalterisch über ein anderes Konto abgerechnet. Unsere Buchhaltung will jetzt, daß jede Fahrt einer Gruppe auf einem Extrazettel steht. Weil das einen Haufen Arbeit darstellt, brauche ich jetzt ein GUI, wo ich die Positionen Tag, Fahrstrecke von bis, Zeit Anfang Ende und Zweck aus Combos, bzw "CreateDate" auswählen und diese am Ende der Zeile einer Gruppe zuweisen kann. Angefangen habe ich so:
Spoiler anzeigen
#include <GUIConstants.au3>
GUICreate("Formular", 1000) ; will create a dialog box that when displayed is centered
; Feld 1 Reihe 1 Datum
$DTS_SHORTDATEFORMAT = 2
$F1R1=GUICtrlCreateDate ( "Datum", 10, 10, 100, 20, $DTS_SHORTDATEFORMAT)
GUISetState () ; will display an empty dialog box with a combo control with focus on
;Do
; $msg11 = GUIGetMsg()
; if $msg11 = $F1R1 then
; msgbox(0,"list=", GUICtrlRead($F1R1)) ; display the value
; endif
;Until $msg11 = $GUI_EVENT_CLOSE
;Feld 2 Reihe 1 Kilometer
GUICtrlCreateCombo ("km", 120,10,50)
GUICtrlSetData(-1,"3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", "km")
GUISetState ()
; Feld 3 Reihe 1 Fahrstrecke "von"
GUICtrlCreateCombo ("Strecke von", 180,10,170)
GUICtrlSetData(-1,"Seefeld, Krummenseer Cha|Werneuchen Markt|Bernau Zentrale|innerhalb", "von")
GUISetState ()
; Feld 4 Reihe 1 Fahrstrecke "bis"
GUICtrlCreateCombo ("Strecke bis", 360,10,170)
GUICtrlSetData(-1,"Seefeld, Krummenseer Cha|Werneuchen Markt|Bernau Zentrale|Werneuchen", "bis")
GUISetState ()
; Feld 5 Reihe 1 Zeit Beginn
$DTS_TIMEFORMAT = 9
$n=GUICtrlCreateDate ( "", 540, 10, 100, 20, $DTS_TIMEFORMAT)
GUISetState ()
; Feld 6 Reihe 1 Zeit Ende
$DTS_TIMEFORMAT = 9
$n=GUICtrlCreateDate ( "", 650, 10, 100, 20, $DTS_TIMEFORMAT)
GUISetState ()
; Feld 7 Reihe 1 Zweck der Fahrt
GUICtrlCreateCombo ("Zweck", 760,10,170)
GUICtrlSetData(-1,"2. Zustellung Schötzau|Verteilung Briefe|Fahrt zum Bezirk", "Zweck")
GUISetState ()
; Feld 1 Reihe 2 Datum
$DTS_SHORTDATEFORMAT = 2
$n=GUICtrlCreateDate ( "Datum", 10, 40, 100, 20, $DTS_SHORTDATEFORMAT)
GUISetState () ; will display an empty dialog box with a combo control with focus on
;Feld 2 Reihe 2 Kilometer
GUICtrlCreateCombo ("km", 120,40,50)
GUICtrlSetData(-1,"3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20", "km")
GUISetState ()
; Feld 3 Reihe 2 Fahrstrecke "von"
GUICtrlCreateCombo ("Strecke von", 180,40,170)
GUICtrlSetData(-1,"Seefeld, Krummenseer Cha|Werneuchen Markt|Bernau Zentrale|innerhalb", "von")
GUISetState ()
; Feld 4 Reihe 2 Fahrstrecke "bis"
GUICtrlCreateCombo ("Strecke bis", 360,40,170)
GUICtrlSetData(-1,"Seefeld, Krummenseer Cha|Werneuchen Markt|Bernau Zentrale|Werneuchen", "von")
GUISetState ()
; Feld 5 Reihe 2 Zeit Beginn
$DTS_TIMEFORMAT = 9
$n=GUICtrlCreateDate ( "", 540, 40, 100, 20, $DTS_TIMEFORMAT)
GUISetState ()
; Feld 6 Reihe 2 Zeit Ende
$DTS_TIMEFORMAT = 9
$n=GUICtrlCreateDate ( "", 650, 40, 100, 20, $DTS_TIMEFORMAT)
GUISetState ()
; Feld 7 Reihe 2 Zweck der Fahrt
GUICtrlCreateCombo ("Zweck", 760,40,170)
GUICtrlSetData(-1,"2. Zustellung Schötzau|Verteilung Briefe|Fahrt zum Bezirk", "Zweck")
GUISetState ()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Es funktioniert soweit. Über die ausgeklammerte Do-Until bekomme ich auch den Wert des ersten Feldes als MsgBox zurück. Ich fürchte aber, hier muß mit Arrays gearbeitet werden, richtig? (Wie Bugfix richtig erkannte, kommt hier die Stelle, die für Knoten im Hirn sorgt. *g) Ich hab die Tutorials im Wiki und von Bugfix gelesen... nicht durchgearbeitet, nur gelesen. Bin ich da auf der richtigen Spur? Ich stelle mir das so vor, das die Eingaben in eine Datei geschrieben, von dort ausgelesen und in eine Exceltabelle übertragen werden. (Vielleicht über die Koordinaten jeder Zelle). Dieses GUI müßte sich zudem jeden Eintrag merken, das bereits getätigte Eingaben nicht gelöscht oder überschrieben werden.
Ist so etwas (für mich) machbar, oder bleibe ich besser bei Papier und Bleistift? *fg
Liebe Grüße,
Reinhold.