ATR Posted March 25, 2011 Posted March 25, 2011 Hi evreybody, I want to create a filtering listview, with optionnals checkbox and combobox. (The second combobox is based on the choice of the forst combobox). I'm looking on other topics of filtering, and I do lots of tests, but within sucess ! I don't know how to update events.. Thanks in advance. expandcollapse popup#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> #Include <String.au3> ;Systèmes d'exploitation : $OS_1 = " Windows XP" $OS_2 = " Windows 2000" $OS_3 = " Windows 2003" $OS_4 = " Windows vista" $OS_5 = " Windows 7" ; Rubriques : $Rubrique_1 = " L'éditeur d'objets de stratégie de groupe" $Rubrique_2 = " Gesion des utilisateurs" $Rubrique_3 = " Le bureau Windows" $Rubrique_4 = " L'explorateur Windows" $Rubrique_5 = " Le système" $Rubrique_6 = " Les applications et composants Windows" $Rubrique_7 = " Perrsonnaliser et sécuriser Internet Explorer" $Rubrique_8 = " Restrictions dans Internet Explorer" $Rubrique_9 = " Périphériques et réseau" ; Sous-rubriques : ; Sous-rubrique " L'éditeur d'objets de stratégie de groupe" $SousRubrique_1 = " Les fichiers de console" $SousRubrique_2 = " L'éditeur d'objets de stratégie de groupe" $SousRubrique_3 = " Les stratégies de groupe" $SousRubrique_4 = " Les fichiers de modèle" ; Sous-rubrique " Gesion des utilisateurs" $SousRubrique_5 = " Le contrôle de compte d'utilisateur" $SousRubrique_6 = " Paramétrer le contrôle du compte d'utilisateur" $SousRubrique_7 = " Le contrôle parental" $SousRubrique_8 = " L'ouverture de session interactive" $SousRubrique_9 = " Les options de sécurité et le registre Windows" ; Sous-rubrique " Le bureau Windows" $SousRubrique_10 = " Le bureau Windows" $SousRubrique_11 = " Le menu Démarrer" $SousRubrique_12 = " La barre des tâches" $SousRubrique_13 = " Les raccourcis" $SousRubrique_14 = " Le panneau de configuration" $SousRubrique_15 = " L'affichage" $SousRubrique_16 = " Les écrans de veille" $SousRubrique_17 = " Les options régionales et linguistiques" ; Sous-rubrique " L'explorateur Windows" $SousRubrique_18 = " Personnaliser l'explorateur Windows" $SousRubrique_19 = " Sécuriser l'explorateur Windows" $SousRubrique_20 = " La corbeille Windows" $SousRubrique_21 = " Les miniatures" $SousRubrique_22 = " Les lecteurs" $SousRubrique_23 = " Les menus contextuels sous Windows 7" $SousRubrique_24 = " La fonctionnalité des versions précédentes" $SousRubrique_25 = " La fonctionnalité de recherche" $SousRubrique_26 = " Chiffrement des ficheirs et des dossiers" $SousRubrique_27 = " Sauvegarde des données" ; Sous-rubrique " Le système" $SousRubrique_28 = " Personnaliser votre système" $SousRubrique_29 = " Gérer votre licence Windows" $SousRubrique_30 = " Les fonctionnalités système" $SousRubrique_31 = " Le gestionnaire de tâches" $SousRubrique_32 = " Nettoyage de disque" $SousRubrique_33 = " Les profils d'utilisateur" $SousRubrique_34 = " La restauration système" $SousRubrique_35 = " Windows update" $SousRubrique_36 = " Windows Defender" $SousRubrique_37 = " Les quotas de disque" ; Sous-rubrique " Les applications et composants Windows" $SousRubrique_38 = " Définir une restriction logicielle" $SousRubrique_39 = " Programmes et fonctionnalités" $SousRubrique_40 = " Les programmes et fonctionnalités Windows 7" $SousRubrique_41 = " Les outils systèmes" $SousRubrique_42 = " Compatibilité des applications" $SousRubrique_43 = " Windows Installer" $SousRubrique_44 = " Les composants Windows" $SousRubrique_45 = " Windows Media Player" $SousRubrique_46 = " Windows Mail" $SousRubrique_47 = " Gestion des pièces jointes" $SousRubrique_48 = " Ne pas autoriser l'éxécutioon de Windows Media Center" $SousRubrique_49 = " Désactiver les paramètres de présentation Windows" $SousRubrique_50 = " Les capteurs d'emplacements" ; Sous-rubrique " Personnaliser et sécuriser Internet Explorer" $SousRubrique_51 = " Personnaliser Internet Explorer" $SousRubrique_52 = " Les zones de sécurité" $SousRubrique_53 = " L'onglet sécurité" $SousRubrique_54 = " Les fonctionnalités de sécurité" $SousRubrique_55 = " Les accélérateurs web" $SousRubrique_56 = " L'affichage de compatibilité" $SousRubrique_57 = " Le filtre InPrivate" ; Sous-rubrique " Restrictions dans Internet Explorer" $SousRubrique_58 = " Paramétrer les menus d'Internet Explorer" $SousRubrique_59 = " Le panneau de configuration d'Internet Explorer" $SousRubrique_60 = " Options avancées" $SousRubrique_61 = " Les barres d'outils" $SousRubrique_62 = " Paramètres Internet" $SousRubrique_63 = " Paramètres de navigation" $SousRubrique_64 = " Menus du navigateur" $SousRubrique_65 = " Les flux RSS et les Web Slices" ; Sous-rubrique " Périphériques et réseau" $SousRubrique_66 = " Les périphériques" $SousRubrique_67 = " Gestion de l'alimentation" $SousRubrique_68 = " Stratégies sur le réseau" $SousRubrique_69 = " Le pare-feu de connexion Internet" $SousRubrique_70 = " Windows Connect Now" $SousRubrique_71 = " Le Projecteur réseau" GUICreate("Automatisations", 520, 700) GUISetState(@SW_SHOW) GUICtrlCreateGroup("Filtres", 10, 10, 500, 120) $Windows_2000 = GUICtrlCreateCheckbox("Windows 2000", 30, 30) $Windows_XP = GUICtrlCreateCheckbox("Windows XP", 130, 30) $Windows_2003 = GUICtrlCreateCheckbox("Windows 2003", 220, 30) $Windows_Vista = GUICtrlCreateCheckbox("Windows Vista", 320, 30) $Windows_7 = GUICtrlCreateCheckbox("Windows 7", 420, 30) GUICtrlCreateLabel("Rubriques :", 30, 65) $ListeRubriques = GUICtrlCreateCombo("", 90, 62.5, 250) GUICtrlSetData($ListeRubriques, " |" & $Rubrique_1 & "|" & $Rubrique_2 & "|" & $Rubrique_3 & "|" & $Rubrique_4 & "|" & $Rubrique_5 & "|" & $Rubrique_6 & "|" & $Rubrique_7 & "|" & $Rubrique_8 & "|" & $Rubrique_9) $ListeSousRubriques = GUICtrlCreateCombo("", 90, 95, 250) GUICtrlSetState(-1, $GUI_DISABLE) $Tableau = GUICtrlCreateListView("ID|Systèmes|Actions|Rubrique|Sous-rubrique", 10, 145, 500, 400, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES)) _GUICtrlListView_SetColumnWidth($Tableau, 1, 120) _GUICtrlListView_SetColumnWidth($Tableau, 2, 376) Dim $Actions[9] $Actions[0] = 'GUICtrlCreateListViewItem("1|"&$OS_1&"|évènement XP R1 SR3|"& $Rubrique_1 & "|" & $SousRubrique_3, $Tableau)' $Actions[1] = 'GUICtrlCreateListViewItem("2|"&$OS_1&"|évènement XP R1 SR1|"& $Rubrique_1 & "|" & $SousRubrique_1, $Tableau)' $Actions[2] = 'GUICtrlCreateListViewItem("03|"&$OS_2&"|évènement XP R2 SR8|"& $Rubrique_2 & "|" & $SousRubrique_8, $Tableau)' $Actions[3] = 'GUICtrlCreateListViewItem("4|"&$OS_2&"|évènement XP R3 SR3|"& $Rubrique_3 & "|" & $SousRubrique_3, $Tableau)' $Actions[4] = 'GUICtrlCreateListViewItem("54|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[5] = 'GUICtrlCreateListViewItem("6|"&$OS_1&"|évènement XP R2 SR7|"& $Rubrique_2 & "|" & $SousRubrique_7, $Tableau)' $Actions[6] = 'GUICtrlCreateListViewItem("789|"&$OS_2&"|évènement XP R2 SR6|"& $Rubrique_2 & "|" & $SousRubrique_6, $Tableau)' $Actions[7] = 'GUICtrlCreateListViewItem("8|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[8] = 'GUICtrlCreateListViewItem("9|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' For $Elements_depart In $Actions Execute($Elements_depart) Next ;~ _GUICtrlListView_HideColumn($Tableau, 0) _GUICtrlListView_HideColumn($Tableau, 3) _GUICtrlListView_HideColumn($Tableau, 4) GUICtrlSetState($Windows_2000, $GUI_CHECKED) GUICtrlSetState($Windows_XP, $GUI_CHECKED) GUICtrlSetState($Windows_2003, $GUI_CHECKED) GUICtrlSetState($Windows_Vista, $GUI_CHECKED) GUICtrlSetState($Windows_7, $GUI_CHECKED) $Appliquer = GUICtrlCreateButton("Appliquer", 20, 560, 100) $Quitter = GUICtrlCreateButton("Quitter", 140, 560, 100) _GUICtrlListView_RegisterSortCallBack($Tableau) Do $msg = GUIGetMsg() Select Case $msg = $Tableau _GUICtrlListView_SortItems($Tableau, GUICtrlGetState($Tableau)) Case $msg = $Windows_2000 $Question_coche = GUICtrlRead($Windows_2000) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_2, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 1"&@CRLF) EndIf Filtrage($OS_2, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 2"&@CRLF) Else Filtrage($OS_2, $Question_coche) ConsoleWrite("filtrage 3"&@CRLF) EndIf Case $msg = $Windows_2003 $Question_coche = GUICtrlRead($Windows_2003) ConsoleWrite(GUICtrlGetState($Windows_2000)&@CRLF) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_3, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 4"&@CRLF) EndIf Filtrage($OS_3, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 5"&@CRLF) Else Filtrage($OS_3, $Question_coche) ConsoleWrite("filtrage 6"&@CRLF) EndIf Case $msg = $Windows_XP $Question_coche = GUICtrlRead($Windows_XP) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_1, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 7"&@CRLF) EndIf Filtrage($OS_1, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 8"&@CRLF) Else Filtrage($OS_1, $Question_coche) EndIf Case $msg = $Windows_Vista $Question_coche = GUICtrlRead($Windows_Vista) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_4, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_4, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_4, $Question_coche) EndIf Case $msg = $Windows_7 $Question_coche = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_5, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_5, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_5, $Question_coche) EndIf Case $msg = $ListeRubriques $Lecture_rubriques = GUICtrlRead($ListeRubriques) Filtrage_Rubriques($Lecture_rubriques) Case $msg = $ListeSousRubriques $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $Lecture_rubriques = GUICtrlRead($ListeRubriques) Case $msg = $Quitter GUIDelete() Exit EndSelect Until $msg = $GUI_EVENT_CLOSE _GUICtrlListView_UnRegisterSortCallBack($Tableau) Func Filtrage_Rubriques($Rubrique) If $Rubrique = "" Then GUICtrlSetData($ListeSousRubriques, "") GUICtrlSetState($ListeSousRubriques, $GUI_DISABLE) ElseIf $Rubrique = " L'éditeur d'objets de stratégie de groupe" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_1&"|"&$SousRubrique_2&"|"&$SousRubrique_3&"|"&$SousRubrique_4) ElseIf $Rubrique = " Gesion des utilisateurs" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_5&"|"&$SousRubrique_6&"|"&$SousRubrique_7&"|"&$SousRubrique_8&"|"&$SousRubrique_9) ElseIf $Rubrique = " Le bureau Windows" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_10&"|"&$SousRubrique_11&"|"&$SousRubrique_12&"|"&$SousRubrique_13&"|"&$SousRubrique_14&"|"&$SousRubrique_15&"|"&$SousRubrique_16&"|"&$SousRubrique_17) ElseIf $Rubrique = " L'explorateur Windows" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_18&"|"&$SousRubrique_19&"|"&$SousRubrique_20&"|"&$SousRubrique_21&"|"&$SousRubrique_22&"|"&$SousRubrique_23&"|"&$SousRubrique_24&"|"&$SousRubrique_25&"|"&$SousRubrique_26&"|"&$SousRubrique_27) ElseIf $Rubrique = " Le système" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_28&"|"&$SousRubrique_29&"|"&$SousRubrique_30&"|"&$SousRubrique_31&"|"&$SousRubrique_32&"|"&$SousRubrique_33&"|"&$SousRubrique_34&"|"&$SousRubrique_35&"|"&$SousRubrique_36&"|"&$SousRubrique_37) ElseIf $Rubrique = " Les applications et composants Windows" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_38&"|"&$SousRubrique_39&"|"&$SousRubrique_40&"|"&$SousRubrique_41&"|"&$SousRubrique_42&"|"&$SousRubrique_43&"|"&$SousRubrique_44&"|"&$SousRubrique_45&"|"&$SousRubrique_46&"|"&$SousRubrique_47&"|"&$SousRubrique_48&"|"&$SousRubrique_49&"|"&$SousRubrique_50) ElseIf $Rubrique = " Personnaliser et sécuriser Internet Explorer" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_51&"|"&$SousRubrique_52&"|"&$SousRubrique_53&"|"&$SousRubrique_54&"|"&$SousRubrique_55&"|"&$SousRubrique_56&"|"&$SousRubrique_57) ElseIf $Rubrique = " Restrictions dans Internet Explorer" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_58&"|"&$SousRubrique_59&"|"&$SousRubrique_60&"|"&$SousRubrique_61&"|"&$SousRubrique_62&"|"&$SousRubrique_63&"|"&$SousRubrique_64&"|"&$SousRubrique_65) ElseIf $Rubrique = " Périphériques et réseau" Then GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, " |"&$SousRubrique_66&"|"&$SousRubrique_67&"|"&$SousRubrique_68&"|"&$SousRubrique_69&"|"&$SousRubrique_70&"|"&$SousRubrique_71) EndIf EndFunc Func Filtrage($OS = -1, $Coche = -1, $Rubrique = "", $SousRubrique = "") ConsoleWrite("OS de départ : " & $OS & @CRLF) $Lecture_Windows_2000 = GUICtrlRead($Windows_2000) $Lecture_Windows_XP = GUICtrlRead($Windows_XP) $Lecture_Windows_2003 = GUICtrlRead($Windows_2003) $Lecture_Windows_Vista = GUICtrlRead($Windows_Vista) $Lecture_Windows_7 = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $NombreElements = _GUICtrlListView_GetItemCount($Tableau) ; ---------------------------------------------------------------------------------------------------- ; ---------- Ajout des éléments ---------- ; ---------------------------------------------------------------------------------------------------- For $Elements In $Actions ; parcours des éléments $Elements_ID = _StringBetween($Elements, 'GUICtrlCreateListViewItem("', "|") $ConversionValeurArray = _ArrayToString($Elements_ID) $Verification_Windows2000 = 0 $Verification_WindowsXP = 0 For $i = $NombreElements -1 To 0 Step -1 ; parcours du tableau affiché $RubriqueTableau_ID = _GUICtrlListView_GetItem($Tableau, $i, 0) ; Récupération de l'ID des éléments du tableau $RubriqueTableau_OS = _GUICtrlListView_GetItem($Tableau, $i, 1) ; Récupération de l'OS des éléments du tableau If $Lecture_Windows_2000 = 4 Then ; Si la case "Windows 2000" est décochée ;~ ConsoleWrite('"Windows 2000" est décochée'&@CRLF&"$RubriqueTableau_OS[3] : "&$RubriqueTableau_OS[3]&@CRLF) If StringInStr($RubriqueTableau_OS[3], "Windows 2000") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2000 = 1 And $OS = " Windows 2000" Then ; Si la case "Windows 2000" est cochée $Verification_Windows2000 = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_Windows2000 += 1 EndIf EndIf If $Lecture_Windows_XP = 4 Then ; Si la case "Windows XP" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows XP") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_XP = 1 And $OS = " Windows XP" Then ; Si la case "Windows XP" est cochée $Verification_WindowsXP = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_WindowsXP += 1 EndIf EndIf If $Lecture_Windows_2003 = 4 Then ; Si la case "Windows 2003" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 2003") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2003 = 1 Then EndIf If $Lecture_Windows_Vista = 4 Then ; Si la case "Windows Vista" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows vista") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf If $Lecture_Windows_7 = 4 Then ; Si la case "Windows 7" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 7") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf Next ConsoleWrite("Verif 2000 : "&$Verification_Windows2000&@CRLF&"Verif XP : "&$Verification_WindowsXP&@CRLF) If $Verification_Windows2000 = 1 Then Execute($Elements) ElseIf $Verification_WindowsXP = 1 Then Execute($Elements) EndIf Next EndFunc
taietel Posted March 25, 2011 Posted March 25, 2011 (edited) ATR, I didn't quite understood what you mean, but I've made some changes in your script - in the second combobox the values were added (instead replacing) based on the selection from the first one - changed the If...ElseIf... with Switch... Case (it's faster) expandcollapse popup#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> #Include <String.au3> ;Systèmes d'exploitation : $OS_1 = " Windows XP" $OS_2 = " Windows 2000" $OS_3 = " Windows 2003" $OS_4 = " Windows vista" $OS_5 = " Windows 7" ; Rubriques : $Rubrique_1 = " L'éditeur d'objets de stratégie de groupe" $Rubrique_2 = " Gesion des utilisateurs" $Rubrique_3 = " Le bureau Windows" $Rubrique_4 = " L'explorateur Windows" $Rubrique_5 = " Le système" $Rubrique_6 = " Les applications et composants Windows" $Rubrique_7 = " Perrsonnaliser et sécuriser Internet Explorer" $Rubrique_8 = " Restrictions dans Internet Explorer" $Rubrique_9 = " Périphériques et réseau" ; Sous-rubriques : ; Sous-rubrique " L'éditeur d'objets de stratégie de groupe" $SousRubrique_1 = " Les fichiers de console" $SousRubrique_2 = " L'éditeur d'objets de stratégie de groupe" $SousRubrique_3 = " Les stratégies de groupe" $SousRubrique_4 = " Les fichiers de modèle" ; Sous-rubrique " Gesion des utilisateurs" $SousRubrique_5 = " Le contrôle de compte d'utilisateur" $SousRubrique_6 = " Paramétrer le contrôle du compte d'utilisateur" $SousRubrique_7 = " Le contrôle parental" $SousRubrique_8 = " L'ouverture de session interactive" $SousRubrique_9 = " Les options de sécurité et le registre Windows" ; Sous-rubrique " Le bureau Windows" $SousRubrique_10 = " Le bureau Windows" $SousRubrique_11 = " Le menu Démarrer" $SousRubrique_12 = " La barre des tâches" $SousRubrique_13 = " Les raccourcis" $SousRubrique_14 = " Le panneau de configuration" $SousRubrique_15 = " L'affichage" $SousRubrique_16 = " Les écrans de veille" $SousRubrique_17 = " Les options régionales et linguistiques" ; Sous-rubrique " L'explorateur Windows" $SousRubrique_18 = " Personnaliser l'explorateur Windows" $SousRubrique_19 = " Sécuriser l'explorateur Windows" $SousRubrique_20 = " La corbeille Windows" $SousRubrique_21 = " Les miniatures" $SousRubrique_22 = " Les lecteurs" $SousRubrique_23 = " Les menus contextuels sous Windows 7" $SousRubrique_24 = " La fonctionnalité des versions précédentes" $SousRubrique_25 = " La fonctionnalité de recherche" $SousRubrique_26 = " Chiffrement des ficheirs et des dossiers" $SousRubrique_27 = " Sauvegarde des données" ; Sous-rubrique " Le système" $SousRubrique_28 = " Personnaliser votre système" $SousRubrique_29 = " Gérer votre licence Windows" $SousRubrique_30 = " Les fonctionnalités système" $SousRubrique_31 = " Le gestionnaire de tâches" $SousRubrique_32 = " Nettoyage de disque" $SousRubrique_33 = " Les profils d'utilisateur" $SousRubrique_34 = " La restauration système" $SousRubrique_35 = " Windows update" $SousRubrique_36 = " Windows Defender" $SousRubrique_37 = " Les quotas de disque" ; Sous-rubrique " Les applications et composants Windows" $SousRubrique_38 = " Définir une restriction logicielle" $SousRubrique_39 = " Programmes et fonctionnalités" $SousRubrique_40 = " Les programmes et fonctionnalités Windows 7" $SousRubrique_41 = " Les outils systèmes" $SousRubrique_42 = " Compatibilité des applications" $SousRubrique_43 = " Windows Installer" $SousRubrique_44 = " Les composants Windows" $SousRubrique_45 = " Windows Media Player" $SousRubrique_46 = " Windows Mail" $SousRubrique_47 = " Gestion des pièces jointes" $SousRubrique_48 = " Ne pas autoriser l'éxécutioon de Windows Media Center" $SousRubrique_49 = " Désactiver les paramètres de présentation Windows" $SousRubrique_50 = " Les capteurs d'emplacements" ; Sous-rubrique " Personnaliser et sécuriser Internet Explorer" $SousRubrique_51 = " Personnaliser Internet Explorer" $SousRubrique_52 = " Les zones de sécurité" $SousRubrique_53 = " L'onglet sécurité" $SousRubrique_54 = " Les fonctionnalités de sécurité" $SousRubrique_55 = " Les accélérateurs web" $SousRubrique_56 = " L'affichage de compatibilité" $SousRubrique_57 = " Le filtre InPrivate" ; Sous-rubrique " Restrictions dans Internet Explorer" $SousRubrique_58 = " Paramétrer les menus d'Internet Explorer" $SousRubrique_59 = " Le panneau de configuration d'Internet Explorer" $SousRubrique_60 = " Options avancées" $SousRubrique_61 = " Les barres d'outils" $SousRubrique_62 = " Paramètres Internet" $SousRubrique_63 = " Paramètres de navigation" $SousRubrique_64 = " Menus du navigateur" $SousRubrique_65 = " Les flux RSS et les Web Slices" ; Sous-rubrique " Périphériques et réseau" $SousRubrique_66 = " Les périphériques" $SousRubrique_67 = " Gestion de l'alimentation" $SousRubrique_68 = " Stratégies sur le réseau" $SousRubrique_69 = " Le pare-feu de connexion Internet" $SousRubrique_70 = " Windows Connect Now" $SousRubrique_71 = " Le Projecteur réseau" GUICreate("Automatisations", 520, 700) GUISetState(@SW_SHOW) GUICtrlCreateGroup("Filtres", 10, 10, 500, 120) $Windows_2000 = GUICtrlCreateCheckbox("Windows 2000", 30, 30) $Windows_XP = GUICtrlCreateCheckbox("Windows XP", 130, 30) $Windows_2003 = GUICtrlCreateCheckbox("Windows 2003", 220, 30) $Windows_Vista = GUICtrlCreateCheckbox("Windows Vista", 320, 30) $Windows_7 = GUICtrlCreateCheckbox("Windows 7", 420, 30) GUICtrlCreateLabel("Rubriques :", 30, 65) $ListeRubriques = GUICtrlCreateCombo("", 95, 62.5, 250) GUICtrlSetData($ListeRubriques, $Rubrique_1 & "|" & $Rubrique_2 & "|" & $Rubrique_3 & "|" & $Rubrique_4 & "|" & $Rubrique_5 & "|" & $Rubrique_6 & "|" & $Rubrique_7 & "|" & $Rubrique_8 & "|" & $Rubrique_9) $ListeSousRubriques = GUICtrlCreateCombo("", 95, 95, 250) GUICtrlSetState(-1, $GUI_DISABLE) $Tableau = GUICtrlCreateListView("ID|Systèmes|Actions|Rubrique|Sous-rubrique", 10, 145, 500, 400, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES)) _GUICtrlListView_SetColumnWidth($Tableau, 1, 120) _GUICtrlListView_SetColumnWidth($Tableau, 2, 376) Dim $Actions[9] $Actions[0] = 'GUICtrlCreateListViewItem("1|"&$OS_1&"|évènement XP R1 SR3|"& $Rubrique_1 & "|" & $SousRubrique_3, $Tableau)' $Actions[1] = 'GUICtrlCreateListViewItem("2|"&$OS_1&"|évènement XP R1 SR1|"& $Rubrique_1 & "|" & $SousRubrique_1, $Tableau)' $Actions[2] = 'GUICtrlCreateListViewItem("03|"&$OS_2&"|évènement XP R2 SR8|"& $Rubrique_2 & "|" & $SousRubrique_8, $Tableau)' $Actions[3] = 'GUICtrlCreateListViewItem("4|"&$OS_2&"|évènement XP R3 SR3|"& $Rubrique_3 & "|" & $SousRubrique_3, $Tableau)' $Actions[4] = 'GUICtrlCreateListViewItem("54|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[5] = 'GUICtrlCreateListViewItem("6|"&$OS_1&"|évènement XP R2 SR7|"& $Rubrique_2 & "|" & $SousRubrique_7, $Tableau)' $Actions[6] = 'GUICtrlCreateListViewItem("789|"&$OS_2&"|évènement XP R2 SR6|"& $Rubrique_2 & "|" & $SousRubrique_6, $Tableau)' $Actions[7] = 'GUICtrlCreateListViewItem("8|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[8] = 'GUICtrlCreateListViewItem("9|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' For $Elements_depart In $Actions Execute($Elements_depart) Next ;~ _GUICtrlListView_HideColumn($Tableau, 0) _GUICtrlListView_HideColumn($Tableau, 3) _GUICtrlListView_HideColumn($Tableau, 4) GUICtrlSetState($Windows_2000, $GUI_CHECKED) GUICtrlSetState($Windows_XP, $GUI_CHECKED) GUICtrlSetState($Windows_2003, $GUI_CHECKED) GUICtrlSetState($Windows_Vista, $GUI_CHECKED) GUICtrlSetState($Windows_7, $GUI_CHECKED) $Appliquer = GUICtrlCreateButton("Appliquer", 20, 560, 100) $Quitter = GUICtrlCreateButton("Quitter", 140, 560, 100) _GUICtrlListView_RegisterSortCallBack($Tableau) Do $msg = GUIGetMsg() Select Case $msg = $Tableau _GUICtrlListView_SortItems($Tableau, GUICtrlGetState($Tableau)) Case $msg = $Windows_2000 $Question_coche = GUICtrlRead($Windows_2000) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_2, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 1"&@CRLF) EndIf Filtrage($OS_2, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 2"&@CRLF) Else Filtrage($OS_2, $Question_coche) ConsoleWrite("filtrage 3"&@CRLF) EndIf Case $msg = $Windows_2003 $Question_coche = GUICtrlRead($Windows_2003) ConsoleWrite(GUICtrlGetState($Windows_2000)&@CRLF) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_3, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 4"&@CRLF) EndIf Filtrage($OS_3, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 5"&@CRLF) Else Filtrage($OS_3, $Question_coche) ConsoleWrite("filtrage 6"&@CRLF) EndIf Case $msg = $Windows_XP $Question_coche = GUICtrlRead($Windows_XP) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_1, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 7"&@CRLF) EndIf Filtrage($OS_1, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 8"&@CRLF) Else Filtrage($OS_1, $Question_coche) EndIf Case $msg = $Windows_Vista $Question_coche = GUICtrlRead($Windows_Vista) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_4, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_4, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_4, $Question_coche) EndIf Case $msg = $Windows_7 $Question_coche = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_5, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_5, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_5, $Question_coche) EndIf Case $msg = $ListeRubriques $Lecture_rubriques = GUICtrlRead($ListeRubriques) Filtrage_Rubriques($Lecture_rubriques) Case $msg = $ListeSousRubriques $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $Lecture_rubriques = GUICtrlRead($ListeRubriques) Case $msg = $Quitter GUIDelete() Exit EndSelect Until $msg = $GUI_EVENT_CLOSE _GUICtrlListView_UnRegisterSortCallBack($Tableau) Func Filtrage_Rubriques($Rubrique) Switch $Rubrique Case "" GUICtrlSetData($ListeSousRubriques, "") GUICtrlSetState($ListeSousRubriques, $GUI_DISABLE) Case " L'éditeur d'objets de stratégie de groupe" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_1&"|"&$SousRubrique_2&"|"&$SousRubrique_3&"|"&$SousRubrique_4) Case " Gesion des utilisateurs" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_5&"|"&$SousRubrique_6&"|"&$SousRubrique_7&"|"&$SousRubrique_8&"|"&$SousRubrique_9) Case " Le bureau Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_10&"|"&$SousRubrique_11&"|"&$SousRubrique_12&"|"&$SousRubrique_13&"|"&$SousRubrique_14&"|"&$SousRubrique_15&"|"&$SousRubrique_16&"|"&$SousRubrique_17) Case " L'explorateur Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_18&"|"&$SousRubrique_19&"|"&$SousRubrique_20&"|"&$SousRubrique_21&"|"&$SousRubrique_22&"|"&$SousRubrique_23&"|"&$SousRubrique_24&"|"&$SousRubrique_25&"|"&$SousRubrique_26&"|"&$SousRubrique_27) Case " Le système" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_28&"|"&$SousRubrique_29&"|"&$SousRubrique_30&"|"&$SousRubrique_31&"|"&$SousRubrique_32&"|"&$SousRubrique_33&"|"&$SousRubrique_34&"|"&$SousRubrique_35&"|"&$SousRubrique_36&"|"&$SousRubrique_37) Case " Les applications et composants Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_38&"|"&$SousRubrique_39&"|"&$SousRubrique_40&"|"&$SousRubrique_41&"|"&$SousRubrique_42&"|"&$SousRubrique_43&"|"&$SousRubrique_44&"|"&$SousRubrique_45&"|"&$SousRubrique_46&"|"&$SousRubrique_47&"|"&$SousRubrique_48&"|"&$SousRubrique_49&"|"&$SousRubrique_50) Case " Personnaliser et sécuriser Internet Explorer" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_51&"|"&$SousRubrique_52&"|"&$SousRubrique_53&"|"&$SousRubrique_54&"|"&$SousRubrique_55&"|"&$SousRubrique_56&"|"&$SousRubrique_57) Case " Restrictions dans Internet Explorer" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_58&"|"&$SousRubrique_59&"|"&$SousRubrique_60&"|"&$SousRubrique_61&"|"&$SousRubrique_62&"|"&$SousRubrique_63&"|"&$SousRubrique_64&"|"&$SousRubrique_65) Case " Périphériques et réseau" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_66&"|"&$SousRubrique_67&"|"&$SousRubrique_68&"|"&$SousRubrique_69&"|"&$SousRubrique_70&"|"&$SousRubrique_71) EndSwitch EndFunc Func Filtrage($OS = -1, $Coche = -1, $Rubrique = "", $SousRubrique = "") ConsoleWrite("OS de départ : " & $OS & @CRLF) $Lecture_Windows_2000 = GUICtrlRead($Windows_2000) $Lecture_Windows_XP = GUICtrlRead($Windows_XP) $Lecture_Windows_2003 = GUICtrlRead($Windows_2003) $Lecture_Windows_Vista = GUICtrlRead($Windows_Vista) $Lecture_Windows_7 = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $NombreElements = _GUICtrlListView_GetItemCount($Tableau) ; ---------------------------------------------------------------------------------------------------- ; ---------- Ajout des éléments ---------- ; ---------------------------------------------------------------------------------------------------- For $Elements In $Actions ; parcours des éléments $Elements_ID = _StringBetween($Elements, 'GUICtrlCreateListViewItem("', "|") $ConversionValeurArray = _ArrayToString($Elements_ID) $Verification_Windows2000 = 0 $Verification_WindowsXP = 0 For $i = $NombreElements -1 To 0 Step -1 ; parcours du tableau affiché $RubriqueTableau_ID = _GUICtrlListView_GetItem($Tableau, $i, 0) ; Récupération de l'ID des éléments du tableau $RubriqueTableau_OS = _GUICtrlListView_GetItem($Tableau, $i, 1) ; Récupération de l'OS des éléments du tableau If $Lecture_Windows_2000 = 4 Then ; Si la case "Windows 2000" est décochée ;~ ConsoleWrite('"Windows 2000" est décochée'&@CRLF&"$RubriqueTableau_OS[3] : "&$RubriqueTableau_OS[3]&@CRLF) If StringInStr($RubriqueTableau_OS[3], "Windows 2000") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2000 = 1 And $OS = " Windows 2000" Then ; Si la case "Windows 2000" est cochée $Verification_Windows2000 = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_Windows2000 += 1 EndIf EndIf If $Lecture_Windows_XP = 4 Then ; Si la case "Windows XP" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows XP") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_XP = 1 And $OS = " Windows XP" Then ; Si la case "Windows XP" est cochée $Verification_WindowsXP = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_WindowsXP += 1 EndIf EndIf If $Lecture_Windows_2003 = 4 Then ; Si la case "Windows 2003" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 2003") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2003 = 1 Then EndIf If $Lecture_Windows_Vista = 4 Then ; Si la case "Windows Vista" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows vista") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf If $Lecture_Windows_7 = 4 Then ; Si la case "Windows 7" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 7") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf Next ConsoleWrite("Verif 2000 : "&$Verification_Windows2000&@CRLF&"Verif XP : "&$Verification_WindowsXP&@CRLF) If $Verification_Windows2000 = 1 Then Execute($Elements) ElseIf $Verification_WindowsXP = 1 Then Execute($Elements) EndIf Next EndFunc [EDIT] Regarding the filtering, take a look at John Bailey's script: expandcollapse popup#cs ------------------------------------------------- Author: John Bailey Modifier: name Date Modified: today's date ScriptFunction: description of this script's function AutoIt Ver: version Script Version: 1.0.0 (base code).(improved/added features).(script errors corrected) Script Update History: 1.1.0 - AdvFilter updated to allow for multiple filtering on single column To-Do List (not in importance order): -> 1. Contextmenu for the search input control using the SearchType options. -> = working on #ce ------------------------------------------------- #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GuiListView.au3> #include <GuiComboBox.au3> #include <File.au3> #include <Array.au3> #include <Date.au3> #include <GuiEdit.au3> ;#include <ControlConstants.au3> Opt ("GUIOnEventMode", 1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1) ;==== Row Entries ; Delim. Global $SettingsIR_delimiter = '†' ; File Global $dbRowEntriesFile = @ScriptDir&'\LV Filter - onchange expand.txt' ; Array Global $dbRowEntriesArray ;Array 2D Global $dbRowEntriesArray2D ;Array 2D Column Count Global $dbRowEntriesArray2DCount ;==== Global $checkedSymbol = chr(149) Global $unCheckedSymbol = chr(32) Local $LVHeaders = 'First Name|Last Name|Number|Access' $AppWin = GUICreate("Search Example", 1066, 623, -1, -1) ;GUISetBkColor(0x716F64) $Input = GUICtrlCreateInput("", 31, 39, 240, 22) GUICtrlSetFont(-1, 9, 800, 0, "Rockwell") $Label1 = GUICtrlCreateLabel("Search", 31, 20, 36, 17) GUICtrlSetColor(-1, 0xC0C0C0) $LV_Main = GUICtrlCreateListView($LVHeaders, 31, 65, 510, 495) GUICtrlSendMsg($LV_Main, 0x101E, 0, 120) GUICtrlSendMsg($LV_Main, 0x101E, 1, 178) GUICtrlSendMsg($LV_Main, 0x101E, 2, 40) GUICtrlSendMsg($LV_Main, 0x101E, 3, 70) ;GUICtrlSetBkColor($LV_Main, 0xD4D0C8) Global $TotalColumns = _GUICtrlListView_GetColumnCount($LV_Main) $dbRowEntriesArray2D = _setupRowEntries() $Label2 = GUICtrlCreateLabel("Column To Search", 278, 19, 126, 17) GUICtrlSetColor($Label2, 0xC0C0C0) $ColumnToSearchCB = GUICtrlCreateCombo("All", 277, 39, 128, 25) GUICtrlSetData($ColumnToSearchCB,$LVHeaders) $SearchTypeCB = GUICtrlCreateCombo("Contains", 412, 39, 128, 25) GUICtrlSetData($SearchTypeCB, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Label3 = GUICtrlCreateLabel("Search Type", 413, 18, 98, 17) GUICtrlSetColor($Label3, 0xC0C0C0) $Group1 = GUICtrlCreateGroup("", 563, 81, 457, 370) $Label4 = GUICtrlCreateLabel("Advanced Filter Section", 639, 101, 286, 17, $SS_CENTER) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label7 = GUICtrlCreateLabel("Search", 736, 136, 36, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Input1 = GUICtrlCreateInput("", 735, 158, 121, 21) $Input2 = GUICtrlCreateInput("", 735, 190, 121, 21) $Input3 = GUICtrlCreateInput("", 735, 224, 121, 21) $Label5 = GUICtrlCreateLabel("Column To Search", 591, 136, 126, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Combo6 = GUICtrlCreateCombo("First Name", 590, 158, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo7 = GUICtrlCreateCombo("Last Name", 591, 190, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo8 = GUICtrlCreateCombo("Number", 591, 224, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo9 = GUICtrlCreateCombo("Access", 590, 255, 136, 25) $Label6 = GUICtrlCreateLabel("Search Type", 864, 136, 98, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Combo2 = GUICtrlCreateCombo("Contains", 863, 158, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo3 = GUICtrlCreateCombo("Contains", 863, 191, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo4 = GUICtrlCreateCombo("Contains", 863, 224, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo5 = GUICtrlCreateCombo("", 863, 255, 128, 25) GUICtrlSetData(-1, "Checked|Not Checked") $StatusBar = GUICtrlCreateLabel("", 0, 604, 1066, 17, $SS_SUNKEN) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_GUIEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "_GUIEvents") GUICtrlSetOnEvent($ColumnToSearchCB, "ButtonPressed") GUICtrlSetOnEvent($Combo2, "ButtonPressed") GUICtrlSetOnEvent($Combo3, "ButtonPressed") GUICtrlSetOnEvent($Combo4, "ButtonPressed") GUICtrlSetOnEvent($Combo5, "ButtonPressed") GUICtrlSetOnEvent($SearchTypeCB, "ButtonPressed") GUISetState(@SW_SHOW) _loadRowEntries($LV_Main) While 1 Sleep(25) WEnd ;=============================================================================== ; ; Function Name: _() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterLVItems($fil_SearchType='Contains',$fil_columntoSearch=0) Local $LVtofilter = $LV_Main Local $fil_searchInput = $Input Local $fil_Array = $dbRowEntriesArray Local $fil_Array2D = $dbRowEntriesArray2D Local $fil_Array2DColumns = $dbRowEntriesArray2DCount Local $fil_SearchTypeCB = $SearchTypeCB Local $fil_checkedSymbol = $checkedSymbol Local $fil_SearchText = GUICtrlRead($fil_searchInput) Local $SearchCharLen = StringLen($fil_SearchText) _GUICtrlListView_DeleteAllItems($LVtofilter) If $fil_SearchText <> '' OR $fil_SearchType = 'Is Empty' OR $fil_SearchType = 'Not Empty' OR $fil_SearchType = 'Checked' OR $fil_SearchType = 'Not Checked' Then If $fil_SearchType = 'Contains' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array[$a],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Does Not Contain' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array[$a],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Begins With' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array[$a] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array2D[$a][$fil_columntoSearch-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Does Not Begin With' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array[$a] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array2D[$a][$fil_columntoSearch-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Equals' Then Local $fil_SearchText = GUICtrlRead($fil_searchInput) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText = $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText = $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Not Equal' Then Local $fil_SearchText = GUICtrlRead($fil_searchInput) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <> $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <> $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Greater Than' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText > $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText > $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Greater Than or Equal' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText >= $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText >= $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Less Than' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText < $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText < $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Less Than or Equal' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <= $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <= $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Is Empty' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $fil_subCounter=0 Local $fil_add = 0 For $fil_subCounter=1 to $fil_Array2DColumns Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_subCounter-1],Number($fil_SearchText)) = '' Then $fil_add = 1 EndIf Case Else If $fil_Array2D[$a][$fil_subCounter-1] = '' Then $fil_add = 1 EndIf EndSwitch Next If $fil_add <> 0 Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next Else For $a = 1 to UBound($fil_Array)-1 Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_columntoSearch-1],Number($fil_SearchText)) = '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Case Else If $fil_Array2D[$a][$fil_columntoSearch-1] = '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf EndSwitch Next EndIf ElseIf $fil_SearchType = 'Not Empty' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $fil_subCounter=0 Local $fil_add = 0 For $fil_subCounter=1 to $fil_Array2DColumns Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_subCounter-1],Number($fil_SearchText)) <> '' Then $fil_add = 1 EndIf Case Else If $fil_Array2D[$a][$fil_subCounter-1] <> '' Then $fil_add = 1 EndIf EndSwitch Next If $fil_add <> 0 Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next Else For $a = 1 to UBound($fil_Array)-1 Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_columntoSearch-1],Number($fil_SearchText)) <> '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Case Else If $fil_Array2D[$a][$fil_columntoSearch-1] <> '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf EndSwitch Next EndIf ElseIf $fil_SearchType = 'Checked' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array[$a],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Not Checked' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array[$a],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf Else ; Search Type is not setup MsgBox(0,'Search Type Error',$fil_SearchType&' is not set in the code') For $a = 1 to UBound($fil_Array)-1 _FilterLV_AddtoLV($LVtofilter,$fil_Array,$SettingsIR_delimiter) Next EndIf ; Full List - No Filter - Blank Input Area Else For $a = 1 to UBound($fil_Array)-1 _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next EndIf EndFunc ;=============================================================================== ; ; Function Name: _FilterAdv() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterAdv($faaa_string) Local $fil_LVtofilter = $LV_Main Local $fil_Array = $dbRowEntriesArray Local $fil_Array2D = $dbRowEntriesArray2D Local $fil_checkedSymbol = $checkedSymbol Local $sSplit = StringSplit($faaa_string,$SettingsIR_delimiter) _GUICtrlListView_DeleteAllItems($fil_LVtofilter) For $a = 1 to UBound($fil_Array)-1 Local $faaa_yes = 1 Local $count For $count = 1 to $sSplit[0] Local $cSplit = StringSplit($sSplit[$count],'‡') Local $LVHeadersArray=StringSplit($LVHeaders,'|',1) Local $fil_ColumnToSearch= _ArraySearch($LVHeadersArray,$cSplit[3],1) Local $counter = $fil_ColumnToSearch If $cSplit[1] <> '' Then If $cSplit[2] = 'Contains' Then If NOT StringInStr($fil_Array2D[$a][$counter-1],$cSplit[1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Does Not Contain' Then If StringInStr($fil_Array2D[$a][$counter-1],$cSplit[1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Begins With' Then Local $SearchCharLen = StringLen($cSplit[1]) Local $String = $fil_Array2D[$a][$counter-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $cSplit[1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Does Not Begin With' Then Local $SearchCharLen = StringLen($cSplit[1]) Local $String = $fil_Array2D[$a][$counter-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $cSplit[1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Equals' Then If $cSplit[1] <> $fil_Array2D[$a][$counter-1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Not Equal' Then If $cSplit[1] = $fil_Array2D[$a][$counter-1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Greater Than' Then If Number($cSplit[1]) >= Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Greater Than or Equal' Then If Number($cSplit[1]) > Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Less Than' Then If Number($cSplit[1]) <= Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Less Than or Equal' Then If Number($cSplit[1]) < Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Is Empty' Then Switch Number($cSplit[1]) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$counter-1],Number($cSplit[1])) <> '' Then $faaa_yes = 0 EndIf Case Else If $fil_Array2D[$a][$counter-1] <> '' Then $faaa_yes = 0 EndIf EndSwitch ElseIf $cSplit[2] = 'Not Empty' Then Switch Number($cSplit[1]) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$counter-1],Number($cSplit[1])) = '' Then $faaa_yes = 0 EndIf Case Else If $fil_Array2D[$a][$counter-1] = '' Then $faaa_yes = 0 EndIf EndSwitch ElseIf $cSplit[2] = 'Checked' Then If NOT StringInStr($fil_Array2D[$a][$counter-1],$fil_checkedSymbol) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Not Checked' Then If StringInStr($fil_Array2D[$a][$counter-1],$fil_checkedSymbol) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = '' Then ; Else MsgBox(0,'Search Type Error',$cSplit[2]&' is not set in the code') EndIf EndIf Next If $faaa_yes = 1 Then _FilterLV_AddtoLV($fil_LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndFunc ;=============================================================================== ; ; Function Name: _() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterLV_AddtoLV(ByRef $fL_LVtofilter, ByRef $fL_LinetoAdd,$fL_delimiter='†') Local $itemLineArray = StringSplit($fL_LinetoAdd,$fL_delimiter,1) Local $itemLine = '' Local $b For $b = 1 to $itemLineArray[0] If $b = $itemLineArray[0] Then $itemLine &= $itemLineArray[$b] Else $itemLine &= $itemLineArray[$b]&'|' EndIf Next GUICtrlCreateListViewItem($itemLine, $fL_LVtofilter) EndFunc Func _setupRowEntries() ;set it up after the columns are setup _FileReadToArray($dbRowEntriesFile,$dbRowEntriesArray) If @error Then Msgbox(0,'File not read to Array',$dbRowEntriesFile&@LF&' to $dbRowEntriesArray') EndIf Local $headerSplit = StringSplit($LVHeaders,'|',1) $dbRowEntriesArray2DCount = $headerSplit[0] Local $sre_dbRowEntriesArray2D[UBound($dbRowEntriesArray)][$dbRowEntriesArray2DCount] Local $x = 1 For $x = 1 to UBound($dbRowEntriesArray)-1 Local $readSplitArray = StringSplit($dbRowEntriesArray[$x],$SettingsIR_delimiter,1) Local $xx = 0 For $xx = 1 to $readSplitArray[0] $sre_dbRowEntriesArray2D[$x][$xx-1] = $readSplitArray[$xx] Next Next Return $sre_dbRowEntriesArray2D EndFunc Func _loadRowEntries(ByRef $lvID) For $x = 1 to Ubound($dbRowEntriesArray2D)-1 Local $itemLine = '' For $xx = 1 to $dbRowEntriesArray2DCount If $xx = $dbRowEntriesArray2DCount Then $itemLine &= $dbRowEntriesArray2D[$x][$xx-1] ;If $dbRowEntriesArray2D[$x][$xx-1] = 'true' Then ; $itemLine &= $checkedSymbol ;ElseIf $dbRowEntriesArray2D[$x][$xx-1] = 'false' Then ; $itemLine &= $checkedSymbol ;EndIf Else $itemLine &= $dbRowEntriesArray2D[$x][$xx-1]&'|' EndIf Next GUICtrlCreateListViewItem($itemLine, $lvID) Next EndFunc Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam) ; gaFrost for monitoring inputfield change Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0xFFFF) Local $hCtrl = $lParam Switch $nID Case $Input Switch $nNotifyCode Case $EN_CHANGE _FilterLVItems(GUICtrlRead($SearchTypeCB),_GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB )) EndSwitch Case $Input1, $Input2, $Input3 Local $df = GUICtrlRead($Input1)&'‡'&GUICtrlRead($Combo2)&'‡'&GUICtrlRead($Combo6)&'†'&GUICtrlRead($Input2)&'‡'&GUICtrlRead($Combo3)&'‡'&GUICtrlRead($Combo7)&'†'&GUICtrlRead($Input3)&'‡'&GUICtrlRead($Combo4)&'‡'&GUICtrlRead($Combo8)&'†'&'blank'&'‡'&GUICtrlRead($Combo5)&'‡'&GUICtrlRead($Combo9) _FilterAdv($df) EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND ;==>WM_Notify_Events Func ButtonPressed() Switch @GUI_CTRLID case $ColumnToSearchCB Local $CBcurrentIndex = _GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB ) _FilterLVItems(GUICtrlRead($SearchTypeCB),$CBcurrentIndex) Case $SearchTypeCB Local $CBcurrentIndex = _GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB ) _FilterLVItems(GUICtrlRead($SearchTypeCB),$CBcurrentIndex) Case $Combo2,$Combo3,$Combo4,$Combo5 Local $df = GUICtrlRead($Input1)&'‡'&GUICtrlRead($Combo2)&'‡'&GUICtrlRead($Combo6)&'†'&GUICtrlRead($Input2)&'‡'&GUICtrlRead($Combo3)&'‡'&GUICtrlRead($Combo7)&'†'&GUICtrlRead($Input3)&'‡'&GUICtrlRead($Combo4)&'‡'&GUICtrlRead($Combo8)&'†'&'blank'&'‡'&GUICtrlRead($Combo5)&'‡'&GUICtrlRead($Combo9) _FilterAdv($df) EndSwitch EndFunc Func _GUIEvents() Select Case @GUI_CTRLID = $GUI_EVENT_CLOSE Exit Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE Case @GUI_CTRLID = $GUI_EVENT_RESTORE EndSelect EndFunc Edited March 25, 2011 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
ATR Posted March 25, 2011 Author Posted March 25, 2011 ATR, I didn't quite understood what you mean, but I've made some changes in your script - in the second combobox the values were added (instead replacing) based on the selection from the first one - changed the If...ElseIf... with Switch... Case (it's faster) expandcollapse popup#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> #Include <String.au3> ;Systèmes d'exploitation : $OS_1 = " Windows XP" $OS_2 = " Windows 2000" $OS_3 = " Windows 2003" $OS_4 = " Windows vista" $OS_5 = " Windows 7" ; Rubriques : $Rubrique_1 = " L'éditeur d'objets de stratégie de groupe" $Rubrique_2 = " Gesion des utilisateurs" $Rubrique_3 = " Le bureau Windows" $Rubrique_4 = " L'explorateur Windows" $Rubrique_5 = " Le système" $Rubrique_6 = " Les applications et composants Windows" $Rubrique_7 = " Perrsonnaliser et sécuriser Internet Explorer" $Rubrique_8 = " Restrictions dans Internet Explorer" $Rubrique_9 = " Périphériques et réseau" ; Sous-rubriques : ; Sous-rubrique " L'éditeur d'objets de stratégie de groupe" $SousRubrique_1 = " Les fichiers de console" $SousRubrique_2 = " L'éditeur d'objets de stratégie de groupe" $SousRubrique_3 = " Les stratégies de groupe" $SousRubrique_4 = " Les fichiers de modèle" ; Sous-rubrique " Gesion des utilisateurs" $SousRubrique_5 = " Le contrôle de compte d'utilisateur" $SousRubrique_6 = " Paramétrer le contrôle du compte d'utilisateur" $SousRubrique_7 = " Le contrôle parental" $SousRubrique_8 = " L'ouverture de session interactive" $SousRubrique_9 = " Les options de sécurité et le registre Windows" ; Sous-rubrique " Le bureau Windows" $SousRubrique_10 = " Le bureau Windows" $SousRubrique_11 = " Le menu Démarrer" $SousRubrique_12 = " La barre des tâches" $SousRubrique_13 = " Les raccourcis" $SousRubrique_14 = " Le panneau de configuration" $SousRubrique_15 = " L'affichage" $SousRubrique_16 = " Les écrans de veille" $SousRubrique_17 = " Les options régionales et linguistiques" ; Sous-rubrique " L'explorateur Windows" $SousRubrique_18 = " Personnaliser l'explorateur Windows" $SousRubrique_19 = " Sécuriser l'explorateur Windows" $SousRubrique_20 = " La corbeille Windows" $SousRubrique_21 = " Les miniatures" $SousRubrique_22 = " Les lecteurs" $SousRubrique_23 = " Les menus contextuels sous Windows 7" $SousRubrique_24 = " La fonctionnalité des versions précédentes" $SousRubrique_25 = " La fonctionnalité de recherche" $SousRubrique_26 = " Chiffrement des ficheirs et des dossiers" $SousRubrique_27 = " Sauvegarde des données" ; Sous-rubrique " Le système" $SousRubrique_28 = " Personnaliser votre système" $SousRubrique_29 = " Gérer votre licence Windows" $SousRubrique_30 = " Les fonctionnalités système" $SousRubrique_31 = " Le gestionnaire de tâches" $SousRubrique_32 = " Nettoyage de disque" $SousRubrique_33 = " Les profils d'utilisateur" $SousRubrique_34 = " La restauration système" $SousRubrique_35 = " Windows update" $SousRubrique_36 = " Windows Defender" $SousRubrique_37 = " Les quotas de disque" ; Sous-rubrique " Les applications et composants Windows" $SousRubrique_38 = " Définir une restriction logicielle" $SousRubrique_39 = " Programmes et fonctionnalités" $SousRubrique_40 = " Les programmes et fonctionnalités Windows 7" $SousRubrique_41 = " Les outils systèmes" $SousRubrique_42 = " Compatibilité des applications" $SousRubrique_43 = " Windows Installer" $SousRubrique_44 = " Les composants Windows" $SousRubrique_45 = " Windows Media Player" $SousRubrique_46 = " Windows Mail" $SousRubrique_47 = " Gestion des pièces jointes" $SousRubrique_48 = " Ne pas autoriser l'éxécutioon de Windows Media Center" $SousRubrique_49 = " Désactiver les paramètres de présentation Windows" $SousRubrique_50 = " Les capteurs d'emplacements" ; Sous-rubrique " Personnaliser et sécuriser Internet Explorer" $SousRubrique_51 = " Personnaliser Internet Explorer" $SousRubrique_52 = " Les zones de sécurité" $SousRubrique_53 = " L'onglet sécurité" $SousRubrique_54 = " Les fonctionnalités de sécurité" $SousRubrique_55 = " Les accélérateurs web" $SousRubrique_56 = " L'affichage de compatibilité" $SousRubrique_57 = " Le filtre InPrivate" ; Sous-rubrique " Restrictions dans Internet Explorer" $SousRubrique_58 = " Paramétrer les menus d'Internet Explorer" $SousRubrique_59 = " Le panneau de configuration d'Internet Explorer" $SousRubrique_60 = " Options avancées" $SousRubrique_61 = " Les barres d'outils" $SousRubrique_62 = " Paramètres Internet" $SousRubrique_63 = " Paramètres de navigation" $SousRubrique_64 = " Menus du navigateur" $SousRubrique_65 = " Les flux RSS et les Web Slices" ; Sous-rubrique " Périphériques et réseau" $SousRubrique_66 = " Les périphériques" $SousRubrique_67 = " Gestion de l'alimentation" $SousRubrique_68 = " Stratégies sur le réseau" $SousRubrique_69 = " Le pare-feu de connexion Internet" $SousRubrique_70 = " Windows Connect Now" $SousRubrique_71 = " Le Projecteur réseau" GUICreate("Automatisations", 520, 700) GUISetState(@SW_SHOW) GUICtrlCreateGroup("Filtres", 10, 10, 500, 120) $Windows_2000 = GUICtrlCreateCheckbox("Windows 2000", 30, 30) $Windows_XP = GUICtrlCreateCheckbox("Windows XP", 130, 30) $Windows_2003 = GUICtrlCreateCheckbox("Windows 2003", 220, 30) $Windows_Vista = GUICtrlCreateCheckbox("Windows Vista", 320, 30) $Windows_7 = GUICtrlCreateCheckbox("Windows 7", 420, 30) GUICtrlCreateLabel("Rubriques :", 30, 65) $ListeRubriques = GUICtrlCreateCombo("", 95, 62.5, 250) GUICtrlSetData($ListeRubriques, $Rubrique_1 & "|" & $Rubrique_2 & "|" & $Rubrique_3 & "|" & $Rubrique_4 & "|" & $Rubrique_5 & "|" & $Rubrique_6 & "|" & $Rubrique_7 & "|" & $Rubrique_8 & "|" & $Rubrique_9) $ListeSousRubriques = GUICtrlCreateCombo("", 95, 95, 250) GUICtrlSetState(-1, $GUI_DISABLE) $Tableau = GUICtrlCreateListView("ID|Systèmes|Actions|Rubrique|Sous-rubrique", 10, 145, 500, 400, -1, BitOR($LVS_EX_CHECKBOXES, $LVS_EX_GRIDLINES)) _GUICtrlListView_SetColumnWidth($Tableau, 1, 120) _GUICtrlListView_SetColumnWidth($Tableau, 2, 376) Dim $Actions[9] $Actions[0] = 'GUICtrlCreateListViewItem("1|"&$OS_1&"|évènement XP R1 SR3|"& $Rubrique_1 & "|" & $SousRubrique_3, $Tableau)' $Actions[1] = 'GUICtrlCreateListViewItem("2|"&$OS_1&"|évènement XP R1 SR1|"& $Rubrique_1 & "|" & $SousRubrique_1, $Tableau)' $Actions[2] = 'GUICtrlCreateListViewItem("03|"&$OS_2&"|évènement XP R2 SR8|"& $Rubrique_2 & "|" & $SousRubrique_8, $Tableau)' $Actions[3] = 'GUICtrlCreateListViewItem("4|"&$OS_2&"|évènement XP R3 SR3|"& $Rubrique_3 & "|" & $SousRubrique_3, $Tableau)' $Actions[4] = 'GUICtrlCreateListViewItem("54|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[5] = 'GUICtrlCreateListViewItem("6|"&$OS_1&"|évènement XP R2 SR7|"& $Rubrique_2 & "|" & $SousRubrique_7, $Tableau)' $Actions[6] = 'GUICtrlCreateListViewItem("789|"&$OS_2&"|évènement XP R2 SR6|"& $Rubrique_2 & "|" & $SousRubrique_6, $Tableau)' $Actions[7] = 'GUICtrlCreateListViewItem("8|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' $Actions[8] = 'GUICtrlCreateListViewItem("9|"&$OS_1&"|évènement XP R1 SR2|"& $Rubrique_1 & "|" & $SousRubrique_2, $Tableau)' For $Elements_depart In $Actions Execute($Elements_depart) Next ;~ _GUICtrlListView_HideColumn($Tableau, 0) _GUICtrlListView_HideColumn($Tableau, 3) _GUICtrlListView_HideColumn($Tableau, 4) GUICtrlSetState($Windows_2000, $GUI_CHECKED) GUICtrlSetState($Windows_XP, $GUI_CHECKED) GUICtrlSetState($Windows_2003, $GUI_CHECKED) GUICtrlSetState($Windows_Vista, $GUI_CHECKED) GUICtrlSetState($Windows_7, $GUI_CHECKED) $Appliquer = GUICtrlCreateButton("Appliquer", 20, 560, 100) $Quitter = GUICtrlCreateButton("Quitter", 140, 560, 100) _GUICtrlListView_RegisterSortCallBack($Tableau) Do $msg = GUIGetMsg() Select Case $msg = $Tableau _GUICtrlListView_SortItems($Tableau, GUICtrlGetState($Tableau)) Case $msg = $Windows_2000 $Question_coche = GUICtrlRead($Windows_2000) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_2, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 1"&@CRLF) EndIf Filtrage($OS_2, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 2"&@CRLF) Else Filtrage($OS_2, $Question_coche) ConsoleWrite("filtrage 3"&@CRLF) EndIf Case $msg = $Windows_2003 $Question_coche = GUICtrlRead($Windows_2003) ConsoleWrite(GUICtrlGetState($Windows_2000)&@CRLF) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_3, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 4"&@CRLF) EndIf Filtrage($OS_3, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 5"&@CRLF) Else Filtrage($OS_3, $Question_coche) ConsoleWrite("filtrage 6"&@CRLF) EndIf Case $msg = $Windows_XP $Question_coche = GUICtrlRead($Windows_XP) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_1, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) ConsoleWrite("filtrage 7"&@CRLF) EndIf Filtrage($OS_1, $Question_coche, $Lecture_rubriques) ConsoleWrite("filtrage 8"&@CRLF) Else Filtrage($OS_1, $Question_coche) EndIf Case $msg = $Windows_Vista $Question_coche = GUICtrlRead($Windows_Vista) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_4, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_4, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_4, $Question_coche) EndIf Case $msg = $Windows_7 $Question_coche = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) If $Lecture_rubriques <> "" Then If $Lecture_SousRubriques <> "" Then Filtrage($OS_5, $Question_coche, $Lecture_rubriques, $Lecture_SousRubriques) EndIf Filtrage($OS_5, $Question_coche, $Lecture_rubriques) Else Filtrage($OS_5, $Question_coche) EndIf Case $msg = $ListeRubriques $Lecture_rubriques = GUICtrlRead($ListeRubriques) Filtrage_Rubriques($Lecture_rubriques) Case $msg = $ListeSousRubriques $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $Lecture_rubriques = GUICtrlRead($ListeRubriques) Case $msg = $Quitter GUIDelete() Exit EndSelect Until $msg = $GUI_EVENT_CLOSE _GUICtrlListView_UnRegisterSortCallBack($Tableau) Func Filtrage_Rubriques($Rubrique) Switch $Rubrique Case "" GUICtrlSetData($ListeSousRubriques, "") GUICtrlSetState($ListeSousRubriques, $GUI_DISABLE) Case " L'éditeur d'objets de stratégie de groupe" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_1&"|"&$SousRubrique_2&"|"&$SousRubrique_3&"|"&$SousRubrique_4) Case " Gesion des utilisateurs" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_5&"|"&$SousRubrique_6&"|"&$SousRubrique_7&"|"&$SousRubrique_8&"|"&$SousRubrique_9) Case " Le bureau Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_10&"|"&$SousRubrique_11&"|"&$SousRubrique_12&"|"&$SousRubrique_13&"|"&$SousRubrique_14&"|"&$SousRubrique_15&"|"&$SousRubrique_16&"|"&$SousRubrique_17) Case " L'explorateur Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_18&"|"&$SousRubrique_19&"|"&$SousRubrique_20&"|"&$SousRubrique_21&"|"&$SousRubrique_22&"|"&$SousRubrique_23&"|"&$SousRubrique_24&"|"&$SousRubrique_25&"|"&$SousRubrique_26&"|"&$SousRubrique_27) Case " Le système" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_28&"|"&$SousRubrique_29&"|"&$SousRubrique_30&"|"&$SousRubrique_31&"|"&$SousRubrique_32&"|"&$SousRubrique_33&"|"&$SousRubrique_34&"|"&$SousRubrique_35&"|"&$SousRubrique_36&"|"&$SousRubrique_37) Case " Les applications et composants Windows" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_38&"|"&$SousRubrique_39&"|"&$SousRubrique_40&"|"&$SousRubrique_41&"|"&$SousRubrique_42&"|"&$SousRubrique_43&"|"&$SousRubrique_44&"|"&$SousRubrique_45&"|"&$SousRubrique_46&"|"&$SousRubrique_47&"|"&$SousRubrique_48&"|"&$SousRubrique_49&"|"&$SousRubrique_50) Case " Personnaliser et sécuriser Internet Explorer" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_51&"|"&$SousRubrique_52&"|"&$SousRubrique_53&"|"&$SousRubrique_54&"|"&$SousRubrique_55&"|"&$SousRubrique_56&"|"&$SousRubrique_57) Case " Restrictions dans Internet Explorer" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_58&"|"&$SousRubrique_59&"|"&$SousRubrique_60&"|"&$SousRubrique_61&"|"&$SousRubrique_62&"|"&$SousRubrique_63&"|"&$SousRubrique_64&"|"&$SousRubrique_65) Case " Périphériques et réseau" GUICtrlSetState($ListeSousRubriques, $GUI_ENABLE) GUICtrlSetData($ListeSousRubriques, "|"&$SousRubrique_66&"|"&$SousRubrique_67&"|"&$SousRubrique_68&"|"&$SousRubrique_69&"|"&$SousRubrique_70&"|"&$SousRubrique_71) EndSwitch EndFunc Func Filtrage($OS = -1, $Coche = -1, $Rubrique = "", $SousRubrique = "") ConsoleWrite("OS de départ : " & $OS & @CRLF) $Lecture_Windows_2000 = GUICtrlRead($Windows_2000) $Lecture_Windows_XP = GUICtrlRead($Windows_XP) $Lecture_Windows_2003 = GUICtrlRead($Windows_2003) $Lecture_Windows_Vista = GUICtrlRead($Windows_Vista) $Lecture_Windows_7 = GUICtrlRead($Windows_7) $Lecture_rubriques = GUICtrlRead($ListeRubriques) $Lecture_SousRubriques = GUICtrlRead($ListeSousRubriques) $NombreElements = _GUICtrlListView_GetItemCount($Tableau) ; ---------------------------------------------------------------------------------------------------- ; ---------- Ajout des éléments ---------- ; ---------------------------------------------------------------------------------------------------- For $Elements In $Actions ; parcours des éléments $Elements_ID = _StringBetween($Elements, 'GUICtrlCreateListViewItem("', "|") $ConversionValeurArray = _ArrayToString($Elements_ID) $Verification_Windows2000 = 0 $Verification_WindowsXP = 0 For $i = $NombreElements -1 To 0 Step -1 ; parcours du tableau affiché $RubriqueTableau_ID = _GUICtrlListView_GetItem($Tableau, $i, 0) ; Récupération de l'ID des éléments du tableau $RubriqueTableau_OS = _GUICtrlListView_GetItem($Tableau, $i, 1) ; Récupération de l'OS des éléments du tableau If $Lecture_Windows_2000 = 4 Then ; Si la case "Windows 2000" est décochée ;~ ConsoleWrite('"Windows 2000" est décochée'&@CRLF&"$RubriqueTableau_OS[3] : "&$RubriqueTableau_OS[3]&@CRLF) If StringInStr($RubriqueTableau_OS[3], "Windows 2000") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2000 = 1 And $OS = " Windows 2000" Then ; Si la case "Windows 2000" est cochée $Verification_Windows2000 = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_Windows2000 += 1 EndIf EndIf If $Lecture_Windows_XP = 4 Then ; Si la case "Windows XP" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows XP") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_XP = 1 And $OS = " Windows XP" Then ; Si la case "Windows XP" est cochée $Verification_WindowsXP = 1 If StringInStr($RubriqueTableau_ID[3], $ConversionValeurArray) Then $Verification_WindowsXP += 1 EndIf EndIf If $Lecture_Windows_2003 = 4 Then ; Si la case "Windows 2003" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 2003") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf ElseIf $Lecture_Windows_2003 = 1 Then EndIf If $Lecture_Windows_Vista = 4 Then ; Si la case "Windows Vista" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows vista") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf If $Lecture_Windows_7 = 4 Then ; Si la case "Windows 7" est décochée If StringInStr($RubriqueTableau_OS[3], "Windows 7") Then _GUICtrlListView_DeleteItem($Tableau, $i) EndIf EndIf Next ConsoleWrite("Verif 2000 : "&$Verification_Windows2000&@CRLF&"Verif XP : "&$Verification_WindowsXP&@CRLF) If $Verification_Windows2000 = 1 Then Execute($Elements) ElseIf $Verification_WindowsXP = 1 Then Execute($Elements) EndIf Next EndFunc [EDIT] Regarding the filtering, take a look at John Bailey's script: expandcollapse popup#cs ------------------------------------------------- Author: John Bailey Modifier: name Date Modified: today's date ScriptFunction: description of this script's function AutoIt Ver: version Script Version: 1.0.0 (base code).(improved/added features).(script errors corrected) Script Update History: 1.1.0 - AdvFilter updated to allow for multiple filtering on single column To-Do List (not in importance order): -> 1. Contextmenu for the search input control using the SearchType options. -> = working on #ce ------------------------------------------------- #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GuiListView.au3> #include <GuiComboBox.au3> #include <File.au3> #include <Array.au3> #include <Date.au3> #include <GuiEdit.au3> ;#include <ControlConstants.au3> Opt ("GUIOnEventMode", 1) DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 1) ;==== Row Entries ; Delim. Global $SettingsIR_delimiter = '†' ; File Global $dbRowEntriesFile = @ScriptDir&'\LV Filter - onchange expand.txt' ; Array Global $dbRowEntriesArray ;Array 2D Global $dbRowEntriesArray2D ;Array 2D Column Count Global $dbRowEntriesArray2DCount ;==== Global $checkedSymbol = chr(149) Global $unCheckedSymbol = chr(32) Local $LVHeaders = 'First Name|Last Name|Number|Access' $AppWin = GUICreate("Search Example", 1066, 623, -1, -1) ;GUISetBkColor(0x716F64) $Input = GUICtrlCreateInput("", 31, 39, 240, 22) GUICtrlSetFont(-1, 9, 800, 0, "Rockwell") $Label1 = GUICtrlCreateLabel("Search", 31, 20, 36, 17) GUICtrlSetColor(-1, 0xC0C0C0) $LV_Main = GUICtrlCreateListView($LVHeaders, 31, 65, 510, 495) GUICtrlSendMsg($LV_Main, 0x101E, 0, 120) GUICtrlSendMsg($LV_Main, 0x101E, 1, 178) GUICtrlSendMsg($LV_Main, 0x101E, 2, 40) GUICtrlSendMsg($LV_Main, 0x101E, 3, 70) ;GUICtrlSetBkColor($LV_Main, 0xD4D0C8) Global $TotalColumns = _GUICtrlListView_GetColumnCount($LV_Main) $dbRowEntriesArray2D = _setupRowEntries() $Label2 = GUICtrlCreateLabel("Column To Search", 278, 19, 126, 17) GUICtrlSetColor($Label2, 0xC0C0C0) $ColumnToSearchCB = GUICtrlCreateCombo("All", 277, 39, 128, 25) GUICtrlSetData($ColumnToSearchCB,$LVHeaders) $SearchTypeCB = GUICtrlCreateCombo("Contains", 412, 39, 128, 25) GUICtrlSetData($SearchTypeCB, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Label3 = GUICtrlCreateLabel("Search Type", 413, 18, 98, 17) GUICtrlSetColor($Label3, 0xC0C0C0) $Group1 = GUICtrlCreateGroup("", 563, 81, 457, 370) $Label4 = GUICtrlCreateLabel("Advanced Filter Section", 639, 101, 286, 17, $SS_CENTER) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $Label7 = GUICtrlCreateLabel("Search", 736, 136, 36, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Input1 = GUICtrlCreateInput("", 735, 158, 121, 21) $Input2 = GUICtrlCreateInput("", 735, 190, 121, 21) $Input3 = GUICtrlCreateInput("", 735, 224, 121, 21) $Label5 = GUICtrlCreateLabel("Column To Search", 591, 136, 126, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Combo6 = GUICtrlCreateCombo("First Name", 590, 158, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo7 = GUICtrlCreateCombo("Last Name", 591, 190, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo8 = GUICtrlCreateCombo("Number", 591, 224, 136, 25) GUICtrlSetData(-1, $LVHeaders) $Combo9 = GUICtrlCreateCombo("Access", 590, 255, 136, 25) $Label6 = GUICtrlCreateLabel("Search Type", 864, 136, 98, 17) GUICtrlSetColor(-1, 0xC0C0C0) $Combo2 = GUICtrlCreateCombo("Contains", 863, 158, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo3 = GUICtrlCreateCombo("Contains", 863, 191, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo4 = GUICtrlCreateCombo("Contains", 863, 224, 128, 25) GUICtrlSetData(-1, "Does Not Contain|Begins With|Does Not Begin With|Equals|Not Equal|Greater Than|Greater Than or Equal|Less Than|Less Than or Equal|Is Empty|Not Empty|Checked|Not Checked") $Combo5 = GUICtrlCreateCombo("", 863, 255, 128, 25) GUICtrlSetData(-1, "Checked|Not Checked") $StatusBar = GUICtrlCreateLabel("", 0, 604, 1066, 17, $SS_SUNKEN) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetOnEvent($GUI_EVENT_CLOSE, "_GUIEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_GUIEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "_GUIEvents") GUICtrlSetOnEvent($ColumnToSearchCB, "ButtonPressed") GUICtrlSetOnEvent($Combo2, "ButtonPressed") GUICtrlSetOnEvent($Combo3, "ButtonPressed") GUICtrlSetOnEvent($Combo4, "ButtonPressed") GUICtrlSetOnEvent($Combo5, "ButtonPressed") GUICtrlSetOnEvent($SearchTypeCB, "ButtonPressed") GUISetState(@SW_SHOW) _loadRowEntries($LV_Main) While 1 Sleep(25) WEnd ;=============================================================================== ; ; Function Name: _() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterLVItems($fil_SearchType='Contains',$fil_columntoSearch=0) Local $LVtofilter = $LV_Main Local $fil_searchInput = $Input Local $fil_Array = $dbRowEntriesArray Local $fil_Array2D = $dbRowEntriesArray2D Local $fil_Array2DColumns = $dbRowEntriesArray2DCount Local $fil_SearchTypeCB = $SearchTypeCB Local $fil_checkedSymbol = $checkedSymbol Local $fil_SearchText = GUICtrlRead($fil_searchInput) Local $SearchCharLen = StringLen($fil_SearchText) _GUICtrlListView_DeleteAllItems($LVtofilter) If $fil_SearchText <> '' OR $fil_SearchType = 'Is Empty' OR $fil_SearchType = 'Not Empty' OR $fil_SearchType = 'Checked' OR $fil_SearchType = 'Not Checked' Then If $fil_SearchType = 'Contains' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array[$a],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Does Not Contain' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array[$a],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_SearchText) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Begins With' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array[$a] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array2D[$a][$fil_columntoSearch-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Does Not Begin With' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array[$a] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 Local $String = $fil_Array2D[$a][$fil_columntoSearch-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $fil_SearchText Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Equals' Then Local $fil_SearchText = GUICtrlRead($fil_searchInput) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText = $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText = $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Not Equal' Then Local $fil_SearchText = GUICtrlRead($fil_searchInput) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <> $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <> $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Greater Than' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText > $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText > $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Greater Than or Equal' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText >= $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText >= $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Less Than' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText < $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText < $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Less Than or Equal' Then Local $fil_SearchText = Number(GUICtrlRead($fil_searchInput)) If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <= $fil_Array[$a] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If $fil_SearchText <= $fil_Array2D[$a][$fil_columntoSearch-1] Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Is Empty' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $fil_subCounter=0 Local $fil_add = 0 For $fil_subCounter=1 to $fil_Array2DColumns Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_subCounter-1],Number($fil_SearchText)) = '' Then $fil_add = 1 EndIf Case Else If $fil_Array2D[$a][$fil_subCounter-1] = '' Then $fil_add = 1 EndIf EndSwitch Next If $fil_add <> 0 Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next Else For $a = 1 to UBound($fil_Array)-1 Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_columntoSearch-1],Number($fil_SearchText)) = '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Case Else If $fil_Array2D[$a][$fil_columntoSearch-1] = '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf EndSwitch Next EndIf ElseIf $fil_SearchType = 'Not Empty' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 Local $fil_subCounter=0 Local $fil_add = 0 For $fil_subCounter=1 to $fil_Array2DColumns Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_subCounter-1],Number($fil_SearchText)) <> '' Then $fil_add = 1 EndIf Case Else If $fil_Array2D[$a][$fil_subCounter-1] <> '' Then $fil_add = 1 EndIf EndSwitch Next If $fil_add <> 0 Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next Else For $a = 1 to UBound($fil_Array)-1 Switch Number($fil_SearchText) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$fil_columntoSearch-1],Number($fil_SearchText)) <> '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Case Else If $fil_Array2D[$a][$fil_columntoSearch-1] <> '' Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf EndSwitch Next EndIf ElseIf $fil_SearchType = 'Checked' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array[$a],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf ElseIf $fil_SearchType = 'Not Checked' Then If $fil_columntoSearch = 0 Then For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array[$a],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next Else For $a = 1 to UBound($fil_Array)-1 If NOT StringInStr($fil_Array2D[$a][$fil_columntoSearch-1],$fil_checkedSymbol) Then _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndIf Else ; Search Type is not setup MsgBox(0,'Search Type Error',$fil_SearchType&' is not set in the code') For $a = 1 to UBound($fil_Array)-1 _FilterLV_AddtoLV($LVtofilter,$fil_Array,$SettingsIR_delimiter) Next EndIf ; Full List - No Filter - Blank Input Area Else For $a = 1 to UBound($fil_Array)-1 _FilterLV_AddtoLV($LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) Next EndIf EndFunc ;=============================================================================== ; ; Function Name: _FilterAdv() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterAdv($faaa_string) Local $fil_LVtofilter = $LV_Main Local $fil_Array = $dbRowEntriesArray Local $fil_Array2D = $dbRowEntriesArray2D Local $fil_checkedSymbol = $checkedSymbol Local $sSplit = StringSplit($faaa_string,$SettingsIR_delimiter) _GUICtrlListView_DeleteAllItems($fil_LVtofilter) For $a = 1 to UBound($fil_Array)-1 Local $faaa_yes = 1 Local $count For $count = 1 to $sSplit[0] Local $cSplit = StringSplit($sSplit[$count],'‡') Local $LVHeadersArray=StringSplit($LVHeaders,'|',1) Local $fil_ColumnToSearch= _ArraySearch($LVHeadersArray,$cSplit[3],1) Local $counter = $fil_ColumnToSearch If $cSplit[1] <> '' Then If $cSplit[2] = 'Contains' Then If NOT StringInStr($fil_Array2D[$a][$counter-1],$cSplit[1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Does Not Contain' Then If StringInStr($fil_Array2D[$a][$counter-1],$cSplit[1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Begins With' Then Local $SearchCharLen = StringLen($cSplit[1]) Local $String = $fil_Array2D[$a][$counter-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result <> $cSplit[1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Does Not Begin With' Then Local $SearchCharLen = StringLen($cSplit[1]) Local $String = $fil_Array2D[$a][$counter-1] Local $stringlen = StringLen($String) Local $result = StringTrimRight($String, $stringlen-$SearchCharLen) If $result = $cSplit[1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Equals' Then If $cSplit[1] <> $fil_Array2D[$a][$counter-1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Not Equal' Then If $cSplit[1] = $fil_Array2D[$a][$counter-1] Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Greater Than' Then If Number($cSplit[1]) >= Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Greater Than or Equal' Then If Number($cSplit[1]) > Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Less Than' Then If Number($cSplit[1]) <= Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Less Than or Equal' Then If Number($cSplit[1]) < Number($fil_Array2D[$a][$counter-1]) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Is Empty' Then Switch Number($cSplit[1]) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$counter-1],Number($cSplit[1])) <> '' Then $faaa_yes = 0 EndIf Case Else If $fil_Array2D[$a][$counter-1] <> '' Then $faaa_yes = 0 EndIf EndSwitch ElseIf $cSplit[2] = 'Not Empty' Then Switch Number($cSplit[1]) Case 1,2,3,4,5,6,7,8 If StringStripWS($fil_Array2D[$a][$counter-1],Number($cSplit[1])) = '' Then $faaa_yes = 0 EndIf Case Else If $fil_Array2D[$a][$counter-1] = '' Then $faaa_yes = 0 EndIf EndSwitch ElseIf $cSplit[2] = 'Checked' Then If NOT StringInStr($fil_Array2D[$a][$counter-1],$fil_checkedSymbol) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = 'Not Checked' Then If StringInStr($fil_Array2D[$a][$counter-1],$fil_checkedSymbol) Then $faaa_yes = 0 EndIf ElseIf $cSplit[2] = '' Then ; Else MsgBox(0,'Search Type Error',$cSplit[2]&' is not set in the code') EndIf EndIf Next If $faaa_yes = 1 Then _FilterLV_AddtoLV($fil_LVtofilter,$fil_Array[$a],$SettingsIR_delimiter) EndIf Next EndFunc ;=============================================================================== ; ; Function Name: _() ; Description: ; Parameter(s): ; $ - string - Optional: ; 0 = (Default) 1 ; 1 = 1 ; ; ; Requirement(s): ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @ERROR ; @ERROR - 0 = ; - 1 = ; - 2 = ; - 3 = ; @Extended - ; CallTip: ; Author(s): John Bailey ; ;=============================================================================== Func _FilterLV_AddtoLV(ByRef $fL_LVtofilter, ByRef $fL_LinetoAdd,$fL_delimiter='†') Local $itemLineArray = StringSplit($fL_LinetoAdd,$fL_delimiter,1) Local $itemLine = '' Local $b For $b = 1 to $itemLineArray[0] If $b = $itemLineArray[0] Then $itemLine &= $itemLineArray[$b] Else $itemLine &= $itemLineArray[$b]&'|' EndIf Next GUICtrlCreateListViewItem($itemLine, $fL_LVtofilter) EndFunc Func _setupRowEntries() ;set it up after the columns are setup _FileReadToArray($dbRowEntriesFile,$dbRowEntriesArray) If @error Then Msgbox(0,'File not read to Array',$dbRowEntriesFile&@LF&' to $dbRowEntriesArray') EndIf Local $headerSplit = StringSplit($LVHeaders,'|',1) $dbRowEntriesArray2DCount = $headerSplit[0] Local $sre_dbRowEntriesArray2D[UBound($dbRowEntriesArray)][$dbRowEntriesArray2DCount] Local $x = 1 For $x = 1 to UBound($dbRowEntriesArray)-1 Local $readSplitArray = StringSplit($dbRowEntriesArray[$x],$SettingsIR_delimiter,1) Local $xx = 0 For $xx = 1 to $readSplitArray[0] $sre_dbRowEntriesArray2D[$x][$xx-1] = $readSplitArray[$xx] Next Next Return $sre_dbRowEntriesArray2D EndFunc Func _loadRowEntries(ByRef $lvID) For $x = 1 to Ubound($dbRowEntriesArray2D)-1 Local $itemLine = '' For $xx = 1 to $dbRowEntriesArray2DCount If $xx = $dbRowEntriesArray2DCount Then $itemLine &= $dbRowEntriesArray2D[$x][$xx-1] ;If $dbRowEntriesArray2D[$x][$xx-1] = 'true' Then ; $itemLine &= $checkedSymbol ;ElseIf $dbRowEntriesArray2D[$x][$xx-1] = 'false' Then ; $itemLine &= $checkedSymbol ;EndIf Else $itemLine &= $dbRowEntriesArray2D[$x][$xx-1]&'|' EndIf Next GUICtrlCreateListViewItem($itemLine, $lvID) Next EndFunc Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam) ; gaFrost for monitoring inputfield change Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0xFFFF) Local $hCtrl = $lParam Switch $nID Case $Input Switch $nNotifyCode Case $EN_CHANGE _FilterLVItems(GUICtrlRead($SearchTypeCB),_GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB )) EndSwitch Case $Input1, $Input2, $Input3 Local $df = GUICtrlRead($Input1)&'‡'&GUICtrlRead($Combo2)&'‡'&GUICtrlRead($Combo6)&'†'&GUICtrlRead($Input2)&'‡'&GUICtrlRead($Combo3)&'‡'&GUICtrlRead($Combo7)&'†'&GUICtrlRead($Input3)&'‡'&GUICtrlRead($Combo4)&'‡'&GUICtrlRead($Combo8)&'†'&'blank'&'‡'&GUICtrlRead($Combo5)&'‡'&GUICtrlRead($Combo9) _FilterAdv($df) EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND ;==>WM_Notify_Events Func ButtonPressed() Switch @GUI_CTRLID case $ColumnToSearchCB Local $CBcurrentIndex = _GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB ) _FilterLVItems(GUICtrlRead($SearchTypeCB),$CBcurrentIndex) Case $SearchTypeCB Local $CBcurrentIndex = _GUICtrlComboBox_GetCurSel ( $ColumnToSearchCB ) _FilterLVItems(GUICtrlRead($SearchTypeCB),$CBcurrentIndex) Case $Combo2,$Combo3,$Combo4,$Combo5 Local $df = GUICtrlRead($Input1)&'‡'&GUICtrlRead($Combo2)&'‡'&GUICtrlRead($Combo6)&'†'&GUICtrlRead($Input2)&'‡'&GUICtrlRead($Combo3)&'‡'&GUICtrlRead($Combo7)&'†'&GUICtrlRead($Input3)&'‡'&GUICtrlRead($Combo4)&'‡'&GUICtrlRead($Combo8)&'†'&'blank'&'‡'&GUICtrlRead($Combo5)&'‡'&GUICtrlRead($Combo9) _FilterAdv($df) EndSwitch EndFunc Func _GUIEvents() Select Case @GUI_CTRLID = $GUI_EVENT_CLOSE Exit Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE Case @GUI_CTRLID = $GUI_EVENT_RESTORE EndSelect EndFunc Thanks to Taietel for your improvement. I'm looking the code of John Bailey, but I don't see how to adapt his script to mine..
ATR Posted March 29, 2011 Author Posted March 29, 2011 After lots of tests, I still have not found solution !! I can't enforce several filters...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now