Hallo zusammen,
ich habe vor einiger Zeit ein Portal für unsere Firma geschrieben, in welchem jede unserer Maschinen aufgelistet sind, mit einer Tabelle der Maschinendaten und pro Maschine zwischen 5-20 Buttons, welche jeweils mit einer PDF verknüpft ist, z.B. Betriebsanleitung, Ersatzteileliste etc..
Dieses Portal wurde mit HTML / CSS und ein klein wenig JavaScript umgesetzt und ist komplett statisch.
Mir fehlt hier auch die Möglichkeit an Funktionalität, da ich z.B. keinen PHP Interpreter installieren darf, weshalb ich gerne beginnen möchte das ganze mit AutoIt zu realisieren.
Auch weil ich ein Projekt brauche, das mit der Zeit wächst und ich dadurch eventuell AutoIt lernen kann.
Nun habe ich ein GUI gebaut, welches wie eine Website aufgebaut ist.
Ich habe links eine Navigation mit 40 Buttons, je 1 Button für eine Maschine und habe dann rechts einen Inhaltsbereich in Form einer GroupBox.
Für jede Maschine, möchte ich nun eine eigene .au3 Datei haben, welche beim klicken des jeweiligen Maschinenbuttons in den Inhaltsbereich geladen wird.
Aktuell habe ich das auch schon mit 2 Buttons und 2 Tabellen umgesetzt.
Wenn ich Button 1 klicke, lädt es die Tabelle, die Freude war groß, wenn ich dann Button 2 klicke, legt es die 2. Tabelle über die erste.
Daher habe ich jetzt mal gestoppt, wenn ich so weiter mache, würden sich später alle Dateien übereinander legen.
Ich möchte gerne, dass die alte Datei mit der neuen ersetzt wird, bzw. ich muss den Inhaltsbereich irgendwie wieder leeren, bevor ich eine neue Datei hinein lade.
Könntet ihr mir eventuell sagen, wie ihr sowas generell angehen würdet?
Mache mir bisschen Sorgen, das ich mich sonst total verbaue, weil man das so gar nicht tun würde.
Weiß auch noch gar nicht, ob das mit dem kompilieren funktioniert, wie ich mir das vorstelle.
Das wären dann ja die Haupt-GUI Datei und 42 einzelne .au3 Dateien, welche dann später auf einem Rechner laufen müssten, auf dem kein AutoIt installiert ist.
Anbei noch mein bisheriges Werk:
Haupt-GUI Datei
;*****************************************
;Maschinenportal.au3 by DS
;Erstellt mit ISN AutoIt Studio v. 1.10
;*****************************************
#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <Table.au3>
;----- Erstellt GUI -----
Local $hGUI = GUICreate("Maschinenportal", 1000, 600)
;----- Erstellt Gruppe DE inklusive der einzelnen Maschinen-Buttons -----
GUICtrlCreateGroup("SGM DE",10,10,90,580,$BS_CENTER,-1)
GUICtrlSetBkColor(-1,"0xF0F0F0")
$btn01 = GUICtrlCreateButton("01",20,30,30,30,-1,-1)
GUICtrlSetTip( $btn01, "Maschinenbezeichnung")
$btn02 = GUICtrlCreateButton("02",60,30,30,30,-1,-1)
GUICtrlSetTip( $btn02, "Maschinenbezeichnung")
$btn03 = GUICtrlCreateButton("03",20,70,30,30,-1,-1)
GUICtrlSetTip( $btn03, "Maschinenbezeichnung")
$btn04 = GUICtrlCreateButton("04",60,70,30,30,-1,-1)
GUICtrlSetTip( $btn04, "Maschinenbezeichnung")
$btn05 = GUICtrlCreateButton("05",20,110,30,30,-1,-1)
GUICtrlSetTip( $btn05, "Maschinenbezeichnung")
$btn06 = GUICtrlCreateButton("06",60,110,30,30,-1,-1)
GUICtrlSetTip( $btn06, "Maschinenbezeichnung")
$btn07 = GUICtrlCreateButton("07",20,150,30,30,-1,-1)
GUICtrlSetTip( $btn07, "Maschinenbezeichnung")
$btn08 = GUICtrlCreateButton("08",60,150,30,30,-1,-1)
GUICtrlSetTip( $btn08, "Maschinenbezeichnung")
$btn09 = GUICtrlCreateButton("09",20,190,30,30,-1,-1)
GUICtrlSetTip( $btn09, "Maschinenbezeichnung")
$btn10 = GUICtrlCreateButton("10",60,190,30,30,-1,-1)
GUICtrlSetTip( $btn10, "Maschinenbezeichnung")
$btn11 = GUICtrlCreateButton("11",20,230,30,30,-1,-1)
GUICtrlSetTip( $btn11, "Maschinenbezeichnung")
$btn12 = GUICtrlCreateButton("12",60,230,30,30,-1,-1)
GUICtrlSetTip( $btn12, "Maschinenbezeichnung")
$btn13 = GUICtrlCreateButton("13",20,270,30,30,-1,-1)
GUICtrlSetTip( $btn13, "Maschinenbezeichnung")
$btn14 = GUICtrlCreateButton("14",60,270,30,30,-1,-1)
GUICtrlSetTip( $btn14, "Maschinenbezeichnung")
$btn15 = GUICtrlCreateButton("15",20,310,30,30,-1,-1)
GUICtrlSetTip( $btn15, "Maschinenbezeichnung")
$btn16 = GUICtrlCreateButton("16",60,310,30,30,-1,-1)
GUICtrlSetTip( $btn16, "Maschinenbezeichnung")
$btn17 = GUICtrlCreateButton("17",20,350,30,30,-1,-1)
GUICtrlSetTip( $btn17, "Maschinenbezeichnung")
$btn18 = GUICtrlCreateButton("18",60,350,30,30,-1,-1)
GUICtrlSetTip( $btn18, "Maschinenbezeichnung")
$btn19 = GUICtrlCreateButton("19",20,390,30,30,-1,-1)
GUICtrlSetTip( $btn19, "Maschinenbezeichnung")
$btn20 = GUICtrlCreateButton("20",60,390,30,30,-1,-1)
GUICtrlSetTip( $btn20, "Maschinenbezeichnung")
;----- Erstellt Gruppe SK inklusive der einzelnen Maschinen-Buttons -----
GUICtrlCreateGroup("SGM SK",110,10,90,580,$BS_CENTER,-1)
GUICtrlSetBkColor(-1,"0xF0F0F0")
$btn01 = GUICtrlCreateButton("01",120,30,30,30,-1,-1)
GUICtrlSetTip( $btn01, "Maschinenbezeichnung")
$btn02 = GUICtrlCreateButton("02",160,30,30,30,-1,-1)
GUICtrlSetTip( $btn02, "Maschinenbezeichnung")
$btn03 = GUICtrlCreateButton("03",120,70,30,30,-1,-1)
GUICtrlSetTip( $btn03, "Maschinenbezeichnung")
$btn04 = GUICtrlCreateButton("04",160,70,30,30,-1,-1)
GUICtrlSetTip( $btn04, "Maschinenbezeichnung")
$btn05 = GUICtrlCreateButton("05",120,110,30,30,-1,-1)
GUICtrlSetTip( $btn05, "Maschinenbezeichnung")
$btn06 = GUICtrlCreateButton("06",160,110,30,30,-1,-1)
GUICtrlSetTip( $btn06, "Maschinenbezeichnung")
$btn07 = GUICtrlCreateButton("07",120,150,30,30,-1,-1)
GUICtrlSetTip( $btn07, "Maschinenbezeichnung")
$btn08 = GUICtrlCreateButton("08",160,150,30,30,-1,-1)
GUICtrlSetTip( $btn08, "Maschinenbezeichnung")
$btn09 = GUICtrlCreateButton("09",120,190,30,30,-1,-1)
GUICtrlSetTip( $btn09, "Maschinenbezeichnung")
$btn10 = GUICtrlCreateButton("10",160,190,30,30,-1,-1)
GUICtrlSetTip( $btn10, "Maschinenbezeichnung")
$btn11 = GUICtrlCreateButton("11",120,230,30,30,-1,-1)
GUICtrlSetTip( $btn11, "Maschinenbezeichnung")
$btn12 = GUICtrlCreateButton("12",160,230,30,30,-1,-1)
GUICtrlSetTip( $btn12, "Maschinenbezeichnung")
$btn13 = GUICtrlCreateButton("13",120,270,30,30,-1,-1)
GUICtrlSetTip( $btn13, "Maschinenbezeichnung")
$btn14 = GUICtrlCreateButton("14",160,270,30,30,-1,-1)
GUICtrlSetTip( $btn14, "Maschinenbezeichnung")
$btn15 = GUICtrlCreateButton("15",120,310,30,30,-1,-1)
GUICtrlSetTip( $btn15, "Maschinenbezeichnung")
$btn16 = GUICtrlCreateButton("16",160,310,30,30,-1,-1)
GUICtrlSetTip( $btn16, "Maschinenbezeichnung")
$btn17 = GUICtrlCreateButton("17",120,350,30,30,-1,-1)
GUICtrlSetTip( $btn17, "Maschinenbezeichnung")
$btn18 = GUICtrlCreateButton("18",160,350,30,30,-1,-1)
GUICtrlSetTip( $btn18, "Maschinenbezeichnung")
$btn19 = GUICtrlCreateButton("19",120,390,30,30,-1,-1)
GUICtrlSetTip( $btn19, "Maschinenbezeichnung")
$btn20 = GUICtrlCreateButton("20",160,390,30,30,-1,-1)
GUICtrlSetTip( $btn20, "Maschinenbezeichnung")
;----- Erstellt Button Gesamtübersicht DE mit ToolTip -----
$btnGesamtDE = GUICtrlCreateButton("Gesamtübersicht SGM-Grunddaten Deutschland",210,10,385,30,-1,-1)
GUICtrlSetTip( $btnGesamtDE, "Tabellarische Gesamtübersicht der Maschinen-Grunddaten in Deutschland")
;----- Erstellt Button Gesamtübersicht SK mit ToolTip -----
$btnGesamtSK = GUICtrlCreateButton("Gesamtübersicht SGM-Grunddaten Slowakei",605,10,385,30,-1,-1)
GUICtrlSetTip( $btnGesamtSK, "Tabellarische Gesamtübersicht der Maschinen-Grunddaten in der Slowakei")
;----- Erstellt Gruppe für die Inhalte -----
GUICtrlCreateGroup("Inhalt",210,50,780,540,-1,-1)
GUICtrlSetBkColor(-1,"0xF0F0F0")
;----- Macht GUI sichtbar -----
GUISetState(@SW_SHOW, $hGUI)
;----- GUI Ereignisschleife -----
Local $iMsg = 0
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
;----- Lädt die Datei gesamt_tabelle_de.au3 in den Inhaltsbereich -----
Case $btnGesamtDE
#include "inc\gesamt_tabelle_de.au3"
;----- Lädt die Datei gesamt_tabelle_sk.au3 in den Inhaltsbereich -----
Case $btnGesamtSK
#include "inc\gesamt_tabelle_sk.au3"
;----- Beendet nach einem Hinweis das Programm -----
Case $GUI_EVENT_CLOSE
MsgBox($MB_SYSTEMMODAL, "GUI Event", "Du hast auf CLOSE geklickt. Programm wird beendet...")
ExitLoop
EndSwitch
WEnd
GUIDelete($hGUI)
Alles anzeigen
Tabelle 1
;gesamt_tabelle_de.au3
#include-once
;----- Sperrt GUI (wird benötigt solange die Tabellen gezeichnet werden) -----
GUISetState(@SW_LOCK)
;----- Erstellt Tabelle -----
$GesamtTabelleDE = _GUICtrlTable_Create(220, 70, 62, 20, 21, 6, 0)
_GUICtrlTable_Set_RowHeight($GesamtTabelleDE, 1, 35)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 1, 50)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 2, 142)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 3, 142)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 4, 142)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 5, 142)
_GUICtrlTable_Set_ColumnWidth($GesamtTabelleDE, 6, 142)
_GUICtrlTable_Set_Justify_All($GesamtTabelleDE, 1, 1)
_GUICtrlTable_Set_TextFont_All($GesamtTabelleDE, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($GesamtTabelleDE, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($GesamtTabelleDE, 0x555555)
_GUICtrlTable_Set_TextColor_Row($GesamtTabelleDE, 1, 0xFFFFFF)
For $row = 3 To 21 Step 2
_GUICtrlTable_Set_CellColor_Row($GesamtTabelleDE, $row, 0xF0F0F0)
Next
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 1, "SGM|Hersteller|Bezeichnung|Seriennummer|Baujahr|Zuhaltung")
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 2, "01|NA|NA|NA|NA|NA") ;SGM 01
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 3, "02|NA|NA|NA|NA|NA") ;SGM 02
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 4, "03|NA|NA|NA|NA|NA") ;SGM 03
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 5, "04|NA|NA|NA|NA|NA") ;SGM 04
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 6, "05|NA|NA|NA|NA|NA") ;SGM 05
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 7, "06|NA|NA|NA|NA|NA") ;SGM 06
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 8, "07|NA|NA|NA|NA|NA") ;SGM 07
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 9, "08|NA|NA|NA|NA|NA") ;SGM 08
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 10, "09|NA|NA|NA|NA|NA") ;SGM 09
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 11, "10|NA|NA|NA|NA|NA") ;SGM 10
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 12, "11|NA|NA|NA|NA|NA") ;SGM 11
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 13, "12|NA|NA|NA|NA|NA") ;SGM 12
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 14, "13|NA|NA|NA|NA|NA") ;SGM 13
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 15, "14|NA|NA|NA|NA|NA") ;SGM 14
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 16, "15|NA|NA|NA|NA|NA") ;SGM 15
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 17, "16|NA|NA|NA|NA|NA") ;SGM 16
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 18, "17|NA|NA|NA|NA|NA") ;SGM 17
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 19, "18|NA|NA|NA|NA|NA") ;SGM 18
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 20, "19|NA|NA|NA|NA|NA") ;SGM 19
_GUICtrlTable_Set_Text_Row($GesamtTabelleDE, 21, "20|NA|NA|NA|NA|NA") ;SGM 20
_GUICtrlTable_Set_Border_Table($GesamtTabelleDE, 0x555555)
;----- Entsperrt GUI (nachdem die Tabellen gezeichnet wurden) -----
GUISetState(@SW_UNLOCK)
Alles anzeigen
Tabelle 2
;gesamt_tabelle_sk.au3
#include-once
;----- Sperrt GUI (wird benötigt solange die Tabellen gezeichnet werden) -----
GUISetState(@SW_LOCK)
;----- Erstellt Tabelle -----
$Table4 = _GUICtrlTable_Create(35, 268, 62, 18, 8, 6, 0)
_GUICtrlTable_Set_RowHeight($Table4, 1, 35)
_GUICtrlTable_Set_Justify_All($Table4, 1, 1)
_GUICtrlTable_Set_TextFont_All($Table4, 8.5, 800, 0, "Tahoma")
_GUICtrlTable_Set_CellColor_Row($Table4, 1, 0x555555)
_GUICtrlTable_Set_TextColor_All($Table4, 0x555555)
_GUICtrlTable_Set_TextColor_Row($Table4, 1, 0xFFFFFF)
For $row = 3 To 10 Step 2
_GUICtrlTable_Set_CellColor_Row($Table4, $row, 0xDDDDDD)
Next
_GUICtrlTable_Set_Text_Row($Table4, 1, "Fixing|Size|Weight|Net|Gross|Order")
_GUICtrlTable_Set_Text_Row($Table4, 2, "Block|20.0|0.01|300|340|No")
_GUICtrlTable_Set_Text_Row($Table4, 3, "Screw|8.5|0.3|50|100|No")
_GUICtrlTable_Set_Text_Row($Table4, 4, "Rivet|0.1|0.4|10|11|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 5, "Rope|300.0|100.0|2|10|No")
_GUICtrlTable_Set_Text_Row($Table4, 6, "Tack|10.6|0.3|1000|1011|Yes")
_GUICtrlTable_Set_Text_Row($Table4, 7, "Nail|30.3|0.4|400|600|No")
_GUICtrlTable_Set_Text_Row($Table4, 8, "Staple|0.3|0.05|10000|12000|No")
_GUICtrlTable_Set_Border_Table($Table4, 0x555555)
;----- Entsperrt GUI (nachdem die Tabellen gezeichnet wurden) -----
GUISetState(@SW_UNLOCK)
Alles anzeigen