Jump to content

Recommended Posts


I am making this little program to use at work. Currently I use two tabsheets (3 created).

It is the intention to use the first list (combo) with names, the second with functions.

So, in the first I will select a name, and next to it should a little list appear of functions, assigned to that person. multiple par name mostly.

In the second tabsheet ,I would have the opposite: select a function, and everyone educated to do that function should appear on that list.(always more than one person)

Do I need to make a list in another program (excel?) and start up that list?

(they had an excelfile, it is not usable, that's why I make this)

Or is it possible to make that list in the tabsheet ? That would be the max. What would that list appear in , guictrlcreatelist ?

Or am I taking the wrong way to this ?

#include <GUIConstants.au3>

$Form1_1 = GUICreate("VERVANGINGS MATRIX", 428, 325, 223, 115)
$PageControl1 = GUICtrlCreateTab(8, 8, 396, 256)

;tabblad personeel, naam kiezen, bijhorende functies
$personeel = GUICtrlCreateTabItem("PERSONEEL")
GUICtrlCreateCombo ("", 10,75,150) 
GUICtrlSetData(-1,"Dirk Ingelbrecht|Karim Ouarab|Rudy Raes|Eddy Renaut|David Samyn|Griet Tytgat|Sylvie Vanackere|Frederick Vandeweghe|Guido Vandeweghe|Bernice Vanmoerckerke|François Vanieuwenhuyse|Nico Verhelle|Jaak Vermandere|Geert Vermaut|Sammy Verstraete|Mbarek Boutahiri|Nadine Delvincourt|Touhami Gherab|Josephine Guiliana|Nina Himpe|Amandine Jouretz|Bianca Nevejant|Sabrina Ouzine|Indra Pannecoucke|Chantal Room|ALY|Nahym Ziouche|Selin Ziouche|Ann Debrouwere|Filip Feliers|Pieter Nollet|Pieter Matton|Patrick Stove|Patrick Decroos|Kathy Vanneste|Geert Callewaert")
$Label1 = GUICtrlCreateLabel("NAAM", 48, 56, 35, 17)
$Label2 = GUICtrlCreateLabel("FUNCTIES", 256, 56, 57, 17)
$Label3 = GUICtrlCreateLabel("laatste update 14/02/08", 256, 200, 157, 17)

; tabblad functies,functie uitkiezen,en nammen toewijzen
$TabSheet2 = GUICtrlCreateTabItem("FUNCTIES")
GUICtrlCreateCombo ("", 10,75,160) 
GUICtrlSetData(-1,"aanmaak gelatine|afvullen|afwasmachine|afwassen borden en terrines|branden|controle metaaldetector band 2 (CCP7)|controle metaaldetector productie (CCP3)|controle op etiketteren band 1 (CCP6)|controle op etiketteren band 2 (CCP6)|controle op etiketteren band stock (CCP6)|controle op etiketteren slices en tunnels (CCP6)|controle van klaargemaakte zendingen|controle van vacuumslices + stapeling slices|cutteren|dagelijkse orde frigo vers|decoratie paté|effectieve verzending producten|etiketteren & vepakken slices en tunnels (CCP6)|etiketteren band 1 (CCP6)|etiketteren band 2 (CCP6)|etiketteren band stock (CCP6)|instellen slicer|karren uit snelkoeler halen|met de clarck rijden|paté in snelkoeler plaatsen|paté in stoomkasten steken + instelling stoomkasten|paté op karren zetten|paté uit stoomkasten halen + kerntemperatuur meten (CCP4)|patés in stock plaatsen|patés uit stock halen|preventief onderhoud |Reiniging & Onstmetten|schrepen|sliceblokken op slicer leggen|slices in bakken steken|stapelen dozen band 1|stapelen dozen band 2|stapelen dozen band stock|supervisie afwerking (CCP5)|supervisie etiketteren (CCP 6 + 7)|supervisie productie  (CCP3)|technische dienst algemeen|temperatuur meten in snelkoeler voor decoratie (CCP5)|transport producten naar klanten (CCP 8)|vacuum verpakken|verpakking slicing + instellen dieptrek|volle paletten slices in frigo steken|voorbereiding grondstoffen|voorbereiding hulpstoffen|algemeen beleid|Backups Server|Beheer Computers|Beheer database etikettering|bestellingen opnemen|boekhouding en facturatie|Contact met klanten|Controle binnenkomende grondstoffen(CCP1, CCP2, CCP9)|Controle Reiniging & Ontsmetting|Corrigerende acties ivm Kwaliteit en/of CCP|inkoop grondstoffen / hulpstoffen en verpakkingsmateriaal|klachtenbehandeling|Kwaliteitsdienst|Lid HACCP Team|onthaal|Ontwerp + goedkeuring etiketten|Opstellen + Implementatie HACCP Plan|Opvolgen kwaliteitsysteem|Opvolgen Microbiologische Analyses|personeelsdienst|productontwikkeling|Recall|Regelen transport naar klanten in  België|Regelen transport naar klanten in buitenland|Technische fiches maken|tracering grond en hulpstoffen|transport documenten|verkoop|veterinaire documenten|Vragenlijsten Klanten")
$Label1 = GUICtrlCreateLabel("FUNCTIES", 48, 56, 60, 40)
$Label2 = GUICtrlCreateLabel("NAMEN", 256, 56, 57, 17)

;tabblad reserve (ingave ?)
$TabSheet3 = GUICtrlCreateTabItem("TabSheet3")

;$Button1 = GUICtrlCreateButton("&OK", 166, 272, 75, 25, 0)
$Button2 = GUICtrlCreateButton("&Stoppen", 246, 272, 75, 25, 0)
;$Button3 = GUICtrlCreateButton("&Help", 328, 272, 75, 25, 0)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Button2
        Case $GUI_EVENT_CLOSE



Edited by hanzz
Link to post
Share on other sites

Hi, I know nothing about excel, but hopefully this is along the path of what you mean about the combobox and listbox part.

Save this as FuncUser.txt in the script directory (it's only a example small part for your functions)..

aanmaak gelatine|ALY|Ann Debrouwere|
afvullen|ALY|Amandine Jouretz|
afwasmachine|ALY|Ann Debrouwere|
afwassen borden en terrines|ALY|Amandine Jouretz|
controle metaaldetector band 2 (CCP7)|Chantal Room|

Save this as UserFunc.txt in the script directory (it's only a example small part for your Users)

ALY|aanmaak gelatine|afvullen|afwasmachine|afwassen borden en terrines|
Amandine Jouretz|afvullen|afwassen borden en terrines|
Ann Debrouwere|aanmaak gelatine|afwasmachine|
Chantal Room|controle metaaldetector band 2 (CCP7)|

Then run this example script

#include <GUIConstants.au3>
#include <GUIListBox.au3>
#include <File.au3>

Global $UF = @ScriptDir & "\UserFunc.txt", $UserFunc
Global $FU = @ScriptDir & "\FuncUser.txt", $FuncUser

$Gui = GUICreate("VERVANGINGS MATRIX", 380, 265, 223, 115)
$Tab0 = GUICtrlCreateTab(5, 5, 370, 256)

$Tab1 = GUICtrlCreateTabItem("PERSONEEL")
GUICtrlCreateLabel("NAAM", 15, 40, 150, 17)
$UCombo = GUICtrlCreateCombo("", 15, 60, 150, 20, BitOR($CBS_DROPDOWNLIST, $CBS_SORT, $WS_VSCROLL))
_LoadDB($UF, $UserFunc)

GUICtrlCreateLabel("FUNCTIES", 180, 40, 150, 17)
$UFList = GUICtrlCreateList("", 180, 60, 180, 190, BitOR($LBS_SORT, $WS_HSCROLL, $WS_VSCROLL))

$Tab2 = GUICtrlCreateTabItem("FUNCTIES")
GUICtrlCreateLabel("FUNCTIES", 15, 40, 160, 17)
$FCombo = GUICtrlCreateCombo("", 15, 60, 190, 20, BitOR($CBS_DROPDOWNLIST, $CBS_SORT, $WS_VSCROLL))
_LoadDB($FU, $FuncUser)

GUICtrlCreateLabel("NAMEN", 215, 40, 150, 17)
$FUList = GUICtrlCreateList("", 215, 60, 145, 190, BitOR($LBS_SORT, $WS_HSCROLL, $WS_VSCROLL))


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case $UCombo
            GUICtrlSetData($UFList, "")
            For $i = 1 To $UserFunc[0]
                Local $SS = StringSplit($UserFunc[$i], "|")
                If $SS[0] > 1 And $SS[1] = GUICtrlRead($UCombo) Then
                    For $j = 2 To $SS[0]
                        If $SS[$j] <> "" Then GUICtrlSetData($UFList, $SS[$j])
        Case $FCombo
            GUICtrlSetData($FUList, "")
            For $i = 1 To $FuncUser[0]
                Local $SS = StringSplit($FuncUser[$i], "|")
                If $SS[0] > 1 And $SS[1] = GUICtrlRead($FCombo) Then
                    For $j = 2 To $SS[0]
                        If $SS[$j] <> "" Then GUICtrlSetData($FUList, $SS[$j])

Func _LoadDB($dbPath, ByRef $aR)
    If Not _FileReadToArray($dbPath, $aR) Then Return 0
    Switch $dbPath
        Case $FU
            For $i = 1 To $aR[0]
                Local $SS = StringSplit($aR[$i], "|")
                If $SS[1] <> "" Then GUICtrlSetData($FCombo, $SS[1])
        Case $UF
            For $i = 1 To $aR[0]
                Local $SS = StringSplit($aR[$i], "|")
                If $SS[1] <> "" Then GUICtrlSetData($UCombo, $SS[1])
EndFunc   ;==>_LoadDB

You can update the UserFunc.txt with a user name and what functions they can use per line delimited with |.

(This is for loading the User Name in the Combobox and when a name is selected the functions they can use are listed in the ListBox on Tab1)

You can update the FuncUser.txt with the function names and what user can use them per line delimited with |.

(This is for loading the Function Name in the combobox and when a function is selected the users that can use it are listed in the listbox on Tab2)


Edited by smashly
Link to post
Share on other sites
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...